Question

XMLXQueryExtractor is putting up a fight

  • 19 September 2019
  • 1 reply
  • 3 views

Badge +16

Hi

I want to extract some values from an XML attribute, example content is in the attached file.

The file doesn't display properly in my browser, download it and use an editor to inspect it.

If I use https://www.freeformatter.com/xpath-tester.html with the following queries they work:

//gmd:title/gco:CharacterString/text()

Text='Straßenbaulast'

//gmd:organisationName/gco:CharacterString/text()

Text='SAALKREIS

//gmd:CI_RoleCode/@codeListValue

Attribute='codeListValue=http://inspire.ec.europa.eu/codelist/RelatedPartyRoleValue/owner'

XMLXQueryExtractor throws errors, e.g.for the first query:

`fme_rejection_message' has value `The following error occurred near line 1, column 4 of the query: "gmd": can not expand namespace prefix to URI'

Can someone give me some tips on how to handle the namespaces. I find the help a bit short on examples and the W3C resources impervious to reason.

Thanks

 


1 reply

Badge +16

I figured it out by trial and error, added the declarations like this:

declare namespace gmd="http://www.isotc211.org/2005/gmd";

 

declare namespace gco="http://www.isotc211.org/2005/gco";

Reply