File: Data.xml
<?xml version="1.0" encoding="UTF-8"?>
<provinces>
<province id="AB">
<name>Alberta</name>
<abbreviation>AB</abbreviation>
</province>
<province id="BC">
<name>British Columbia</name>
<abbreviation>BC</abbreviation>
</province>
<province id="MB">
<name>Manitoba</name>
<abbreviation>MB</abbreviation>
</province>
<province id="NB">
<name>New Brunswick</name>
<abbreviation>NB</abbreviation>
</province>
</provinces>
File: Transform.xslt
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:template match="provinces">
<xsl:apply-templates select="id('NU')" />
</xsl:template>
<xsl:template match="id('NU')">
<xsl:value-of select="name" />
</xsl:template>
</xsl:stylesheet>
|