I've got this xml
document:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl"
href=""?>
<Topology xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Manager Name="John">
<Employee ID="101" Department="d2"/>
<Employee ID="103" Department="d1"/>
<Employee ID="108" Department="d1"/>
<Employee ID="102" Department="d4"/>
<Employee ID="119" Department="d2"/>
<Employee ID="111" Department="d4"/>
</Manager>
<Manager Name="Robin">
<Employee ID="130" Department="d11"/>
<Employee ID="107" Department="d11"/>
<Employee ID="133" Department="d41"/>
<Employee ID="118" Department="d11"/>
<Employee ID="144" Department="d41"/>
<Employee ID="118" Department="D7"/>
<Employee ID="144" Department="D7"/>
</Manager>
<Organisation Dept="d1"/>
<Organisation Dept="d2"/>
<Organisation Dept="d4"/>
<Organisation Dept="d7"/>
<Organisation Dept="d11"/>
<Organisation Dept="D41"/>
</Topology>
and here's a simplified
version of my stylesheet:
<?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" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<xsl:apply-templates select="Topology/Manager"/>
</xsl:template>
<xsl:template match="Topology/Manager">
<xsl:value-of select="count(//Topology/[EMAIL PROTECTED]()/Employee/@Department])"/>
</xsl:template>
</xsl:stylesheet>
It counts the number of
different Departments underneath each Manager element. For example "John" has
"d2", "d1", and "d4", therefore count returns 3. For "Robin" it should
return 3 but only returns 1.
The problem is that the
value of attribute Department or Dept could be uppercase or lowercase but I
would like to treat "D41" and "d41" as the same value.
Does anyone know how I can
do this, or can you think of another way of counting? Is there a unique function
or anything like that?
Any help
appreciated,
Dan
