Skip to main content
Solved

XMLTemplater with subtemplate not retaining nesting correctly


chriswilson
Supporter
Forum|alt.badge.img+11

I have the following root template in an XMLTemplater:

Where {fme:process-features("FEATURE_CLASSES") occurs I want to insert the following subtemplate within the sequence elements, grouped by an attribute so that it repeats according to how many feature classes I have:

The result, however, loses the nesting and leaves elements retreating to the root element level - the subtemplates start inserting at row 6 with the first element showing in the correct position:

What can I do to avoid this, or is it just a case of using a separate templater for the subtypes and then appending them into the root in an XMLAppender?

Best answer by takashi

Hi @chrisw84, if you need to adjust indentations, consider using the XMLFormatter in the subsequent workflow.

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

4 replies

takashi
Evangelist
  • Best Answer
  • November 9, 2017

Hi @chrisw84, if you need to adjust indentations, consider using the XMLFormatter in the subsequent workflow.


chriswilson
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • November 9, 2017
takashi wrote:

Hi @chrisw84, if you need to adjust indentations, consider using the XMLFormatter in the subsequent workflow.

Hi @takashi, the problem is that the indentations are not being preserved in the first place - adjustment should not be required?

 


takashi
Evangelist
  • November 9, 2017
takashi wrote:

Hi @chrisw84, if you need to adjust indentations, consider using the XMLFormatter in the subsequent workflow.

Indentations in XML documents are only for human convenience. Machine ignores excess whitespaces (space, tab, newline, etc) within XML documents.

 

 


chriswilson
Supporter
Forum|alt.badge.img+11
  • Author
  • Supporter
  • November 9, 2017
takashi wrote:
Indentations in XML documents are only for human convenience. Machine ignores excess whitespaces (space, tab, newline, etc) within XML documents.

 

 

Good, point, however it would be useful if the visual indentations were preserved for readability. I'll take a look at the XMLFormatter, thanks.

 

 


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