• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

track progress of an xsl transformation?

 
colin caufield
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone, this is my first post here.
I am currently working on an app that performs an xsl transformation (xml -> html). The transformation itself is very complicated and takes anywhere from 10 seconds to 1 minute, depending on the size of the original xml file. I would like to present the user with some progress information; perhaps a JProgressBar and some text. How can I acheive this? I've looked through the entire javax.xml package and have not found any classes/methods that support such tracking. I'm hoping I wont have to dig through the source of javax.xml and build my own subclasses.
Any ideas?
Thanks,
Colin
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by colin caufield:
Hi everyone, this is my first post here.
I am currently working on an app that performs an xsl transformation (xml -> html). The transformation itself is very complicated and takes anywhere from 10 seconds to 1 minute, depending on the size of the original xml file. I would like to present the user with some progress information; perhaps a JProgressBar and some text. How can I acheive this? I've looked through the entire javax.xml package and have not found any classes/methods that support such tracking. I'm hoping I wont have to dig through the source of javax.xml and build my own subclasses.
Any ideas?
Thanks,
Colin

If I assume that your application is based on Swings, please post a question in swing , JFC forum, with a title "wait screen" , someone there may help you.
I guess!..
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Colin,
I have never heard of any support for progress information in the transformation APIs, and I really doubt such thing could exist.
Anyway, there should be several ways to achieve this. One of them would be to split the complex transformation into small ones, to transform your original XML document in multiple passes.
I have done that in a previous project where transformation stylesheets were very complex. There are multiple poisitve side effects in doing this
1. The small transformations might become reusable for other types of XML feeds.
2. The XSLT code becomes easier to maintain
3. Because your small transformations are easier to understand, there is a better chance of optimisation.
To achieve ideal performance, you will have to stream the output of one transformation into the input of the next transform, by using SAXResult and SAXSource for instance if you're using TraX (Transformation API for XML = javax.xml.transform package).
Good luck
PS: Despite what Balaji says I think it is the right forum to ask your question. The way the progress information is displayed seems a secondary.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic