Functions for reading and writing XML documents.
Methods
createDocument([string]) |
Creates a new empty XML document, or if you pass an optional string it will load the document from that string. Returns an XmlDocument class. |
loadDocument(filename) |
Creates a new XML document and loads the given file into it. Returns an XmlDocument if successful or null if failed. |
Examples
var doc=system.xml.loadDocument("mytest.xml"); // mytest.xml is in the scene resources - could also be a disk location or URL
var rootNode=doc.selectSingle("dxmesh"); // find the root note called 'dxmesh'
if (rootNode.attributeExists("version")) // does this have an attribute called 'version'?
{
print("Found version info: "+rootNode.attributeGet("version"));
}
var childNode=rootNode.firstChild;
while (childNode != null)
{
print(childNode.name); // print the name of every child node found.
childNode=childNode.nextSibling;
}
Remarks
See Also


