I'm using xalan with the following xsl header:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:redirect="http://xml.apache.org/xalan/redirect"
extension-element-prefixes="redirect"
xmlns:xalan="http://xml.apache.org/xalan">
<xsl:output method="text" indent="yes" xalan:indent-amount="4"/>
And the output is not indented.
Anyone with ideas?
For indentation you need to use a different namespace: "http://xml.apache.org/xslt" (see this issue)
Jirka-x1, thank you for the issue-link. I used the following (as proposed by Ed Knoll 13/Aug/04):
This works for me with xalan (java) 2.7.1.
Was struggling with this for a while, however just got it working accidentally:
the key was to add
<xsl:strip-space elements="*"/>
so it will look like this:
Not sure why, but probably removing all whitespacing helps xalan figure out the indentation
I guess you have to set the
method
toxml
. If that does not work, try the following: