PhixFlow Help

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Function: xmlToItems()

Extracts nodes from a chunk of XML (a string) and creates a list of items - which can be processed just as any list of values in PhixFlow.

Returns null when the extract fails.

Syntax

xmlToItems(XML, XPath)

Argument Type Description
XML String The full XML data, stored in a string variable.
XPath String XPath expression to extract data from the XML.
Note : XPath is a w3 standard language for addressing parts of an XML document. For more details see href="http://www.w3.org/TR/xpath/">http://www.w3.org/TR/xpath/

Examples

Where $xml is :

&lt?xml version="1.0" encoding="ISO-8859-1"?&gt &ltstore&gt &ltthing category="X1"&gt &ltname&gtItem1&lt/name&gt &ltprice&gt15.00&lt/price&gt &lt/thing&gt &ltthing category="X2"&gt &ltname&gtItem2&lt/name&gt &ltprice&gt17.99&lt/price&gt &lt/thing&gt &lt/store&gt

xmlToItems($xml, "/store/thing/price")

Returns the values :

15.00

17.99

See Also

  • No labels