Hi,
I have achieved the below XML using the following xquery in an XMLUpdater:
XML:
<base>
<level id="Level-1"/>
<group id="A" category="line">
<section id="A1">
<definition>
<edges>
<edge id="110992"/>
</edges>
</definition>
</section>
<section id="A2"/>
<section id="A3"/>
<section id="A4"/>
</group>
</base>
<base>
<level id="Level-1"/>
<group id="B" category="line">
<section id="B1">
<definition>
<edges>
<edge id="128677"/>
</edges>
</definition>
</section>
<section id="B2"/>
<section id="B3"/>
<section id="B4"/>
<section id="B5"/>
</group>
</base>
XMLUpdater
Update Type: Replace Contents
XML Path: /base/group/section<@id=fme:get-attribute("CODE")]
Value:
<definition>
<edges>{
for $edge_id at $i in fme:get-list-attribute("_list2{}.EDGE_ID")
return
<edge id="{$edge)_id $i]}" />
}</edges>
</definition>
However as you can see in the XML output, only the first 'edge id' attributes in each group have been updated. I don't understand why the list of EDGE_ID values which I passed through the for loop in the XMLUpdater didn't work. _list2 was created by using a ListBuilder on the CODE attribute.
Any ideas?? I am very new to XQuery..
Thankyou