Skip to main content

Hello everyone,

I try to export some XML data package via XML Templater. I have many conditions in tag filling and in cases, when tag is not filled, FME left there many whitespace, even if I use XML Formatter. You can check my syntax below:

The result is below of template is below:

Does anybody know, how to remove empty space and put object tag to the right level please?

Thank You so much!

Lubo

How have you set the "Whitespace Handling" parameter in the XMLFormatter?


The XMLFormatter has a setting called "Whitespace handling". Have you tried setting it to "Remove excess whitespace"?


Thank You so much, my mistake 😞 I missed this option and just reflected "Remove empty elements" and "Collapse empty elements"...


Thank You so much, my mistake :-( I missed this option and just reflected "Remove empty elements" and "Collapse empty elements"...

Good to hear you found those options :-)

 

For what it's worth, this template expression

 

<objects>
  <object>
  {
  fme:get-attribute("value1")
  }
  </object>
  <object>{
  fme:get-attribute("value2")  
  }</object>
</objects>
generates this XML document.

 

<objects>
  <object>
  1
  </object>
  <object>2</object>
</objects>

Good to hear you found those options :-)

 

For what it's worth, this template expression

 

<objects>
  <object>
  {
  fme:get-attribute("value1")
  }
  </object>
  <object>{
  fme:get-attribute("value2")  
  }</object>
</objects>
generates this XML document.

 

<objects>
  <object>
  1
  </object>
  <object>2</object>
</objects>
You can cast the long value to a string value with this syntax.

 

xs:string(<the long value>)

 


Reply