Question

XMLTemplater and braces in text

  • 14 September 2021
  • 2 replies
  • 3 views

Badge +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

Userlevel 2
Badge +17

Hi @Lars de Vries​,

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

Badge +10

@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.

Reply