[XSL-LIST Mailing List Archive Home]
RE: [xsl] Help culling out duplicates with preceding::
Subject: RE: [xsl] Help culling out duplicates with preceding::|
Date: Wed, 06 Oct 2004 09:32:00 -0400
If you want to constrain the XPath expression's application to the preceding siblings of "member", then use the preceeding-sibling axis.
cknell@xxxxxxxxxx - email
From: Charlie Consumer <faceless1976@xxxxxxxxx>
Sent: Tue, 5 Oct 2004 07:27:34 -0700 (PDT)
Subject: [xsl] Help culling out duplicates with preceding::
I'm trying to cull out duplicate XML by using
preceding:: axes as discussed in the FAQ. I'm having
trouble doing so. My XSL takes in an ID as a
parameter. Then it selects out all the sibiling nodes
that the ID is in. For example:
My XPATH query is something like the following:
mesh/member[not(@id=$thisId) and not(@removed) and
not( @id = preceding::member[not(@removed)]/@id )]
In the case where thisId='1' it would select the
following: from mesh A members with 2 and 3 and from
mesh B 4, 5, and 6 which is what I expect.
But in the case where thisId='4' it would select only
4, 5, and 6. I was expecting it would select from
mesh B 1 and 2, but the preceding:: axes culled it
out. I understand why it did because the preceding::
axes isn't constrained to just the nodes that are 4's
siblings. But, I'm not sure how to make it contrained
to 4's siblings. Can someone help me with what I'm
What the query is trying to accomplish is where ever
thisId is a member of a mesh. I want to select out
all the siblings of that mesh. If he belongs to more
than one mesh any duplicates between the meshes (i.e.
when thisId='1' 2 is a dup). Only give me the first
occurence of that dup.
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!