Section 25.87. DOMParser: parses XML markup to create a Document


25.87. DOMParser: parses XML markup to create a Document

Firefox 1.0, Safari 2.01, Opera 7.60: Object DOMParser

25.87.1. Constructor

 new DOMParser( ) 

25.87.2. Methods


parseFromString( )

Parses XML markup and returns a Document.

25.87.3. Description

A DOMParser object parses XML text and returns an XML Document object. To use a DOMParser, instantiate one with the no-argument constructor and then call its parseFromString( ) method:

 var doc = (new DOMParser( )).parseFromString(text); 

Internet Explorer does not support the DOMParser object. Instead, it supports XML parsing with Document.loadXML( ). Note that the XMLHttpRequest object can also parse XML documents. See the responseXML property of XMLHttpRequest.

25.87.4. See Also

Document.loadXML( ), XMLHttpRequest; Chapter 21




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net