N
Neil Zanella
Hello,
I would like to know whether it is possible to get an XSLT processor to output
tags with the proper indentation. For instance, given the following standard
example I get the output given below:
$ cat hello.xml
<?xml version="1.0"?>
<greeting>
Hello, World!
</greeting>
$ cat hello.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xslutput method="html" />
<xsl:template match="/">
<xsl:apply-templates select="greeting" />
</xsl:template>
<xsl:template match="greeting">
<html>
<body>
<h1>
<xsl:value-of select="." />
</h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
$ xsltproc hello.xsl hello.xml
<html><body><h1>
Hello, World!
</h1></body></html>
.... but this is my first time running an XSLT processor and I was expecting:
<html>
<body>
<h1>
Hello, World!
</h1>
</body>
</html>
Is there anything I can do about this to fix it?
Thanks,
Neil
I would like to know whether it is possible to get an XSLT processor to output
tags with the proper indentation. For instance, given the following standard
example I get the output given below:
$ cat hello.xml
<?xml version="1.0"?>
<greeting>
Hello, World!
</greeting>
$ cat hello.xsl
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xslutput method="html" />
<xsl:template match="/">
<xsl:apply-templates select="greeting" />
</xsl:template>
<xsl:template match="greeting">
<html>
<body>
<h1>
<xsl:value-of select="." />
</h1>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
$ xsltproc hello.xsl hello.xml
<html><body><h1>
Hello, World!
</h1></body></html>
.... but this is my first time running an XSLT processor and I was expecting:
<html>
<body>
<h1>
Hello, World!
</h1>
</body>
</html>
Is there anything I can do about this to fix it?
Thanks,
Neil