[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Wrong indentation with javax.xml.transform.Transf
Just an observation on pretty-printing issues: If you, or users of your output, were using a virtual formatting viewer or editor (which just extends the left-margin to indent) you wouldn't care about the pretty print formatting characters. You would simply view/edit the XML in the formatting style set in the virtual formatter. The preference then would be to set the INDENT property of transformer to "no", but otherwise the virtual formatter would remove the pretty-print characters for you anyway to ensure the view (but not the text) was properly formatted. So far as preserving the integrity of the XML content goes: generally, its safer to trim formatting characters than to add them. This is because the pattern of leading whitespace characters can actually be exploited by the trimming algorithm to ensure only pretty-print whitespace is removed. Unless a schema can be exploited, a pretty-printer doesn't have the equivalent information to prevent it adding whitespace to unformatted XML where it shouldn't. For this reason, I use code to ensure that the XSLT processor I use never indents the XML output, even when xsl:output settings in the XSLT request otherwise. The only thing the virtual formatter then does to the XML is insert formatting line-feeds if required. Phil Fearon http://qutoric.com
|
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
|