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

XML.write()

Dumps a HopObject as XML tree to a file.

Syntax
Xml.write(HopObject, filenameString)

Example
var obj = new message();
obj.title = "The Message";
obj.text = "Don't push me 'cause I'm close to the edge.";
root.add(obj);
Xml.write(obj, "/tmp/dump.xml");


File /tmp/dump.xml:

<?xml version="1.0"?>
<!-- printed by helma object publisher     -->
<!-- created Fri Jul 12 17:25:24 CEST 2002 -->
<xmlroot xmlns:hop="http://www.helma.org/docs/
guide/features/database">
  <hopobject id="8" name="message" prototype="message" 
created="1026487524440" lastModified="1026487524440">
  <hop:parent idref="0" prototyperef="root"/>
    <title>The Message</title>
    <text>Don't push me 'cause I'm close 
to the edge.</text>
  </hopobject>
</xmlroot>


... comment


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