R
Ruthless
hello.
All XML and XSLT are processed by preprocessor as a trees.
How can i simply display my XML as some kind of tree.
given xml:
<struct>
<node level="1" no="1">
<node level="2" no="2" />
</node>
<node level="1" no="5">
<node level="2" no="8" />
</node>
</struct>
given xslt:
<xsl:template match="struct">
<html>
<body>
<xsl:for-each select="node">
<xsl:sort select="@level"/>
<blockquote><pre>
<xsl:value-of select="name()"/> <br/>
<xsl:value-of select="@no"/> <br/>
<xsl:value-of select="@level"/>
</pre></blockquote>
</xsl:for-each>
</body>
</html>
</xsl:template>
i'd like with a little help of <blockquote> do indentation
and as a result sth like this:
node 1
node 2
node 3
node 4
node 2
node 1
but my xslt does it linear and the nodes of all levels are in the same
position:
[..]
node 4
node 2
node 1
thanx in advance
greetings R
All XML and XSLT are processed by preprocessor as a trees.
How can i simply display my XML as some kind of tree.
given xml:
<struct>
<node level="1" no="1">
<node level="2" no="2" />
</node>
<node level="1" no="5">
<node level="2" no="8" />
</node>
</struct>
given xslt:
<xsl:template match="struct">
<html>
<body>
<xsl:for-each select="node">
<xsl:sort select="@level"/>
<blockquote><pre>
<xsl:value-of select="name()"/> <br/>
<xsl:value-of select="@no"/> <br/>
<xsl:value-of select="@level"/>
</pre></blockquote>
</xsl:for-each>
</body>
</html>
</xsl:template>
i'd like with a little help of <blockquote> do indentation
and as a result sth like this:
node 1
node 2
node 3
node 4
node 2
node 1
but my xslt does it linear and the nodes of all levels are in the same
position:
[..]
node 4
node 2
node 1
thanx in advance
greetings R