XML DOM - DOMParser object
- Previous page DOM Implementation
- Next page DOM Element
analyseer XML markering om een document te maken.
Constructor
new DOMParser()
Verklaring
DOMParser object parseert XML tekst en retourneert een XML Document objectOm DOMParser te gebruiken, instancieer het met een parameterloze constructor en roep vervolgens zijn parseFromString() methode aan:
var doc = (new DOMParser()).parseFromString("}})text)
IE does not support the DOMParser object. Instead, it supports using Document.loadXML() XML parsing of XMLHttpRequest.
Note that the XMLHttpRequest object can also parse XML documents. See the responseXML Property.
DOMParser.parseFromString()
Parse XML markup
Syntax
parseFromString(text, contentType)
The text parameter is the XML markup to be parsed.
contentType is the content type of the text. It can be one of "text/xml", "application/xml", or "application/xhtml+xml". Note that "text/html" is not supported.
Return value
Save text Represents a Document object. See also Document.loadXML(), to understand a specific IE alternative to this method.
- Previous page DOM Implementation
- Next page DOM Element