Skip to main content
Solved

Dynamically generated xpath in XMLUpdater is not correct

  • August 19, 2018
  • 2 replies
  • 32 views

friesewoudloper
Participant
Forum|alt.badge.img+1

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

takashi
Celebrity
  • 7843 replies
  • 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
Participant
Forum|alt.badge.img+1
  • Author
  • Participant
  • 50 replies
  • August 19, 2018

Thank you again @takashi!