public class XMLDOMDocument extends XMLDOMNode
| Constructor and Description |
|---|
XMLDOMDocument()
Creates a new instance.
|
XMLDOMDocument(WebWindow enclosingWindow)
Creates a new instance, with associated
XmlPage. |
| Modifier and Type | Method and Description |
|---|---|
Object |
appendChild(Object newChild)
Appends a new child as the last child of the node.
|
Object |
createAttribute(String name)
Creates a new attribute with the specified name.
|
Object |
createCDATASection(String data)
Creates a CDATA section node that contains the supplied data.
|
Object |
createComment(String data)
Creates a comment node that contains the supplied data.
|
Object |
createDocumentFragment()
Creates an empty document fragment object.
|
Object |
createElement(String tagName)
Creates an element node using the specified name.
|
Object |
createNode(Object type,
String name,
Object namespaceURI)
Creates a node using the supplied type, name, and namespace.
|
Object |
createProcessingInstruction(String target,
String data)
Creates a processing instruction node that contains the supplied target and data.
|
Object |
createTextNode(String data)
Creates a text node that contains the supplied data.
|
XMLDOMDocumentType |
getDoctype()
Returns the document type node that specifies the DTD for this document.
|
XMLDOMElement |
getDocumentElement()
Returns the root element of the document.
|
XMLDOMNodeList |
getElementsByTagName(String tagName)
Returns a collection of elements that have the specified name.
|
XMLDOMImplementation |
getImplementation()
Returns the implementation object for the document.
|
Object |
getOwnerDocument()
Returns the root of the document that contains the node.
|
protected SgmlPage |
getPage() |
XMLDOMParseError |
getParseError()
Returns a parse error object that contains information about the last parsing error.
|
String |
getProperty(String name)
Retrieves the value of one of the second-level properties that are set either by default or using the
setProperty(String, String) method. |
Object |
getText()
Returns the text content of the node or the concatenated text representing the node and its descendants.
|
String |
getUrl()
Returns the URL for the last loaded XML document.
|
String |
getXml()
Returns the XML representation of the node and all its descendants.
|
protected void |
initParentScope(DomNode domNode,
HtmlUnitScriptable scriptable)
Initialize the parent scope of a newly created scriptable.
|
protected Object |
insertBeforeImpl(Object[] args)
Inserts a child node to the left of the specified node, or at the end of the list.
|
boolean |
isAsync()
Returns if asynchronous download is permitted.
|
boolean |
isPreserveWhiteSpace()
Returns the default white space handling.
|
boolean |
isPreserveWhiteSpaceDuringLoad() |
boolean |
load(String xmlSource)
Loads an XML document from the specified location.
|
boolean |
loadXML(String strXML)
Loads an XML document using the supplied string.
|
MSXMLScriptable |
makeScriptableFor(DomNode domNode)
Builds a new the JavaScript object that corresponds to the specified object.
|
Object |
nodeFromID(String id)
Returns the node that matches the ID attribute.
|
void |
setAsync(boolean async)
Sets if asynchronous download is permitted.
|
void |
setDoctype(Object ignored)
Overwritten to throw also in non strict mode.
|
void |
setDocumentElement(XMLDOMElement element)
Sets the root element of the document.
|
void |
setImplementation(Object ignored)
Overwritten to throw also in non strict mode.
|
void |
setNodeValue(String value)
Attempting to set the value of documents generates an error.
|
void |
setParseError(Object ignored)
Overwritten to throw also in non strict mode.
|
void |
setPreserveWhiteSpace(boolean preserveWhiteSpace)
Set the default white space handling.
|
void |
setProperty(String name,
String value)
This method is used to set second-level properties on the DOM object.
|
void |
setText(Object text)
Attempting to set the text of documents generates an error.
|
cloneNode, getAttributes, getBaseName, getChildNodes, getDataType, getDefinition, getFirstChild, getJavaScriptNode, getLastChild, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, insertBefore, removeChild, replaceChild, selectNodes, selectSingleNode, setFirstChild, setLastChildgetClassName, getEnvironment, getPrototype, setEnvironment, setParentScopeclone, equivalentValues, get, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, put, setClassName, setDomNode, setDomNodeapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setPrototype, sizepublic boolean isAsync()
public void setAsync(boolean async)
async - if asynchronous download is permittedpublic XMLDOMDocumentType getDoctype()
public void setDoctype(Object ignored)
ignored - ignored parampublic XMLDOMElement getDocumentElement()
public void setDocumentElement(XMLDOMElement element)
element - the root element of the documentpublic XMLDOMImplementation getImplementation()
public void setImplementation(Object ignored)
ignored - ignored parampublic void setNodeValue(String value)
setNodeValue in class XMLDOMNodevalue - the new value to setpublic Object getOwnerDocument()
getOwnerDocument in class XMLDOMNodepublic XMLDOMParseError getParseError()
public void setParseError(Object ignored)
ignored - ignored parampublic boolean isPreserveWhiteSpace()
public void setPreserveWhiteSpace(boolean preserveWhiteSpace)
preserveWhiteSpace - the default white space handlingpublic Object getText()
getText in class XMLDOMNodepublic void setText(Object text)
setText in class XMLDOMNodetext - the new text of this nodepublic String getUrl()
public String getXml()
getXml in class XMLDOMNodepublic Object appendChild(Object newChild)
appendChild in class XMLDOMNodenewChild - the new child node to be appended at the end of the list of children belonging to this nodepublic Object createAttribute(String name)
name - the name of the new attribute objectpublic Object createCDATASection(String data)
data - the value to be supplied to the new CDATA section object's nodeValue propertypublic Object createComment(String data)
data - the value to be supplied to the new comment object's nodeValue propertypublic Object createDocumentFragment()
public Object createElement(String tagName)
tagName - the name for the new element nodeNOT_FOUND if the tag is not supportedpublic Object createNode(Object type, String name, Object namespaceURI)
type - a value that uniquely identifies the node typename - the value for the new node's nodeName propertynamespaceURI - the namespace URI.
If specified, the node is created in the context of the namespaceURI parameter
with the prefix specified on the node name.
If the name parameter does not have a prefix, this is treated as the default namespace.public Object createProcessingInstruction(String target, String data)
target - the target part of the processing instructiondata - the rest of the processing instruction preceding the closing ?> characterspublic Object createTextNode(String data)
data - the value to be supplied to the new text object's nodeValue propertyNOT_FOUND if there is an errorpublic XMLDOMNodeList getElementsByTagName(String tagName)
tagName - the element name to find; the tagName value '*' returns all elements in the documentpublic String getProperty(String name)
setProperty(String, String) method.name - the name of the propertyprotected Object insertBeforeImpl(Object[] args)
insertBeforeImpl in class XMLDOMNodeargs - the arguments
newChild parameter is inserted to the left
of the refChild parameter; if null, the newChild parameter is inserted
at the end of the child list
public boolean load(String xmlSource)
xmlSource - a URL that specifies the location of the XML filetrue if the load succeeded; false if the load failedpublic boolean loadXML(String strXML)
strXML - the XML string to load into this XML document object;
this string can contain an entire XML document or a well-formed fragmenttrue if the load succeeded; false if the load failedpublic Object nodeFromID(String id)
id - the value of the ID to matchnullpublic void setProperty(String name, String value)
name - the name of the property to be setvalue - the value of the specified propertypublic boolean isPreserveWhiteSpaceDuringLoad()
protected SgmlPage getPage()
public MSXMLScriptable makeScriptableFor(DomNode domNode)
makeScriptableFor in class MSXMLScriptabledomNode - the DOM node for which a JS object should be createdprotected void initParentScope(DomNode domNode, HtmlUnitScriptable scriptable)
initParentScope in class HtmlUnitScriptabledomNode - the DOM node for the script objectscriptable - the script object to initializeCopyright © 2002–2022 Gargoyle Software Inc.. All rights reserved.