P
pstachy
Hi all,
I'm having problem with XSLT transformation concerned with sort and
numberings at a time.
I wish to have my registries sorted alfabetically and would like them
to have numberings at a time as well.
My XML:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="xsl.xsl"?>
<root>
<child><name>Paul</name></child>
<child><name>Adam</name></child>
<child><name>Will</name></child>
<root>
My XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="//child">
<xsl:sort order="ascending" select="name" data-type="text"/>
</xsl:apply-templates>
</body>
</html>
</xsl:template>
<xsl:template match="child">
<xsl:number format="1. "/>
<xsl:value-of select="name" /><br />
</xsl:template>
</xsl:stylesheet>
And would like to have the following after transformation:
1. Adam
2. Paul
3. Will
Unfortunatelly result is not the one I expected:
2. Adam
1. Paul
3. Will
Please help, thanks in advance....
I'm having problem with XSLT transformation concerned with sort and
numberings at a time.
I wish to have my registries sorted alfabetically and would like them
to have numberings at a time as well.
My XML:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="xsl.xsl"?>
<root>
<child><name>Paul</name></child>
<child><name>Adam</name></child>
<child><name>Will</name></child>
<root>
My XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<xsl:apply-templates select="//child">
<xsl:sort order="ascending" select="name" data-type="text"/>
</xsl:apply-templates>
</body>
</html>
</xsl:template>
<xsl:template match="child">
<xsl:number format="1. "/>
<xsl:value-of select="name" /><br />
</xsl:template>
</xsl:stylesheet>
And would like to have the following after transformation:
1. Adam
2. Paul
3. Will
Unfortunatelly result is not the one I expected:
2. Adam
1. Paul
3. Will
Please help, thanks in advance....