1
%%[ Var @xml, @objects, @object, @rows

Set @xml = '<root>
<object>
<headline>
headline
</headline>
</object>
<object>
<headline>
headline
</headline>
</object>
</root>'

Set @objects = BuildRowsetFromXML(@xml,"//root/object/headline",1)

SET @rows = RowCount(@objects)
for @cnt = 1 to @rows do 
Set @object = Field(Row(@objects,@cnt), "Value")

]%%
%%=v(@object)=%%

%%[next @cnt]%%

No errors display and nothing else displays

1 Answer 1

0

Appears to be working as-is.

I added a couple of things for verification:

%%[

Var @xml, @objects, @object, @rows

Set @xml = '<root>
<object>
<headline>
headline
</headline>
</object>
<object>
<headline>
headline
</headline>
</object>
</root>'

Set @objects = BuildRowsetFromXML(@xml,"//root/object/headline",1)

SET @rows = RowCount(@objects)
outputline(concat("<br>rows: ",@rows))
for @cnt = 1 to @rows do
  Set @object = Field(Row(@objects,@cnt), "Value")
  outputline(concat("<br>",@cnt, ": object: ",@object))
next @cnt

]%%

Output

rows: 2 
1: object: headline 
2: object: headline 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .