-
Backport
-
Resolution: Fixed
-
P3
-
None
See Description Note of parent CR 5064280.
Note: I cannot find the original description, since Bugster just says
"See Description Note of parent CR 5064280."
so I am assuming that I originally filed this about supporting
<xsl:output method="xml" indent="yes" xalan:indent-amount="4" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xslt"/>
which does in fact seem to work fine in both 1.5.0_04 and Mustang b45. I.e. this works:
String xslt =
"<xsl:stylesheet version='1.0' " +
"xmlns:xsl='http://www.w3.org/1999/XSL/Transform' " +
"xmlns:xalan='http://xml.apache.org/xslt' " +
"exclude-result-prefixes='xalan'>" +
"<xsl:output method='xml' indent='yes' xalan:indent-amount='4'/>" +
"<xsl:template match='@*|node()'>" +
"<xsl:copy>" +
"<xsl:apply-templates select='@*|node()'/>" +
"</xsl:copy>" +
"</xsl:template>" +
"</xsl:stylesheet>";
Transformer t = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(xslt)));
t.transform(..., ...);
but this does not:
Transformer t = TransformerFactory.newInstance().newTransformer();
t.setOutputProperty(OutputKeys.INDENT, "yes");
t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
t.transform(..., ...);
Newlines are printed but no indentation, despite the output property.
Note: I cannot find the original description, since Bugster just says
"See Description Note of parent CR 5064280."
so I am assuming that I originally filed this about supporting
<xsl:output method="xml" indent="yes" xalan:indent-amount="4" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xslt"/>
which does in fact seem to work fine in both 1.5.0_04 and Mustang b45. I.e. this works:
String xslt =
"<xsl:stylesheet version='1.0' " +
"xmlns:xsl='http://www.w3.org/1999/XSL/Transform' " +
"xmlns:xalan='http://xml.apache.org/xslt' " +
"exclude-result-prefixes='xalan'>" +
"<xsl:output method='xml' indent='yes' xalan:indent-amount='4'/>" +
"<xsl:template match='@*|node()'>" +
"<xsl:copy>" +
"<xsl:apply-templates select='@*|node()'/>" +
"</xsl:copy>" +
"</xsl:template>" +
"</xsl:stylesheet>";
Transformer t = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(xslt)));
t.transform(..., ...);
but this does not:
Transformer t = TransformerFactory.newInstance().newTransformer();
t.setOutputProperty(OutputKeys.INDENT, "yes");
t.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
t.transform(..., ...);
Newlines are printed but no indentation, despite the output property.
- backport of
-
JDK-5064280 XSLT output type XML does not honor {http://xml.apache.org/xslt}indent-amount in
-
- Resolved
-