[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Performance benefit in using DOMResult?
In my code that calls transformer.transform (using xalan transformer) to do
xslt transformation, I was using StreamSource and StreamResult till now. But
now I have a requirement to do further checks on the output xml to see if it
has some specific nodes and if yes, then create xml string from those nodes.
Since DOM will allow me to access random nodes directly, I feel that I need
a DOM tree of the output xml.
One option is to continue using StreamResult and parse the xml again using DOM/SAX. But here it seems like I would be unnecessarily reparsing the output xml. So instead, I am thinking of replacing StreamResult by DOMResult. I can then carry out the further checks on the output DOM tree. The expected benefit is: 1. avoiding reparsing of transformed output xml 2. hopefully leverage the result tree that the transformer creates internally i.e. no DOM tree creation from scratch Can someone tell me if pt 2 is even a possibility? Will using DOMResult still result in a conversion from the internal tree structure to the DOM tree? Is there anyway to avoid this? If none, I presume I will still be better off since I still avoid reparsing the output xml. Thanks, Vish.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|