(Markus Wallner) writes:
> Hi!
>
> Can some XPath expert please answer the following question:
>
> How can I quickly check if a set of nodes do all have the same parent
> node?
>
> For example (i)
>
> <table name="X" >
> <field name="a" />
> <field name="b" />
> </table>
>
> <table name="Y" >
> <field name="c" />
> <field name="d" />
> </table>
>
> Question: Do the nodes a, b, c and d all have the same parent node?
1=count(.//field[@name='a' or @name='b' or @name='c' or @name='d']/..)
is just true if they all have the same parent.
David