xsl-list
[Top] [All Lists]

RE: using boolean to compare id numbers

2005-01-20 09:42:09

<xsl:template match="user">
 <xsl:if test="preceding-sibling::user/@uid=(_at_)uid">
  <xsl:message>oops</xsl:message>
 </xsl:if>

If the XML is large you could use a key:

<xsl:key name="uids" match="user" use="@uid"/>

And then count how many <user>s have the current <user>'s @uid:

<xsl:template match="user">
  <xsl:if test="count(key('uids', @uid) > 1))">
        <xsl:message>oops<xsl:message>


cheers
andrew

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--