|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Splitting multiple node occurrences into separate
Thanks for your reply, Aaron.
Vishwajit, parsing a string containing XML into XML elements is functionality provided by some parsers; see eval() functions. Generating multiple outdocuments from a single input is also extended functionality provided by some processors. Actually my example was probably too simplistic. The source xml may not have the "a" nodes (mentioned in my earlier post) exactly as they need to be in the o/p - so it needs to be transformed resulting in the generation of the "a" nodes. So the transformation is not just to split those "a" nodes. I checked out xalan and it does not seem to support multiple o/p docs. Can you let me know which processor does? If you don't want to use the multiple-document extension, and don't care about processing efficiency (though from prior posts you do seem to want to keep tabs on that metric), one approach to splitting You observed right. Efficiency is important - currently I am doing the transformation and letting all the "a" nodes remain in the output xml. I get the output as a DOMResult (thereby hopefully leveraging the internal result tree created by xalan) and then parse the DOM to isolate each "a" occurrence. Most of the "a" nodes would be children of the root - so not too much traversal. I could have used xalan XPath API instead but it seems to come with its own baggage. DOM itself does not seem to offer a way to serialize a node to xml. So either I use the xerces DOMSerializer or use the transformer to do it - I chose the latter, as the former seems to be more for pretty printing. Thanks and regards, Vishwajit.
|
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
|

Cart








