Skip to main content
Question

XML Templater: how to put list values into one attribute

  • November 10, 2017
  • 2 replies
  • 25 views

lazarlubomir
Contributor
Forum|alt.badge.img+7

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

2 replies

takashi
Influencer
  • 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+7
  • Author
  • Contributor
  • November 10, 2017
takashi wrote:

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!

 

 


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