I have the following XML:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfAgence xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.artos.co.il/">
<Agence>
<CodeAval>20008</CodeAval>
<CodeSource>ArtPO</CodeSource>
<LogicielSource>NTLIS</LogicielSource>
</Agence>
</ArrayOfAgence>
I want to get the CodeAval value, so I tried:
ArrayOfAgence/Agence/CodeAval
It obviously didn’t work since this XML has a namespace, so, how do I need to approach this?
Thanks,
You mentioned in a comment that you use this XPath in XSLT. In that case you need to add a namespace definition with a prefix for the input documents default namespace
http://www.artos.co.il/and then use this prefix in your XPath expression.Example of namespace definition (it doesn’t need to be in the
stylesheetelement)Example of the prefix usage in the XPath expression
Note the added prefix in front of every element name.