Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
iw_iterate only first element
sara
I have a problem to iterate the replicants within an item. Only the first element is processed.
a snippet of my dcr:
<item name="menu">
<value>
<item name="title">
<value>Life and Health ok</value>
</item>
<item name="choice">
<value>
<item name="leaf">
<value>
<item name="title">
<value>In een notendop</value>
</item>
<item name="summary">
<value>nix</value>
</item>
<item name="link">
<value></value>
</item>
</value>
</item>
</value>
<value>
<item name="node">
<value>
<item name="title">
<value>Structuur & organisatie</value>
</item>
<item name="summary">
<value>inclusief Archief "Newsletter" </value>
</item>
<item name="choice">
<value>
<item name="leaf">
<value>
<item name="title">
<value>organogram</value>
</item>
<item name="summary">
<value>nix</value>
</item>
<item name="link">
<value></value>
</item>
</value>
</item>
</value>
<value>
<item name="leaf">
<value>
<item name="title">
<value>VRU Helpdesk Commercieel</value>
</item>
<item name="summary">
<value>via 02 228 09 10 [memokaart] </value>
</item>
<item name="link">
<value></value>
</item>
</value>
</item>
</value>
</item>
</value>
</item>
</value>
<value>
<item name="leaf">
<value>
<item name="title">
<value>productinfo</value>
</item>
<item name="summary">
<value>Eureka-nota's (product & process kantoor)</value>
</item>
<item name="link">
<value></value>
</item>
</value>
</item>
</value>
<value>
<item name="node">
<value>
<item name="title">
<value>Overzicht documenten</value>
.....
my iterate tag should process all children of the choice tag, but leafs and nodes should be processed differently, therefore the ifcase tag.
<iw_iterate var="n" list="dcr.menu.choice.*" label="loop">
<iw_ifcase name="n">
<iw_case type='leaf'>
<tr>
<td CLASS="hook">
<font size="1">incase</font>
</td>
<td colspan="3" width="100%">
<a href="N_lh_mission_stat.htm" target="rbotom"><iw_value name="n.title"/></a>
</td>
</tr>
<iw_next label="loop"/>
</iw_case>
<iw_case>
<iw_next label="loop"/>
</iw_case>
</iw_ifcase>
</iw_iterate>
only the first child of the choice is processed.
Could anyone give a hint?
thanks
Sara
Find more posts tagged with
Comments
mogoo
I suspect it's in the way that you're calling the fields, but I really can't tell from your DCR. Attatching your DCT would be helpful.
maureen
MattP
Posting the DCT and TPL would be helpful.
Take a look at
http://<i>your
IW server </i>/iw/help/tst/pt/
the correct iteration code would look something like...
<iw_iterate var ='an_xml_node_within_y' list='dcr.x.y.*'>
<iw_ifcase name='an_xml_node_within_y'>
<iw_case type='customer'>
This is an XML element of type "customer"
See for yourself: <iw_value name='$iw_ifcase_type'/>
</iw_case>
<iw_case op='=~' type='^zzz_'>
The type of this XML element starts with "zzz_"
</iw_case>
<iw_case value='zebra'>
Any XML node type who's value is equal to "zebra"
</iw_case>
<iw_case type='animal'>
The type of this XML node is "animal"
non-zebra animal: <iw_value name='an_xml_node_within_y'/>
</iw_case>
<iw_case>
The default case
</iw_case>
</iw_ifcase>
</iw_iterate>
Matt
Matthew Petitjean
BOC Group
Murray Hill, NJ 07974 USA
sara
my DCT and my TPL attached
sara
my TPL