I'm trying to exclude some elements from an XML input using XPath. In the following sample, I need to exclude all "X" elements.
I thought I just have to use a XPath query like //*[not(self::X)] but this seems to not be working on all platforms.
I tried in those 2 websites:
For the 1st one, the xml output would be as expected (X elements are not highlighted in the output) but for the 2nd one, the output is strictly the same as the input. Unfortunately, the software that will use this XPath has the same behaviour as the 2nd website...
Other strange thing: when I try //*[self::X], I get all X elements on both sites.
Can you help me for this simple request? I may be missing something evident, but I'm quite new on XPath queries! Thanks.
Sample:
<ROOTNODE>
<ITEM>12345</ITEM>
<LEVELS COUNT="1">
<LEVEL>
<OFFICES COUNT="3">
<OFFICE>
<CODEOFF>21</CODEOFF>
<LIB>GALLEY AVANT</LIB>
<NIV>1</NIV>
<X>6</X>
<Y>78</Y>
<L>127</L>
<H>196</H>
<OBJECTS COUNT="7">
<OBJECT>
<CODEOBJ>G1C</CODEOBJ>
<LIB>GALLEY 1C</LIB>
<NIV>1</NIV>
<X>12</X>
<Y>143</Y>
<L>32</L>
<H>49</H>
</OBJECT>
<OBJECT>
<CODEOBJ>G1L</CODEOBJ>
<LIB>GALLEY 1L</LIB>
<NIV>1</NIV>
<X>32</X>
<Y>205</Y>
<L>34</L>
<H>29</H>
</OBJECT>
</OBJECTS>
</OFFICE>
</OFFICES>
</LEVEL>
</LEVELS>
</ROOTNODE>