I have a body of content, structured as:
Code:
<content>
<item>
<tag>...</tag>
<tag>...</tag>
<tag>...</tag>
<date>...</date>
...
</item>
...
</content>
My goal is to generate a list of all tags, sortable by date. "Date" in this context would mean the most recent "date" child of any "item" node that contains a given "tag" child. Dates are ISO 8601 formatted.
Currently, this list of tags is sorted alphabetically. How can I modify the below XSL (1.0) to achieve a "last-modified" sort, as outlined above?
Code:
<xsl:key name="group-by-tag" select="content/item/tag" use="."/>
...
<xsl:for-each
select="content/item/tag[generate-id()=generate-id(key('group-by-tag',.)[1])]">
<xsl:sort select="." order="ascending"/>
<xsl:value-of select="."/>
</xsl:for-each>
Thank you for any assistance you can provide.