Skip to main content
Solved

Dynamically generated xpath in XMLUpdater is not correct


friesewoudloper
Forum|alt.badge.img

With XMLUpdater I am changing values in an XML-file. I'd like to generate the xpath dynamically based upon a column ('Attribuut') in an Excel file. However, when I select this attribute in the text editor for the XML Path, the generated code is wrong. It is:

//*:featureAttribute[*:name/text() = 'fme:get-attribute("Attribuut")']/*:definition

where it should be:

//*:featureAttribute[*:name/text() = '@Value(Attribuut)']/*:definition

I can change this myself and everything works fine, but I'm just curious: Is this a bug, or does FME generate the xpath as one might expect? Is it something I do wrong?

0684Q00000ArBCkQAN.png

Best answer by takashi

In XQuery expressions, you should not quote an XQuery function call. Try this one.

//*:featureAttribute[*:name/text() = fme:get-attribute("Attribuut")]/*:definition

The "@Value" is an FME function, which will be replaced with specified attribute value before the XQuery expression is evaluated.

View original
Did this help you find an answer to your question?

2 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • August 19, 2018

In XQuery expressions, you should not quote an XQuery function call. Try this one.

//*:featureAttribute[*:name/text() = fme:get-attribute("Attribuut")]/*:definition

The "@Value" is an FME function, which will be replaced with specified attribute value before the XQuery expression is evaluated.


friesewoudloper
Forum|alt.badge.img

Thank you again @takashi!


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