Loads XML data into a rowset. This function is helpful if you have XML data that you want to programmatically insert into your content. This function is executed at send time for outgoing messages and at load time for CloudPages.

The BuildRowSetFromXml() function has three parameters:

  • xmlData (string): Required. The XML data that you want to parse.
  • xpathExpression (string): Required. The XPath expression that parses the source data.
  • boolReturnEmptyOnError (boolean): Required. If false, the function returns an empty rowset when there’s a syntax error in the function or the XPath expression. If true, the function returns an exception when an error occurs.

The following nodes in the XML source data don’t return a value:

  • Comment
  • Document
  • Document Fragments
  • DocumentType
  • Entities
  • Entity References
  • Notation
  • ProcessingInformation
  • Whitespace
  • XmlDeclaration

The rowset also provides a column for each attribute found in any of the nodes. If a node is missing a value for that attribute, the rowset includes an empty value.

The system returns this rowset: