I have a hard time to get the XMLXQueryExtractor to do what I need. I wish it was more simple like JSON :-)
I want to extract the value 2.2 from this sample:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Leveringsinformatie xmlns="http://www.kadaster.nl/schemas/klic/leveringsinformatie/v20180418" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml/3.2">
<version>2.2</version>
</Leveringsinformatie>
The documentation states I need to declare the namespace because the XML has a namespace. So I tried:
declare namespace x='http://www.kadaster.nl/schemas/klic/leveringsinformatie/v20180418';
string(//x:Leveringsinformatie/@version)
But no luck. I tried all kind of stuff but the only thing that comes close is:
declare namespace x='http://www.kadaster.nl/schemas/klic/leveringsinformatie/v20180418';
//x:version
But this returns the entire node, I can't get the value.
The easy way is to use the XMLFragmenter with the path
Leveringsinformatie/version
but it does not feel correct. I think the XMLXQueryExtractor is the JSONExtractor equivalent, but maybe I'm wrong. Can anybody help me with this?