For example if there are nested entities in an XML string I would need to loop over the parent entities and the child entities (like a repeater within a repeater in ASP.NET). If you would like an example of such XML I can paste it here.
As requested, an example snippet of what I am trying to achieve:
%%[ Var @xml, @names, @talents, @talent, @rows
Set @xml = '
<root>
<parent-object>
<name>Dan</name>
<surname>Surname</surname>
<talents>//child object to obtain which would be acquired through nested for loop
<talent-name>fast worker</talent-name>
<experience>2 years</experience>
<talent-name>typing</talent-name>
<experience>3 years</experience>
</talents>
</parent-object>
<parent-object>
<name>John</name>
<surname>Surname</surname>
<talents> //child object to obtain which would be acquired through nested for loop
<talent-name>runqning</talent-name>
<experience>2 years</experience>
<talent-name>walking</talent-name>
<experience>3 years</experience>
</talents>
</parent-object>
</root>'
Set @names = BuildRowsetFromXML(@xml,"//root/parent-object/name",1)
Set @talents = BuildRowsetFromXML(@xml,"//root/parent-object/talents/talent-name",1)
SET @rows = RowCount(@names)
for @cnt = 1 to @rows do //start loop
Set @name = Field(Row(@names,@cnt), "Value")
Set @talent = Field(Row(@talents,@cnt), "Value")
]%%
<div>
- %%=v(@name)=%% <br>
Talents: %%=v(@talent)=%% <!-- //displays single talent. Here is where i would require an inner for loop to iterate over talents. I would like to do this without separating the xml -->
</div>
%%[next @cnt]%%
talents
node, you can always build another rowset inside yourfor
loop.