appendChild | childNode = appendChild(thisElem,childNode) appends a
node to this Element node and returns the appended node
object.
|
cloneNode | docClone = cloneNode(thisElem,deep) creates and
returns a copy of this matlab.io.xml.dom.Element object. If
deep is true , the copy is a deep copy.
If deep is false , the copy is a shallow
copy.
|
compareDocumentPosition | posEnum = compareDocumentPosition(thisElem,otherNode)
returns a double value that encodes the position of a node in the document of this
element relative to the position of this element in the document. To decode the
returned value, posEnum , use the MATLAB expression
bitor(posEnum,POSITION_ENUM) == posEnum , where
POSITION_ENUM is one of these Element methods:
DOCUMENT_POSITION_FOLLOWING — The other node follows this element
node. DOCUMENT_POSITION_PRECEDING — The other node precedes this element
node. DOCUMENT_POSITION_CONTAINED_BY — This element node contains the other
node, which also follows this node. DOCUMENT_POSITION_CONTAINS — The other node contains this element node
and also precedes this node DOCUMENT_POSITION_DISCONNECTED — The two nodes are disconnected.
For
example: |
getAttribute | val = getAttribute(thisElem,name) returns the value of
the attribute with the specified name or an empty character array if the element
does not have the specified attribute.
Specify
name as a character vector or string scalar. |
getAttributeNode | attr = getAttributeNode(thisElem,name) returns a
matlab.io.xml.dom.Attr object that represents the element attribute
with the specified name. If this element does not have the specified attribute,
the method returns an empty Attr object.
Specify
name as a character vector or string scalar. |
getAttributeNodeNS
| attr =
getAttributeNodeNS(thisElem,namespaceURI,localName) returns a matlab.io.xml.dom.Attr object that represents the element attribute
with the specified namespace URI and local name. If this element does not have the
specified attribute, the method returns an empty node object.
Specify
namespaceURI and lacalName as a character
vector or string scalar. |
getAttributeNS | val = getAttributeNS(thisElem,namespaceURI,localName)
returns the value of the attribute with the specified namespace URI and local
name. If this element does not have the specified attribute, the method returns an
empty character array.
Specify namespaceURI and
localName as a character vector or string
scalar. |
getAttributes | attrs = getAttributes(thisElem) returns a matlab.io.xml.dom.NamedNodeMap object that contains the
Attr objects for the attributes of this element.
|
getBaseURI | name = getBaseURI(thisElem) returns the base URI of
this element as a character vector. If the base URI is not known, the method
returns an empty character array.
The base URI of an element is the
URI of the document that owns the element. |
getChildElementCount | count = getChildElementCount(thisElem) returns the
number of children that are elements or 0 if none of the
children are elements.
|
getChildNodes | nodeList = getChildNodes(thisElem) returns the
children of this element as a matlab.io.xml.dom.NodeList object.
|
getChildren | nodes = getChildren(thisElem) returns a
1-by-N array of objects, such as
matlab.io.xml.dom.Element or
matlab.io.xml.dom.Text objects, that represent the children of
this element.
|
getElementsByTagName | list = getElementsByTagName(thisElem,name) returns a
matlab.io.xml.dom.NodeList object that lists the descendant elements of
this element that match the specified tag name. Specify name as
a character vector or string scalar. To match all tag names, specify
"*" or '*' .
The
NodeList object lists elements in the order that they occur in a
traversal of the document tree that contains this element, starting with this
element. |
getElementsByTagNameNS | list =
getElementsByTagNameNS(thisElem,namespaceURI,localName) returns a
matlab.io.xml.dom.NodeList object that lists the elements that are
descendants of this element and that match the specified namespace URI and local
name. To match all namespace URIs and local names, specify "*"
or '*' .
The NodeList object lists
the elements in the order that they occur in a traversal of the document tree that
contains this element, starting with this element. |
getFirstChild | child = getFirstChild(thisElem) returns the first child of
this element. |
getFirstElementChild | childElem = getFirstElementChild(thisElem) returns the
first child of this element that is an element. If this element does not have
child elements, the method returns an empty object.
|
getLastChild | child = getLastChild(thisElem) returns the last child of
this element. |
getLastElementChild | childElem = getLastElementChild(thisElem) returns the
last child of this element that is an element. If this element does not have child
elements, the method returns an empty object.
|
getLocalName | name = getLocalName(thisElem) returns the local name
of this element as a character vector. For example, this method returns
'p' for an element named
'w:p' .
|
getNamespaceURI | uri = getNamespaceURI(thisElem) returns the namespace
URI of this element as a character vector. The method returns an empty character
vector if the element does not have a namespace URI.
|
getNextSibling | getNextSibling(thisElem) returns the node that follows
this element in the child list of the parent of this element.
|
getNextElementSibling | elem = getNextElementSibling(thisElem) returns the
element that immediately follows this element in the child list of the parent. If
no element follows this element, the method returns an empty
object.
|
getNodeIndex | index = getNodeIndex(thisElem) returns the position of
this element relative to the first node in the document in which this element
resides. The index count includes attributes.
|
getNodeName | name = getNodeName(thisElem) returns the tag name of
this element.
This method provides compatibility with existing
MATLAB® code that is based on the W3C XML DOM standard. In new code, use
getTagName instead. |
getNodeType | type = getNodeType(thisElem) returns the double
1 , which indicates that this node is an
element.
This method provides compatibility with existing MATLAB code that is based on the W3C XML DOM standard. For new
MATLAB code, use isa to determine the type of a node.
For
example: |
getNodeTypeName | name = getNodeTypeName(thisElem) returns
'ELEMENT_NODE' . |
getNodeValue | value = getNodeValue(thisElem) returns the node value
of this element. The node value of an element is an empty character array.
This method provides compatibility with existing MATLAB code that is based on the W3C XML DOM standard. |
getOwnerDocument | doc = getOwnerDocument(thisElem) returns the document
that owns this element as a matlab.io.xml.dom.Document object. The owner document is the document
that created or imported this element.
|
getParentNode | parent = getParentNode(thisElem) returns the parent node of
this element. If this element does not have a parent, the method returns an empty
node. |
getPrefix | prefix = getPrefix(thisElem) returns the namespace
prefix of this element. For example, this method returns 'w'
for an element named 'w:p' . If the element name does not have
prefix, this method returns an empty character array.
|
getPreviousSibling | getPreviousSibling(thisElem) returns the node that
precedes this element in the child list of the parent node of this element. If no
node precedes this element, the method returns an empty node object
|
getPreviousElementSibling | elem = getPreviousElementSibling(thisElem) returns the
element that immediately precedes this element in the child list of the parent. If
no node precedes this element, the method returns an empty node
object.
|
getSchemaTypeInfo | info = getSchemaTypeInfo(thisElem) returns a matlab.io.xml.dom.TypeInfo object that specifies the name, namespace,
and derivation of the schema type that defines this element.
The
TypeInfo object contains type information only if the element
contains schema type information. An element contains schema information only if
the parser for the document that contains the element is configured to validate
the document against a schema and to save post-validation schema information
(PSVI) in parsed elements and attributes. |
getTagName | name = getTagName(thisElem) returns the name of this
element as a character vector. The name corresponds to the name in the XML markup
for the element. For example, if this element represents the markup
<para>Hello World</para> , this method returns
'para' .
|
getTextContent | getTextContent(thisElem) returns the text content of this
element. If this element has children, this method returns the concatenated text
content of the children. |
hasAttribute | tf = hasAttribute(thisElem,name) returns
true if this element has an attribute with the specified
name.
|
hasAttributeNS | tf = hasAttributeNS(thisElem,namespaceURI,localName)
returns true if this element has an attribute with the
specified namespace URI and local name.
|
hasAttributes | tf = hasAttributes(thisElem) returns
true if this element has attributes.
|
hasChildNodes | tf = hasChildNodes(thisElem) returns
true if this element has children.
|
isDefaultNamespace | tf = isDefaultNamespace(thisElem,namespaceURI) returns
true if the namespace specified by
namespaceURI is the default namespace of this
element.
A default namespace is an element namespace declared without
a prefix. The element and all its children whose names lack a prefix belong to the
default namespace. Use setAttributeNS to declare a default
namespace for an element. You can use the
Document(namespaceURI,qualifiedName) syntax to declare a
default namespace for the root element of a document.
|
isEqualNode | tf = isEqualNode(thisElem,otherNode) returns
true if the node specified by otherNode is
an element and the values of the following properties of the node are equal to the
values of the corresponding properties of this element:
tag name prefix local name namespace URI base URI
The property values are equal if they have the same
length and are character-for-character equal. The node owner document and
attribute values do not affect equality. This method tests for
equality of nodes, not whether the nodes are handles to the same object. To test
for sameness, use the isSameNode method. Nodes that
are the same are also equal, but nodes that are equal are not necessarily the
same. Normalize documents before testing them for equality because
normalization can affect equality. |
isSameNode | tf = isSameNode(thisElem,otherNode) returns
true if otherNode is the same node as
thisElem .
|
lookupNamespaceURI | uri = lookupNamespaceURI(thisElem,prefix) returns the
namespace URI associated with prefix . If the prefix is not
associated with a URI, the method returns an empty character array.
|
lookupPrefix | prefix = lookupPrefix(thisElem,namespaceURI) returns
the prefix associated with the specified namespace URI as a character vector. If
this element does not associate a prefix with the namespace URI, the method
returns an empty character array.
|
normalize | normalize(thisElem) removes empty text nodes from this
element and combines adjacent text nodes into a single text node.
Normalization ensures that the element structure is the same as the
structure after saving and reloading the document that contains the
element. |
removeAttribute | removeAttribute(thisElem,name) removes the attribute
with the specified name from this element. Specify
name as a character vector or string scalar. If the specified
attribute has a default value, the method replaces the attribute with an attribute
that has the default value and the same name or namespace URI and local name as
the replaced attribute.
|
removeAttributeNode | removeAttributeNode(thisElem,attrObj) removes the
attribute specified by attrObj from the element. Specify
attrObj as a matlab.io.xml.dom.Attr object. If the specified attribute has a default
value, the method replaces the attribute with an attribute that has the default
value and the same name or namespace URI and local name as the replaced
attribute.
|
removeAttributeNS | removeAttributeNS(thisElem,namespaceURI,localName)
removes the attribute with the specified namespace URI and local name from this
element. If the specified attribute has a default value, the method replaces the
attribute with an attribute that has the default value and the same name or
namespace URI and local name as the replaced attribute.
|
removeChild | child = removeChild(thisElem,child) removes the child
node specified by child from this element and returns the
removed child.
|
replaceChild | child = replaceChild(thisElem,newChild,oldChild)
replaces the child node specified by oldChild with the node
specified by newChild and returns newChild .
If the new child is a matlab.io.xml.dom.DocumentFragment object, the method replaces the old
child with all of the children of the DocumentFragment object and
inserts the children in the same order. If the new child is already in the
document tree, the method removes the child from the document before it replaces
the old child.
|
setAttribute | setAttribute(thisElem,name,value) adds an attribute
with the specified name and value to this element if this element does not already
have an attribute with this name. If the element has an attribute with the
specified name, the method sets the value of the attribute to the specified value.
Specify name and value as character vectors
or string scalars.
Because the method treats the value as CDATA, the
method ignores markup text, including entity references, in the value string. To
set an attribute to a value that includes an entity reference, such as
& , create a matlab.io.xml.dom.Attr node with the value and then use
setAttributeNode to add the Attr node to an
element. |
setAttributeNode | newAttr = setAttributeNode(thisElem,attrNode) adds the
specified attribute to this element if the element does not contain an attribute
with the same name. If this element already contains an attribute with the same
name, the method replaces the existing attribute with the new attribute and
returns the replaced attribute.
Specify attrNode as
a matlab.io.xml.dom.Attr object. The method returns the new attribute as
a matlab.io.dom.xml.Attr object. |
setAttributeNodeNS | newAttr = setAttributeNodeNS(thisElem,attrNode) adds
an attribute node to this element if the element does not contain an attribute
with the same namespace URI and local name. If this element already contains an
attribute with the same namespace URI and local name, the method replaces the
existing attribute with the new attribute and returns the replaced
attribute.
Specify attrNode as a matlab.io.xml.dom.Attr object. The method returns the new attribute as
a matlab.io.dom.xml.Attr object. |
setAttributeNS | setAttribute(thisElem,namespaceURI,localName,value)
adds an attribute with the specified namespace URI, local name, and value to this
element if this element does not already contain an attribute with the specified
name. If this element already has an attribute with the specified namespace URI
and local name, this method sets the value of the existing attribute to the
specified value.
Specify namespaceURI ,
localName , and value as character vectors
or string scalars. Because the method treats the value as CDATA, the
method ignores markup text, including entity references, in the value string. To
set an attribute to a value that includes an entity reference, such as
& , create a matlab.io.xml.dom.Attr node with the value and then use
setAttributeNodeNS to add the Attr node to an
element. |
setIDAttribute | setIDAttribute(thisElem,name,true) declares that the
element attribute with the specified name is an ID
attribute.
setIDAttribute(thisElem,name,false)
declares that the element attribute with the specified name is not an ID
attribute.
Specify name as a character vector or
string scalar. |
setIDAttributeNode | setIDAttributeNode(thisElem,attrNode,true) declares
that the element attribute specified by attrNode is an ID
attribute.
setIDAttributeNode(thisElem,attrNode,false)
declares that the element attribute specified by attrNode is
not an ID attribute.
Specify attrNode as a matlab.io.xml.dom.Attr object. |
setIDAttributeNS | setIDAttributeNS(thisElem,namespaceURI,localName,true)
declares that the element attribute with the specified namespace URI and local
name is an ID attribute.
setIDAttributeNS(thisElem,namespaceURI,localName,false)
declares that the element attribute with the specified namespace URI and local
name is not an ID attribute.
Specify spaceURI and
localName as a character vector or string
scalar. |
setNodeValue | setNodeValue has no effect. This method provides
compatibility with existing MATLAB code that is based on the W3C XML DOM standard.
|
setTextContent | setTextContent(thisElem,textContent) replaces existing
nodes in this element with a matlab.io.xml.dom.Text node that contains the specified
text.
Specify textContent as a character vector or
string scalar. |