public class XMLDOMElement extends XMLDOMNode
Constructor and Description |
---|
XMLDOMElement() |
Modifier and Type | Method and Description |
---|---|
protected XMLDOMNamedNodeMap |
createAttributesObject()
Creates the JS object for the property attributes.
|
Object |
getAttribute(String name)
Returns the value of the attribute.
|
Object |
getAttributeNode(String name)
Returns the attribute node.
|
Object |
getAttributes()
Returns the list of attributes for this element.
|
DomElement |
getDomNodeOrDie()
Returns the DOM node that corresponds to this JavaScript object or throw
an exception if one cannot be found.
|
XMLDOMNodeList |
getElementsByTagName(String tagName)
Returns a list of all descendant elements that match the supplied name.
|
String |
getTagName()
Returns the element name.
|
String |
getText()
Returns a string that represents the element content.
|
void |
normalize()
Normalizes all descendant elements by combining two or more adjacent text nodes into one unified text node.
|
void |
removeAttribute(String name)
Removes the named attribute.
|
XMLDOMAttribute |
removeAttributeNode(XMLDOMAttribute att)
Removes the specified attribute from this element.
|
void |
setAttribute(String name,
String value)
Sets the value of the named attribute.
|
XMLDOMAttribute |
setAttributeNode(XMLDOMAttribute newAtt)
Sets or updates the supplied attribute node on this element.
|
void |
setNodeValue(String newValue)
Attempting to set the value of elements generates an error.
|
void |
setText(Object value)
Replaces all children of this element with the supplied value.
|
appendChild, cloneNode, getBaseName, getChildNodes, getDataType, getDefinition, getFirstChild, getJavaScriptNode, getLastChild, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getXml, hasChildNodes, insertBefore, insertBeforeImpl, removeChild, replaceChild, selectNodes, selectSingleNode
getClassName, getEnvironment, getPrototype, isReadOnlySettable, makeScriptableFor, setEnvironment, setParentScope
clone, equivalentValues, get, getBrowserVersion, getDefaultValue, getDomNodeOrNull, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
defineFunctionProperties, defineProperty, put, setClassName
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, 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, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, 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, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setPrototype, size
public Object getAttributes()
getAttributes
in class XMLDOMNode
protected XMLDOMNamedNodeMap createAttributesObject()
public void setNodeValue(String newValue)
setNodeValue
in class XMLDOMNode
newValue
- the new value to setpublic String getTagName()
public String getText()
getText
in class XMLDOMNode
public void setText(Object value)
setText
in class XMLDOMNode
value
- the new value for the contents of this nodepublic Object getAttribute(String name)
name
- the name of the attribute to returnnull
if the named attribute does not have a
specified valuepublic Object getAttributeNode(String name)
name
- the name of the attribute to returnnull
if the named attribute cannot be found
on this elementpublic void removeAttribute(String name)
name
- the name of the attribute to be removedpublic XMLDOMAttribute removeAttributeNode(XMLDOMAttribute att)
att
- the attribute to be removed from this elementpublic void setAttribute(String name, String value)
name
- the name of the attribute; if the attribute with that name already exists, its value is changedvalue
- the value for the named attributepublic XMLDOMAttribute setAttributeNode(XMLDOMAttribute newAtt)
newAtt
- the attribute node to be associated with this elementnull
otherwisepublic XMLDOMNodeList getElementsByTagName(String tagName)
tagName
- the name of the element to find; the tagName value '*' matches all descendant elements of this
elementpublic void normalize()
public DomElement getDomNodeOrDie()
getDomNodeOrDie
in class SimpleScriptable
Copyright © 2002–2020 Gargoyle Software Inc.. All rights reserved.