appendData |
appendData(thisComment,characters) appends characters to the end of the character data in this comment.
Specifycharacters as a character vector or string scalar. |
cloneNode |
copy = cloneNode(thisComment,deep) creates a copy of this comment and returns the copy. Ifdeep is true, the copy is a deep copy. Ifdeep isfalse , the copy is a shallow copy.
|
compareDocumentPosition |
posEnum = compareDocumentPosition(thisComment,otherNode) returns a double value that encodes the position ofotherNode relative to the position ofthisComment in the document that ownsthisComment .
To decode the returned value,posEnum , use the MATLAB expressionbitor(posEnum,POSITION_ENUM) == posEnum ,在那里POSITION_ENUM is one of these评论 methods:
DOCUMENT_POSITION_FOLLOWING — The other node follows this comment node.
DOCUMENT_POSITION_PRECEDING — The other node precedes this comment node.
DOCUMENT_POSITION_CONTAINED_BY — This comment node contains the other node, which also follows this node.
DOCUMENT_POSITION_CONTAINS — The other node contains this comment node and also precedes this node.
DOCUMENT_POSITION_DISCONNECTED — The two nodes are disconnected.
For example:
|
deleteData |
deleteData(thisComment,offset,count) deletes a range of characters from the text in this comment. Theoffset argument is the zero-based index of the first character to delete, specified as an integer. Thecount argument is the number of characters to delete, specified as an integer.
|
getBaseURI |
uri = getBaseURI(thisComment) returns the base URI of this comment as a character vector. The base URI of a comment is the URI of the document that owns the comment.
|
getData |
str = getData(thisComment) returns the character data in this comment as a character vector.
|
getLength |
count = getLength(thisComment) returns the number of characters in this comment as a double.
|
getNextSibling |
sibling = getNextSibling(thisComment) returns the node that follows this comment in the child list of the parent of this comment node.
|
getNodeName |
name = getNodeName(thisComment) returns'#comment' . |
getNodeTypeName |
name = getNodeTypeName(thisComment) returns'COMMENT_NODE' . |
getNodeValue |
value = getNodeValue(thisComment) returns the content of this comment as a character vector.
|
getOwnerDocument |
doc = getOwnerDocument(thisComment) returns the document that owns this comment. The owner document is the document that created or imported this comment.
|
getParentNode |
parent = getParentNode(thisComment) returns the parent of this comment. If this comment does not have a parent, the method returns an empty node.
|
getPreviousSibling |
兄弟姐妹= getPreviousSibling (thisComment) returns the node that precedes this comment in the child list of the parent of this comment.
|
getTextContent |
text = getTextContent(thisComment) returns the character data in this comment as a character vector.
|
insertData |
insertData(thisComment,index,data) inserts character data at the position specified by the zero-based index argument. Specifydata as a character vector or string scalar.
|
isEqualNode |
tf = isEqualNode(thisComment,otherNode) returnstrue 如果the node specified byotherNode is a comment node and has the same text content asthisComment .
This method tests for equality of nodes, not whether the nodes are handles to the same object. To test for sameness, use the方法 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. |
方法 |
tf = isSameNode(thisComment,otherNode) returnstrue 如果otherNode is the same node asthisComment .
|
replaceData |
replaceData(thisComment,index,count,data) replaces the number of characters specified bycount in the text content of this comment node, starting at the position specified by the zero-basedindex , with the characters specified bydata .
Specifyindex andcount as integers. Specifydata as a character vector or string scalar. |
setData |
setData(thisComment,data) replaces the current content of this comment node with the text specified bydata .
Specifydata as a character vector or string scalar. |
setNodeValue |
setNodeValue(thisComment,value) sets the text content of this comment node to the text specified byvalue .
Specifyvalue as a character vector or string scalar. |
setTextContent |
setTextContent(thisComment,textContent) sets the text content in this comment node to the text specified bytextContent .
SpecifytextContent as a character vector or string scalar. |
splitText |
newNode = splitText(thisComment,index) splits this comment node into two comment nodes at the specified zero-based index and returns the new comment node. After the split, the original comment node contains the original text up to the index. The new node contains the original text from the index. If the index equals the length of the original text, the new node is empty. If this comment node has a parent, the method inserts the new comment node after this comment node in the parent node.
|
substringData |
substringData(thisComment,index,count) returns the characters specified byindex andcount . Index is the zero-based position of the first character to return andcount is the number of characters to return.
Specifyindex andcount as integers. |