[xquery-talk] comparing consequtive elements

Chris Ness cness at soundmotion.co.uk
Fri Jun 2 11:52:41 PDT 2006


hi all. I'm very new to this game and finding it difficult to find out 
how to do what I want to do.

I want to compare elements (well thier attributes) to look for a 
particular transition.

e.g.

<eg N="1">
    <a attribute="1"/>
    <a attribute="1"/>
    <a attribute="2"/>
    <a attribute="1"/>
    <a attribute="3"/>
    <a attribute="2"/>
    <a attribute="1"/>
    <a attribute="1"/>
</eg>

and

<eg N="2">
    <a attribute="1"/>
    <a attribute="2"/>
    <a attribute="3"/>
    <a attribute="1"/>
    <a attribute="3"/>
    <a attribute="1"/>
    <a attribute="1"/>
    <a attribute="1"/>
</eg>

now say I need to look for the transition

<a attribute="3"/>
<a attribute="2"/>

example one will produce a positive and example 2 a negative (a yes/no 
answer is sufficient at this time)

Been searching for hours! tried preceding-sibling but I don't think I 
know what I'm doing enough.

Help!

chris



More information about the talk mailing list