Solved

XMLTemplater with subtemplate not retaining nesting correctly

  • 9 November 2017
  • 4 replies
  • 5 views

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

icon

Best answer by takashi 9 November 2017, 23:57

View original

4 replies

Userlevel 2
Badge +17

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

Badge +11

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?

 

Userlevel 2
Badge +17

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.

 

 

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

 

 

Reply