Skip to main content
Question

How to build a XQuery for extracting values from XML

  • May 23, 2023
  • 1 reply
  • 136 views

juanmahere
Supporter
Forum|alt.badge.img+11

Hi,

I think the best FME Transfomer for such type of extractions is the "XMLXQueryExtractor", but I do not know how to build the query.

The XML is contained within an attribute and could be something like this:

 

"<?xml version="1.0" encoding="UTF-16"?><value xmlns="http://spec.tn-its.eu/schemas/"> <gml:measure uom="kph" xmlns:gml="http://www.opengis.net/gml/3.2">50</gml:measure> </value>"

 

For that particular case, I wanted to extract that "50" value from that XML.

Thanks!

 

 

 

1 reply

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • May 23, 2023

So something like this should work, where XML Input is Attribute specifying XML

declare namespace gml='http://www.opengis.net/gml/3.2';
//gml:measure/text()

Unfortunately, my knowledge of xml and xquery is fairly limited so I can't really explain how or why you'd arrive at this answer!


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