Hi,
Tempore 17:37:44, die Thursday 22 September 2005 AD, hinc in foro {comp.text.xml} scripsit bouton <k.a.bouton@reading.ac.uk>:
[color=blue]
> Is there anyway, if there are nodes which are repeated to indicate it?
> eg
> if if node names has multiple name under it
> <magazines>
> <magazine>some mag</magazine>
> <magazine>another mag</magazine>
> </magazines>[/color]
Try adding:
<xsl:if test="count(../*[name()=name(current())]) > 1">+</xsl:if>
like in this stylesheet:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:key name="element" match="*" use="name()"/>
<xsl:template match="*">
<xsl:if test="generate-id()=generate-id(key('element',name())[1])">
<xsl:variable name="indent">
<xsl:for-each select="ancestor::*">
<xsl:text> </xsl:text>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="$indent"/>
<xsl:if test="count(../*[name()=name(current())]) > 1">+</xsl:if>
<xsl:if test="not(*)">
<xsl:value-of select="name()"/>
<xsl:text>
</xsl:text>
</xsl:if>
<xsl:if test="*">
<xsl:text/>Group: <xsl:value-of select="name()"/>
<xsl:text>
</xsl:text>
<xsl:apply-templates select="*"/>
<xsl:value-of select="$indent"/>
<xsl:text/>End_Group: <xsl:value-of select="name()"/>
<xsl:text>
</xsl:text>
</xsl:if>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
regards,
--
Joris Gillis (
http://users.telenet.be/root-jg/me.html)
«Error, keyboard not found— press F1 to continue» , BIOS