This is the deal, i have made several web applications in both the Micro and Java world using xml and xslt for document related processing. For large documents, performance is sacrificed, and this is fine, i mean hey... we are using large documents here right?
But there are a couple of rule based engines out there, integrated with xml libraries, specifically the dom4j patterns and rules for templates API.
I was wondering if anyone had tried to increase performance by doing something similiar to: making a transform that would create OO java code - so that entire template documents would not need to be held in memory - and or utilized through file-system access.
I may be on to something here if no one has even considered it, but if someone has - i am curious b/c it is not going to be a trivial undertaking, and my most thorough of searches has turned up no history of such a thing.
This may belong in the performance discussion - but it is VERY dom4j and web service oriented.
Any thoughts are appreciate!
I haven't used this myself but have come across it while doing XML/XSL work. If I'm following you correctly, I believe you should check out:
javax.xml.transform.TransformerFactory.newTemplates(Source source) (Process the Source into a Templates object, which is a a compiled representation of the source.)
Of course, this is prob only applicable if you're using the core libraries.
I also know Xalan supports compiling of XSL files.
Hope this helps :)
Thanks for the tip. I think you certainly follow what i am trying to do. The newTemplates method for the javax.xml.TransformerFactory class would accomplish my goal of placing an entire transform in memory, rather than accessing a file system every so often.
I know that dom4j uses the JAXP TransformerFactory class to implement xslt interfaces, and then uses the its own dom versions of org.dom4j.io.DocumentResult and org.dom4j.io.DocumentSource to support the dom4j Document interfaces.
In your experience, is there any benefit to using the newTemplates(Source) method versus the newTransformer(Source) method to create to accomplish transformations?
Any and all thoughts are much appreciated!
I am curious to see the actual performance gains of keeping xslt sources in memory versus on the filesystem.
From my experience, the only time I got a real massive performance boost (and a dramatic memory usage decrease) was when I dropped Xerces/Xalan for James Clark's XP/XT. I even very easily twiddled XT so that its XML cache would last for several transformation sessions (instead of being flushed every for every transform).