Solved

Dynamically generated xpath in XMLUpdater is not correct

  • 19 August 2018
  • 2 replies
  • 6 views

Badge

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

icon

Best answer by takashi 19 August 2018, 14:44

View original

2 replies

Userlevel 2
Badge +17

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.

Badge

Thank you again @takashi!

Reply