Comments and answers for "XmlTemplater using Sub Templates with Expressions ?" https://knowledge.safe.com/questions/40330/xmltemplater-using-sub-templates-with-expressions.html 最新的评论和回答问题”XmlTemplater using Sub Templates with Expressions ?" Comment by jdh on jdh's comment https://knowledge.safe.com/comments/40415/view.html I went through that aggravation back in 2012. Once I figured out what did and did not need commas, it was fairly straightforward. I don't even really notice it these days.

Wed, 22 Feb 2017 17:33:42 GMT jdh
Comment by lifalin2016 on lifalin2016's answer https://knowledge.safe.com/comments/40367/view.html Hi jdh,

You're correct, although it makes no sense to me to add commas. Yesterday I tried to add commas out of sheer desparation, and much to my surprise, it worked.

I would have assumed, that an XML "expression" would be some valid XML snippet (with embedded commands). Commas between tags are not valid XML, so it baffles me why it's implemented as such.

Thanks again.

Cheers
Wed, 22 Feb 2017 08:15:40 GMT lifalin2016
Comment by lifalin2016 on lifalin2016's answer https://knowledge.safe.com/comments/40366/view.html Hi Takashi,

I did read that, but it unfortunately doesn't address my problem.

Cheers
Wed, 22 Feb 2017 08:11:55 GMT lifalin2016
Answer by takashi https://knowledge.safe.com/answers/40361/view.html

I think this article in Knowledge Base would be a good starting point.

XML Writing with XMLTemplater, esp. Exercise 1.b Basic XML Writing - multi-record

Wed, 22 Feb 2017 03:26:56 GMT takashi
Answer by patrick_koning https://knowledge.safe.com/answers/40342/view.html

test.fmw

Hi @lifalin2016,

I included a very small working sample.

I hope this wil help.

Created with FME 2016.1

Tue, 21 Feb 2017 17:30:54 GMT patrick_koning
Answer by david_r https://knowledge.safe.com/answers/40340/view.html

I seem to remember that the XMLTemplater didn't like XML-style comments, so you might want to try without them to see if that helps.

Tue, 21 Feb 2017 16:46:37 GMT david_r
Answer by jdh https://knowledge.safe.com/answers/40336/view.html

If you have two unrelated xml fragments you need to separate them with a comma.

For example a subtemplate of
<a>

<b></b>

<b></b>
</a>

will have no issue, but
<a></a>
<b></b>
will fail.

it needs to be
<a></a>,
<b></b>

Tue, 21 Feb 2017 16:34:26 GMT jdh