Armmarti
many, many thanks for your answer, it worked and I'm really happy, thanks to you.
I wish you a really good week!
Thanks
Juan
Quote:
quote:Originally posted by armmarti
I put all the stuff in the "root template", though it will be better to break it down to several templates:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="set-of-states" select="/cities/city/stateName[not(. = preceding::stateName)]"/>
<xsl:for-each select="$set-of-states">
<xsl:sort select="."/>
<br/>
[<xsl:value-of select="."/>]<br/>
<xsl:for-each select="/cities/city/cityName[../stateName = current()]">
<xsl:sort select="."/>
<xsl:value-of select="."/><br/>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
|