public class XMLDOMNode extends MSXMLScriptable
Constructor and Description |
---|
XMLDOMNode()
Creates an instance.
|
Modifier and Type | Method and Description |
---|---|
Object |
appendChild(Object newChild)
Appends a new child as the last child of the node.
|
Object |
cloneNode(boolean deep)
Clones a new node.
|
Object |
getAttributes()
Returns the list of attributes for this node.
|
String |
getBaseName()
Returns the base name for the name qualified with the namespace.
|
XMLDOMNodeList |
getChildNodes()
Returns a node list containing the child nodes.
|
String |
getDataType()
Returns the data type for this node.
|
String |
getDefinition()
Returns the definition of the node in the document type definition (DTD) or schema.
|
XMLDOMNode |
getFirstChild()
Returns the first child of this node.
|
protected XMLDOMNode |
getJavaScriptNode(DomNode domNode)
Gets the JavaScript node for a given
DomNode . |
XMLDOMNode |
getLastChild()
Returns the last child node.
|
String |
getNamespaceURI()
Returns the Uniform Resource Identifier (URI) for the namespace.
|
XMLDOMNode |
getNextSibling()
Returns the next sibling of this node in the parent's child list.
|
String |
getNodeName()
Returns the qualified name for attribute, document type, element, entity, or notation nodes.
|
short |
getNodeType()
Returns the XML Document Object Model (DOM) node type, which determines valid values and whether the node can
have child nodes.
|
String |
getNodeValue()
Returns the text associated with the node.
|
Object |
getOwnerDocument()
Returns the root of the document that contains the node.
|
Object |
getParentNode()
Returns the parent node.
|
String |
getPrefix()
Returns the namespace prefix.
|
XMLDOMNode |
getPreviousSibling()
Returns the previous sibling of the node in the parent's child list.
|
Object |
getText()
Returns the text content of the node or the concatenated text representing the node and its descendants.
|
Object |
getXml()
Returns the XML representation of the node and all its descendants.
|
boolean |
hasChildNodes()
Provides a fast way to determine whether a node has children.
|
static Object |
insertBefore(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Inserts a child node to the left of the specified node, or at the end of the list.
|
protected Object |
insertBeforeImpl(Object[] args)
Inserts a child node to the left of the specified node, or at the end of the list.
|
Object |
removeChild(Object childNode)
Removes the specified child node from the list of children and returns it.
|
Object |
replaceChild(Object newChild,
Object oldChild)
Replaces the specified old child node with the supplied new child node.
|
XMLDOMSelection |
selectNodes(String expression)
Applies the specified pattern-matching operation to this node's context and returns the list of matching nodes.
|
Object |
selectSingleNode(String expression)
Applies the specified pattern-matching operation to this node's context and returns the first matching node.
|
void |
setNodeValue(String value)
Sets the text associated with the node.
|
void |
setText(Object text)
Replace all child elements of this element by the supplied text.
|
getClassName, getEnvironment, getPrototype, isReadOnlySettable, makeScriptableFor, setEnvironment, setParentScope
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, setCaseSensitive, setClassName, setDomNode, setDomNode, setHtmlElement
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setPrototype, size
public XMLDOMNode()
public Object getAttributes()
public String getBaseName()
public XMLDOMNodeList getChildNodes()
public String getDataType()
public String getDefinition()
public XMLDOMNode getFirstChild()
public XMLDOMNode getLastChild()
public String getNamespaceURI()
public XMLDOMNode getNextSibling()
public String getNodeName()
public short getNodeType()
public String getNodeValue()
public void setNodeValue(String value)
value
- the text associated with the nodepublic Object getOwnerDocument()
public Object getParentNode()
public String getPrefix()
public XMLDOMNode getPreviousSibling()
public Object getText()
public void setText(Object text)
text
- the new text of this nodepublic Object getXml()
public Object appendChild(Object newChild)
newChild
- the new child node to be appended at the end of the list of children belonging to this nodepublic Object cloneNode(boolean deep)
deep
- flag that indicates whether to recursively clone all nodes that are descendants of this node;
if true
, creates a clone of the complete tree below this node,
if false
, clones this node and its attributes onlypublic boolean hasChildNodes()
true
if this node has childrenpublic static Object insertBefore(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
context
- the JavaScript contextthisObj
- the scriptableargs
- the arguments passed into the methodfunction
- the functionprotected Object insertBeforeImpl(Object[] args)
args
- 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 Object removeChild(Object childNode)
childNode
- the child node to be removed from the list of children of this nodepublic Object replaceChild(Object newChild, Object oldChild)
newChild
- the new child that is to replace the old child; if null
,
oldChild
is removed without a replacementoldChild
- the old child that is to be replaced by the new childpublic XMLDOMSelection selectNodes(String expression)
expression
- a string specifying an XPath expressionpublic Object selectSingleNode(String expression)
expression
- a string specifying an XPath expressionnull
protected XMLDOMNode getJavaScriptNode(DomNode domNode)
DomNode
.Copyright © 2002–2015 Gargoyle Software Inc.. All rights reserved.