Skip to main content
Solved

XML tag order and whitespaces


lazarlubomir
Contributor
Forum|alt.badge.img+7

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

Best answer by david_r

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

View original
Did this help you find an answer to your question?

5 replies

takashi
Influencer
  • December 5, 2017

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


david_r
Celebrity
  • Best Answer
  • December 5, 2017

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


lazarlubomir
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • December 5, 2017

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


takashi
Influencer
  • December 5, 2017
lazarlubomir wrote:

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>

takashi
Influencer
  • December 5, 2017
takashi wrote:
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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings