Handlebars buildRowSetFromXml
Handlebars buildRowSetFromXml: builds a rowset from the XML nodes an XPath expression selects; each row carries the node value, its XML, and its attributes.
Next
Runtime verified
Test scripts included
Builds a rowset from the XML nodes an XPath expression selects; each row carries the node value, its XML, and its attributes.
Syntax
{{buildRowSetFromXml xml xpath ...options}}
Returns array.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
xml |
string | Yes | The XML to read. |
xpath |
string | Yes | XPath expression picking the nodes. |
options |
any | Yes, repeatable | Required named argument returnEmptyOnError: true yields an empty rowset when parsing or the XPath fails, false raises an error. |
Example
Tested in a Marketing Cloud Next email on 2026-11-22:
{{length (buildRowSetFromXml "<r><i>1</i><i>2</i></r>" "/r/i" returnEmptyOnError=true)}}renders2, as documented.{{length (buildRowSetFromXml "not xml" "/r" returnEmptyOnError=true)}}renders0, as documented.
Show Next test script
Marketing Cloud Next
Works as documented
Every tested call rendered the documented result. Tested 2026-11-22 by rendering in a Marketing Cloud Next email.
See also
- AMPscript
BuildRowSetFromXML— does a similar job in AMPscript, with a different call shape - Official reference