Packagedom.loadsave
Interfacepublic interface DocumentLS
Implementors Document

Obsolete

The DocumentLS interface provides a mechanism by which the content of a document can be replaced with the DOM tree produced when loading a URI, or parsing a string. The expectation is that an instance of the DocumentLS interface can be obtained by using binding-specific casting methods on an instance of the Document interface.

See also

W3C - DocumentLS


Public Properties
 PropertyDefined By
  DOM 3 Load and Save Obsolete async : Boolean
Indicates whether the method load should be synchronous or asynchronous.
DocumentLS
Public Methods
 MethodDefined By
  
DOM 3 Load and Save Obsolete abort():void
If the document is currently being loaded as a result of the method load being invoked the loading and parsing is immediately aborted.
DocumentLS
  
DOM 3 Load and Save Obsolete load(uri:DOMString):Boolean
Replaces the content of the document with the result of parsing the given URI.
DocumentLS
  
DOM 3 Load and Save Obsolete loadXML(source:DOMString):Boolean
Replace the content of the document with the result of parsing the input string, this method is always synchronous.
DocumentLS
  
DOM 3 Load and Save Obsolete saveXML(snode:Node):DOMString
Save the document or the given node to a string (i.e.
DocumentLS
Property Detail
DOM 3 Load and Save Obsolete asyncproperty
async:Boolean

Obsolete

Indicates whether the method load should be synchronous or asynchronous. When the async attribute is set to true the load method returns control to the caller before the document has completed loading.

The default value is false.


Implementation
    public function get async():Boolean
    public function set async(value:Boolean):void

Throws
DOMException — NOT_SUPPORTED_ERR: Raised if the implementation doesn't support the mode the attribute is being set to.

See also


Example
         function loadXMLData(e) {
             alert(new XMLSerializer().serializeToString(e.target)); // Gives querydata.xml contents as string
         }
         
         var xmlDoc = document.implementation.createDocument("", "test", null);
         xmlDoc.async = false;
         xmlDoc.onload = loadXMLData;
         xmlDoc.load('querydata.xml');
Method Detail
DOM 3 Load and Save Obsolete abort()method
public function abort():void

Obsolete

If the document is currently being loaded as a result of the method load being invoked the loading and parsing is immediately aborted. The possibly partial result of parsing the document is discarded and the document is cleared.

See also

DOM 3 Load and Save Obsolete load()method 
public function load(uri:DOMString):Boolean

Obsolete

Replaces the content of the document with the result of parsing the given URI. Invoking this method will either block the caller or return to the caller immediately depending on the value of the async attribute. Once the document is fully loaded the document will fire a "load" event that the caller can register as a listener for. If an error occurs the document will fire an "error" event so that the caller knows that the load failed (see ParseErrorEvent). If this method is called on a document that is currently loading, the current load is interrupted and the new URI load is initiated.

Note (Mozilla): As of at least Gecko 1.9, this no longer supports cross-site loading of documents (Use XMLHttpRequest instead).

Parameters

uri:DOMString — The URI reference for the XML file to be loaded. If this is a relative URI, the base URI used by the implementation is implementation dependent.

Returns
Boolean — If async is set to true load returns true if the document load was successfully initiated. If an error occurred when initiating the document load load returns false. If async is set to false load returns true if the document was successfully loaded and parsed. If an error occurred when either loading or parsing the URI load returns false.

See also


Example
         var xmlDoc = document.implementation.createDocument("", "test", null);
         function documentLoaded (e) {
             alert(new XMLSerializer().serializeToString(e.target)); // Gives querydata.xml contents as string
         }
         xmlDoc.addEventListener("load", documentLoaded, false);
         xmlDoc.load('querydata.xml');
DOM 3 Load and Save Obsolete loadXML()method 
public function loadXML(source:DOMString):Boolean

Obsolete

Replace the content of the document with the result of parsing the input string, this method is always synchronous. This method always parses from a DOMString, which means the data is always UTF16. All other encoding information is ignored.

Parameters

source:DOMString — A string containing an XML document.

Returns
Boolean — true if parsing the input string succeeded without errors, otherwise false.

See also

DOM 3 Load and Save Obsolete saveXML()method 
public function saveXML(snode:Node):DOMString

Obsolete

Save the document or the given node to a string (i.e. serialize the document or node).

Parameters

snode:Node — Specifies what to serialize, if this parameter is null the whole document is serialized, if it's non-null the given node is serialized.

Returns
DOMString — The serialized document or null.

Throws
DOMException — WRONG_DOCUMENT_ERR: Raised if the node passed in as the node parameter is from an other document.

See also