I have a problem when I want to select an item with xpath from an xml-file when there are different schemas for one namespace.
Given is this valid xml-file:
<getDataAction xmlns="http://example.org/ns1">
<getData xmlns:f4k1="http://example.org/ns2" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<f4k1:place xmlns:f5k1="http://example.org/ns3">
<f4k1:city i:type="f5k1:Country" xmlns:f5k1="http://example.org/ns4">
<f5k1:notice>Notice</f5k1:notice>
</f4k1:city>
<f4k1:testvillage i:nil="true">
<f4k1:data xmlns:f5k1="http://example.org/ns5">
<f5k1:address xmlns:d7k1="http://example.org/ns6">
<f5k1:important>no</f5k1:important>
</f5k1:address>
</f4k1:data>
</f4k1:testvillage>
</f4k1:place>
</getData>
</getDataAction>
I want to select
<f5k1:notice>Notice</f5k1:notice>
So I use this xpath-query //f5k1:notice
, but it does not work. If I would change the ns5 namespace (line 8) to ns4 (as in line 4) it will work.
Can you tell me why this does work and what I have to do to get it working without changing the XML?