Skip to main content
Solved

XMLTemplater with subtemplate not retaining nesting correctly

  • November 9, 2017
  • 4 replies
  • 32 views

chriswilson
Enthusiast
Forum|alt.badge.img+21

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

takashi
Celebrity
  • 7843 replies
  • Best Answer
  • November 9, 2017

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


chriswilson
Enthusiast
Forum|alt.badge.img+21
  • Author
  • Enthusiast
  • 181 replies
  • November 9, 2017

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
Celebrity
  • 7843 replies
  • November 9, 2017

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
Enthusiast
Forum|alt.badge.img+21
  • Author
  • Enthusiast
  • 181 replies
  • November 9, 2017
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.