Skip to main content
Question

XMLXQueryExtractor is putting up a fight

  • September 19, 2019
  • 1 reply
  • 19 views

bruceharold
Contributor
Forum|alt.badge.img+17

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

bruceharold
Contributor
Forum|alt.badge.img+17
  • Author
  • Contributor
  • September 19, 2019

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";

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings