P
Petr Vlcek
Hello,
I have a file with records storing information about people, something
like this:
<people>
<person>
<name>John</name>
<name>Fitzgerald</name>
<name>Kennedy</name>
</person>
<person>
<name>George</name>
<name>Walker</name>
<name>Bush</name>
</person>
<person>
<name>George</name>
<name>Washington</name>
</person>
</people>
I have tried to write XSLT template that would sort records by name. When
first names are the same, it would sort by second name, etc. The problem
is, that records can differ with number of names.
For fixed number of names (here it is 2) it is possible to use this
template:
<xsl:sort select="name[1]"/>
<xsl:sort select="name[2]"/>
Does anyone have an idea how to do it for dynamic number of names?
Thanks in advance, Petr Vlcek.
I have a file with records storing information about people, something
like this:
<people>
<person>
<name>John</name>
<name>Fitzgerald</name>
<name>Kennedy</name>
</person>
<person>
<name>George</name>
<name>Walker</name>
<name>Bush</name>
</person>
<person>
<name>George</name>
<name>Washington</name>
</person>
</people>
I have tried to write XSLT template that would sort records by name. When
first names are the same, it would sort by second name, etc. The problem
is, that records can differ with number of names.
For fixed number of names (here it is 2) it is possible to use this
template:
<xsl:sort select="name[1]"/>
<xsl:sort select="name[2]"/>
Does anyone have an idea how to do it for dynamic number of names?
Thanks in advance, Petr Vlcek.