XPath positions

  • Thread starter online.identity.9
  • Start date
O

online.identity.9

I'm trying to define an xpath expression for conditional formatting of
text boxes. What I'd like to do is compare the value of the node to
the value of another node and highlight the box if the values are
different. Simple right? Here's the problem.
I've got a schema like this
<blah>
<values>
<value></value>
<value></value>
<value></value>
</values>
<previous>
<values>
<value></value>
<value></value>
<value></value>
</values>
</previous>
</blah>

The number of value tags is dynamic, what I'd like to do is compare "/
blah/values/value[x]" to /blah/previous/values/value[x]". Initially,
i tried something like ". != /blah/previous/values/value[position() =
count(preceding-sibling::*) + 1] , but of course that didn't work.

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top