
150 Chapter 3
•
•
•
•
XmlDocument Object
MediaRich allows users to interact with XML documents and supports all the objects,
properties, and methods of the Document Object Model (DOM) Level 1 Core. The DOM
Core is an application programming interface for XML documents. For information on
using the DOM Level 1 Core objects, properties, and methods, see
http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/.
NOTE: If your MediaScript uses the Xmldocument object, it must reference the xml.ms file that
installs with MediaRich using the #include directive. Include the following line at the beginning of
your script:
#include "sys:xml.ms";
For more information about using the #include directive, see “Using the #include
Directive” on page 12.
XmlDocument Object Properties
The XmlDocument object has all the properties of the DOM’s Document class, as well as
the loaded property.
loaded
A Boolean property, the value of which is determined by whether or not the XmlDocument
is loaded.
Syntax
<object name>.loaded;
XmlDocument Object methods
The XmlDocument object has all the methods of the DOM’s Document class, as well as the
following methods:
•
new XmlDocument() constructor
•
loadFile()
•
loadString()
•
save()
new XmlDocument()
The XmlDocument object needs to be constructed using the new XmlDocument()
constructor.
Syntax
var Test = new XmlDocument();