Re: [xsl] xpath query question

Subject: Re: [xsl] xpath query question
From: "andrew welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 11 Aug 2006 11:07:53 +0100
On 8/11/06, Andrei Matei <AndreiMatei@xxxxxxxx> wrote:
Hello all,

I want to ask you if I can do something with xpath. I have an xml that
looks like this:

<a>
  <b>
   content 1
  </b>
  <b>
   content 2
  </b
  ..
</a>

I want an xpath expression that would tell me if all the contents of the b
nodes are the same. For the example above this wouldn't happen, because
"content 1" != "content 2". It doesn't matter what the expression would
output (the first b would be great). Is this possible with xpath?

If your content is exactly like that then you can just do:


<xsl:if test="b[1] = b[2]"> the contents match</xsl:if>

cheers
andrew

Current Thread