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

XML.get()

Retrieves an XML document from a given URL and transforms it into a HopObject.

Syntax
Xml.get(urlString)
Xml.get(urlString, 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.get("http://localhost:8080/antville/rss10");
for (var i in obj)
  res.writeln(i + ": " + obj[i]);

xmlns_sy: http://purl.org/rss/1.0/modules/syndication/
xmlns_dc: http://purl.org/dc/elements/1.1/
item: HopObject item
channel: HopObject channel
xmlns: http://purl.org/rss/1.0/
xmlns_rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#


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



Page last modified on 2002-07-12 15:10 by tobi