Created
March 21, 2012 14:16
-
-
Save andrewminton/2147219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<data> | |
<the-pip> | |
<entry> | |
<published-by> | |
<item id="191" handle="tim-powell" section-handle="team-members" section-name="Team Members">Tim Powell</item> | |
</published-by> | |
</entry> | |
<entry> | |
<published-by> | |
<item id="192" handle="andy-minton" section-handle="team-members" section-name="Team Members">Andy Minton</item> | |
</published-by> | |
</entry> | |
<entry> | |
<published-by> | |
<item id="191" handle="tim-powell" section-handle="team-members" section-name="Team Members">Tim Powell</item> | |
</published-by> | |
</entry> | |
</the-pip> | |
</data> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="xml" indent="yes" /> | |
<xsl:key name="staff-by-surname" match="published-by" use="item" /> | |
<xsl:template match="data"> | |
<hi>The Pip</hi> | |
<xsl:apply-templates select="the-pip/entry"/> | |
</xsl:template> | |
<xsl:template match="the-pip/entry"> | |
<xsl:apply-templates | |
select="published-by[count(. | key('staff-by-surname', item)[1]) = 1]"/> | |
</xsl:template> | |
<xsl:template match="published-by/item"> | |
<p><xsl:value-of select="key('staff-by-surname', item)"/></p> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment