Skip to main content
Question

XMLTemplater and braces in text

  • September 14, 2021
  • 2 replies
  • 25 views

lars_de_vries
Forum|alt.badge.img+10

I have an issue where I have text that contains braces that are inputted into an XMLTemplater through a SubTemplate (and also through ROOT). Since I don't want the XMLTemplater to parse the text, it is referenced as @Value(text) and not {fme:get-attribute("text")}. Still I get an issue as if FME expects a function. The log tells me: 

"context item": undeclared variable

For this issue I prefer not to escape the braces in my text, which of course would be a workaround. 

2 replies

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • 1637 replies
  • September 15, 2021

Hi @Lars de Vries​,

To insert an attribute value without parsing, please try using the get-xml-attribute function in the XMLTemplater.


lars_de_vries
Forum|alt.badge.img+10
  • Author
  • 388 replies
  • October 13, 2021

@daveatsafe​ Thanks for your response. Your solution kind of helped, but this raises a new issue. The XML-fragments contain namespaces which are declared at the root level of the XML, but not in the SubTemplater. What happens is that the SubTemplater doesn't accept the fragments (even though Validation is turned off), because of the namespace in the fragment.