Re indentation some places but not others: Are you sure you're getting indentation at all, rather than copying through whitespace that appeared in your source document or stylesheet?

Re not getting indentation: To have Xalan indent the generated document, you have to set two separate values. First, you need to set the standard XSLT indent="yes" flag in your <xsl:output/> element. Second, since Xalan's currently using 0 as its default indentation depth, you need to reset that value by using the indent-amount property; there's an example of this shown in http://xml.apache.org/xalan-j/usagepatterns.html#outputprops

We may want to consider changing the default indentation amount at some point, simply because 0 *does* confuse people.


This is a fairly common question, and the answer really isn't very easy for a novice to find. It might be worth adding an entry in our FAQ document which points to this description. It would probably also be worthwhile to add a top-level navigation item for "properties" -- similar to that in the Xerces documentation -- since users may not realize that our "usage patterns" page covers this.

______________________________________
Joe Kesselman / IBM Research

Reply via email to