xsl-list
[Top] [All Lists]

Re: Hierearchy navigation in XSL

2002-10-14 09:06:19



<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0">
<xsl:output method="text"/>
<xsl:param name="ns"/>


<xsl:template match="/masterdoc">
  <xsl:for-each
select="class[starts-with(@namespace,concat($ns,'.'))]">
<xsl:variable name="ns2"
  select="substring-after(@namespace,concat($ns,'.'))"/>
<xsl:variable name="ns3">
<xsl:choose>
<xsl:when test="contains($ns2,'.')">
 <xsl:value-of  select="substring-before($ns2,'.')"/>
</xsl:when>
<xsl:otherwise>
 <xsl:value-of  select="$ns2"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not(preceding-sibling::class[(_at_)namespace=concat($ns,'.',$ns3)
  or starts-with(@namespace,concat($ns,'.',$ns3,'.'))])">
<xsl:value-of select="$ns3"/>
<xsl:text>
</xsl:text>
</xsl:if>
  </xsl:for-each>
</xsl:template>

</xsl:stylesheet>

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>