Hi All,
I'm trying to do the following with Delivery Server Dynaments:
- Retrieve data from SQL Server [done]
- Loop through the resulting nodes [at-my-wit's-end]
How do you loop through the nodes with the for-each dynament? Here is what I have so far:
- <rde-dm:rdb mode='statement' alias='externalDB' operation='getAttributeValues' rde-id='10' row="item" tag="attributeValues" cachingtime="60">
- <rde-rd:param type="string">EN</rde-rd:param>
- <rde-rd:param type="string">cb_friction</rde-rd:param>
- </rde-dm:rdb>
-
- <rde-dm:attribute mode="for-each" source="rde-id" attribute="attributeValues.item" type="node">
- <p>Test</p>
- </rde-dm:attribute>
I would expect "Test" to be outputted for as many "item" nodes in the result... But I must not be accessing it correctly.
Below is the result of the prepared statement when I test it in Delivery Server:
- <debug xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:rdf="http://www.w3.org/TR/REC-rdf-syntax/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-
- <attributeValues chunk="1" chunksize="1000" description="Connector for externalDB" hits="99" lastchunk="1" maxchunk-ca="1" maxhits="0">
- <item>
- <Key>bore</Key>
- <Value>0.125 in</Value>
- </item>
- <item>
- <Key>bore</Key>
- <Value>0.187 in</Value>
- </item>
- <item>
- <Key>bore</Key>
- <Value>0.25 in</Value>
- </item>
- <item>
- <Key>bore</Key>
- <Value>0.3125 in</Value>
- </item>
- <item>
- <Key>bore</Key>
- <Value>0.375 in</Value>
- </item>
- </attributeValues>
- </debug>
I would be grateful for any help. Thanks!
Walter