[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Is it OK for xsl:output to affect the construction
I would find this sort of behaviour non-intuitive. Using the JAXP API
the attributes in the xsl:output element show up in the output
properties of the transformer. In fact I have been able to reformat an
XML document using a null transform and setting the property:
StreamResult result = new StreamResult( new FileWriter(projectBase + fileName) ); TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(); transformer.setOutputProperty( "indent", "yes" ); transformer.transform( source, result ); I would guess that the serialization stage is interpreting the output properties. I am using Saxon so Michael Kay could confirm that this is true but I would be surprised (and a bit miffed) if it inserted text nodes into the result if "result" were a DOM. I don't know if there is a suitable place to put the output instructions in a DOM - they may just go away in that case. Elliotte Rusty Harold wrote: We should note that the general issue of whether the xsl:output can affect the construction of the result tree goes beyond the specific case cited here. For instance, if it is OK for xsl:output to do this, then one might imagine that <xsl:output indent="yes"/> could lead to the insertion of additional text nodes in the result tree, though to my knowledge no XSLT processor yet does that.
|
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
|