Name
XML.load( ) Method — import XML source code from an external document
Availability
Flash 5
Synopsis
XMLdoc.load(URL)
Arguments
- URL
A string specifying the location of the XML document to load.
Description
The load( )
method imports an external XML document, parses it, converts it into
an XML object hierarchy, and places that hierarchy into
XMLdoc. Any previous contents of
XMLdoc are replaced by the newly loaded
XML content.
XMLdoc must be an instance of the
XML class, not the XMLnode
class.
Usage
Before accessing content imported with load( ),
we must be sure the load and parsing operations are complete. To do
so, either check the value of the XML document’s
loaded property, or assign the document an
onLoad( ) callback handler to respond to the
load completion. See the
XML
.loaded and
XML.onLoad( ) entries for details. To determine
whether the loaded data was successfully parsed, check the
document’s status property.
XML.load( ) is subject to the domain-based
security restrictions described in Table 20.8 under
the global loadVariables( ) function.
Example
myDoc = new XML( );
myDoc.load("myData.xml");See Also
XML
.loaded,
XML.onLoad( ), XML.sendAndLoad(
),
XML
.status
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access