Helma logo
helma.org » Home > Stories > XML.getFromString()

XML.getFromString()

Parses the string argument as XML and transforms it into a HopObject.

Syntax
Xml.getFromString(xmlString)
Xml.getFromString(xmlString, filenameString)

The optional argument filenameString refers to a file containing a set of transformation rules how the XML data should be turned into a HopObject. Please take a look at the RFC for details.

Example
var obj = Xml.getFromString("<a>hello <b>world</b></a>");
for (var i in obj)
  res.writeln(i + ": " + obj[i]);

b: HopObject b
text: hello


There's also a more detailed example available in the script library.



Page last modified on 2003-05-21 13:07 by hns