[xslt] Indentation with <xsl:output method="xml" indent="yes"/>
- From: Vincent Lefevre <vincent+gnome vinc17 org>
- To: xslt gnome org
- Subject: [xslt] Indentation with <xsl:output method="xml" indent="yes"/>
- Date: Mon, 14 Feb 2005 14:35:01 +0100
Hi,
I don't understand how indentation is done with
<xsl:output method="xml" indent="yes"/>. Perhaps a bug?
*** test.xml:
<?xml version="1.0"?>
<page name="index">
<page name="p1"/>
<page name="p2"/>
</page>
*** test.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template name="pages">
<file name="a"/>
<file name="b"/>
</xsl:template>
<xsl:template match="page">
<page>
<alternates>
<xsl:call-template name="pages"/>
</alternates>
<xsl:apply-templates/>
</page>
</xsl:template>
</xsl:stylesheet>
Here's what I get (Linux, Debian/unstable):
dixsept:~> xsltproc test.xsl test.xml
<?xml version="1.0"?>
<page><alternates><file name="a"/><file name="b"/></alternates>
<page><alternates><file name="a"/><file name="b"/></alternates></page>
<page><alternates><file name="a"/><file name="b"/></alternates></page>
</page>
I wonder why I don't get the same form as with xmllint --format:
dixsept:~> xsltproc test.xsl test.xml | xmllint --format -
<?xml version="1.0"?>
<page>
<alternates>
<file name="a"/>
<file name="b"/>
</alternates>
<page>
<alternates>
<file name="a"/>
<file name="b"/>
</alternates>
</page>
<page>
<alternates>
<file name="a"/>
<file name="b"/>
</alternates>
</page>
</page>
--
Vincent Lefèvre <vincent vinc17 org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]