When I use your code, I see that the order appears correctly.
I suspect the issue that you are experiencing is related to your XML, as you are using unsupported HTML elements:
Content
fig
graphic
caption
*caption is a supported HTML element, but only in tables and must be inserted immediately after the <table>
tag.
Also their respective attributes such as orientation
and position
are unknown to the User Agent and is causing unexpected results when you display them.
I would recommend:
- Removing the unsupported
orientation
andposition
attributes - Change
content
,fig
andcaption
* to a supported element, likediv
- Change
graphic
toimg
*caption is a supported HTML element, but only in tables and must be inserted immediately after the <table>
tag.
You may also want to consider writing an XSL template to transform the XML to supported HTML and use this in conjunction with the AMPscript TransformXML function.