schokoschnute
07-03-2008, 09:24 AM
Hello :)
this is my xml-structure:
<AAA>
<BBB>
<CCC id="h" />
<CCC id="f" />
</BBB>
<BBB>
<CCC id="o" />
<CCC id="i" />
<CCC id="x" />
</BBB>
<BBB>
<CCC id="a" />
</BBB>
</AAA>
for a CCC-Element i want to know the position of the depending BBB node
ex.: the pos for CCC id="o" is 1 (equals to id="i" and id="x"), for id="a" it's 2
why gives me this code an empty result-set?
$xpath = '//CCC[@id="o"]/preceding-sibling::*';
thanks :)
Gruß
Lena
this is my xml-structure:
<AAA>
<BBB>
<CCC id="h" />
<CCC id="f" />
</BBB>
<BBB>
<CCC id="o" />
<CCC id="i" />
<CCC id="x" />
</BBB>
<BBB>
<CCC id="a" />
</BBB>
</AAA>
for a CCC-Element i want to know the position of the depending BBB node
ex.: the pos for CCC id="o" is 1 (equals to id="i" and id="x"), for id="a" it's 2
why gives me this code an empty result-set?
$xpath = '//CCC[@id="o"]/preceding-sibling::*';
thanks :)
Gruß
Lena