Skip to main content
Question

XML Templater: how to put list values into one attribute

  • November 10, 2017
  • 2 replies
  • 33 views

lazarlubomir
Contributor
Forum|alt.badge.img+10

Hello,

is anybody here, who could help me with XML creating please?

What I have to solve: I have one feature with list of references to another features. I need to create XML record which contains all of these references and also keeps number of reference in Index. Example is below:

I know that I have to use XMLTemplater, I am able to create schema, but I cant identify, how to figure out list values behaviour and also how to insert into index parameter sequenced value from list.

Thank You so much!

Lubo

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.

2 replies

takashi
Celebrity
  • 7843 replies
  • November 10, 2017

Hi @lazarlubomir, this expression might help you.

<Attribute Name="SAF" Class="PDB">{
for $name at $i in fme:get-list-attribute("_list{}")
return <RefObject Index="{$i}" Name="{$name}" />
}</Attribute>

See here to learn more about For Clause in XQuery language: For Clause


lazarlubomir
Contributor
Forum|alt.badge.img+10
  • Author
  • Contributor
  • 165 replies
  • November 10, 2017

Hi @lazarlubomir, this expression might help you.

<Attribute Name="SAF" Class="PDB">{
for $name at $i in fme:get-list-attribute("_list{}")
return <RefObject Index="{$i}" Name="{$name}" />
}</Attribute>

See here to learn more about For Clause in XQuery language: For Clause

Briliant answer as everytime! Thank You so much!