This content has been marked as final. Show 4 replies
I was going to suggest that your transformation should just output that processing-instruction as the first thing it does.
But then I noticed you were just doing an identity transformation, so you don't have a transformation. So, couldn't you take the identity transformation and modify it to output that PI as the first line of the output? Then use that to transform the data.
DrClap, thanks for the reply. I believe that is the approach I saw used when constructing a DOM to hold the output. You create the structure first then insert the process instruction where needed. Unfortunately, that means building and maintaining the entire structure in memory. Because of the potential size of the overall output I'm trying to go with the SAX approach where I'm actually outputting the data line by line. The SAX transform just helps with the formatting and encoding.
However, if the DOM concept is the only way then I may have to switch my approach. But i though I would ask the question first to see what results I get or to find out if it is even supported at all.
Sorry, I missunderstood. Since I saw an example using an insertion of an instruction before an element that was based on a DOM I thought that was what you were referring to. Since using SAX outputs each line one at a time, I couldn't see how an insertion could work. At least that appears to be how it works to me.
I guess i don't understand the reference to an "actual transformation" vs. the "default identify transformation". I've basically used the standard default SAX and DOM factories to read and ouput XML but I'm not versed on other options. Could you provide a link or more information on how I could use a different transformer with SAX to get the desired results?