[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

Subject: Re: Is it OK for xsl:output to affect the construction of an unserialized result tree?
From: Barry Lay <blay@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 20 Jul 2004 13:02:28 -0400
reformat xml document
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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.