[xsl] Help comparing an attribute to a Node-Set

Subject: [xsl] Help comparing an attribute to a Node-Set
From: Charlie Consumer <faceless1976@xxxxxxxxx>
Date: Sat, 18 Sep 2004 12:42:20 -0700 (PDT)

I have a question about comparing a single attribute
to a set of nodes.  I'm trying to remove any XML
elements where their @GUID attribute is equal to one
of the GUIDs (guid0 or guid1) in another document. 
The comparison I'm doing right now always returns true
which causes all the the nodes to be added.  I want to
only add the elements in the source XML whose GUID's
are not in the other document either guid0 or guid1. 
Without posting the entire document here is my some
excerts I'm using right now:

<xsl:template match="Rule">
  <xsl:if test="@GUID!=member/@guid0 and
  <xsl:element name="{name(.)}" >
      <xsl:copy-of select="@*"/>

The source to the XSL is:

<Rule GUID="zzzzzzzzzz" Enabled="true"
<Rule GUID="yyyyyyyyyy" Enabled="true" Action="Deny"/>
<Rule GUID="wwwwwwwwww" Enabled="true"

The other document XML is:

<member guid0="aaaaaaaaaa" guid1="yyyyyyyyyy"/>
<member guid0="zzzzzzzzzz" guid1="xxxxxxxxxx"/>
<member guid0="bbbbbbbbbb" guid1="cccccccccc"/>

The expected result would be:

<Rule GUID="wwwwwwwwww" Enabled="true"

Any ideas what I'm doing wrong?



Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard.

Current Thread