K
Kasp
Hi,
I have an XSL here...and though I understand XML, I am having a hard time
understanding what this XSL does?
Any help will be appreciated.
TIA
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslutput indent="yes"/>
<xsl:key name="pageKey" match="//HierarchyMember" use="@PageKey"/>
<xsl:template match="/">
<Root>
<xsl:apply-templates select="//HierarchyMember"/>
</Root>
</xsl:template>
<xsl:template match="HierarchyMember">
<xsl:if test="count(key('pageKey', @PageKey)) > 1">
<xsl:copy>
<xsl:attribute
name="PageKey"><xsl:value-of-select="@PageKey"/></xsl:attribute>
<xsl:attribute name="Count"><xsl:value-of
select="count(key('pageKey',@PageKey))"/></xsl:attribute>
</xsl:copy>
</xsl:if>
<xsl:apply-templates select="HierarchyMember"/>
</xsl:template>
</xsl:stylesheet>
I have an XSL here...and though I understand XML, I am having a hard time
understanding what this XSL does?
Any help will be appreciated.
TIA
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xslutput indent="yes"/>
<xsl:key name="pageKey" match="//HierarchyMember" use="@PageKey"/>
<xsl:template match="/">
<Root>
<xsl:apply-templates select="//HierarchyMember"/>
</Root>
</xsl:template>
<xsl:template match="HierarchyMember">
<xsl:if test="count(key('pageKey', @PageKey)) > 1">
<xsl:copy>
<xsl:attribute
name="PageKey"><xsl:value-of-select="@PageKey"/></xsl:attribute>
<xsl:attribute name="Count"><xsl:value-of
select="count(key('pageKey',@PageKey))"/></xsl:attribute>
</xsl:copy>
</xsl:if>
<xsl:apply-templates select="HierarchyMember"/>
</xsl:template>
</xsl:stylesheet>