@DOMObjectAttribute @DOMNameAttribute(name="Text") public class Text extends com.aspose.html.dom.CharacterDataDOM
The Text interface inherits from CharacterData and represents the textual content (termed character data in XML) of an Element or Attr.
Node.Flags
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, flags, nodeDocument, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
EventMap
PropertyChanged
Constructor and Description |
---|
Text(String data,
Document doc)
Initializes a new instance of the
Text class. |
Modifier and Type | Method and Description |
---|---|
String |
getNodeName()
The name of this node, depending on its type.
|
int |
getNodeType()
A code representing the type of the underlying object.
|
String |
getNodeValue()
The value of this node, depending on its type.
|
String |
getTextContent()
This attribute returns the text content of this node and its descendants.
|
String |
getWholeText()
Returns all text of Text nodes logically-adjacent text nodes to this node, concatenated in document order.
|
boolean |
isElementContentWhitespace()
Returns whether this text node contains element content whitespace, often abusively called "ignorable whitespace".
|
Text |
replaceWholeText(String content)
Replaces the text of the current node and all logically-adjacent text nodes with the specified text.
|
void |
setNodeValue(String value)
The value of this node, depending on its type.
|
void |
setTextContent(String value)
This attribute returns the text content of this node and its descendants.
|
Text |
splitText(int offset)
Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings.
|
appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData, toString
adoptNode, appendChild, cloneNode, deepClone, getAttributes, getBaseURI, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getRegisteredObservers, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceAll, replaceChild, setParentNode, setPrefix
addEventListener, addEventListener, addEventListener, addEventListener, dispatchEvent, dispose, removeEventListener, removeEventListener, removeEventListener
fireNotifyPropertyChanged, getCurrentValues, getRuntimesBinding, setCurrentValues, setField, setRuntimesBinding
@DOMNameAttribute(name="splitText") public Text splitText(int offset)
Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings.
offset
- The offset.Text
.@DOMNameAttribute(name="isElementContentWhitespace") public boolean isElementContentWhitespace()
Returns whether this text node contains element content whitespace, often abusively called "ignorable whitespace".
Value:true
if this instance is element content whitespace; otherwise, false
.@DOMNameAttribute(name="wholeText") public String getWholeText()
Returns all text of Text nodes logically-adjacent text nodes to this node, concatenated in document order.
Value: The whole text.@DOMNameAttribute(name="replaceWholeText") public Text replaceWholeText(String content)
Replaces the text of the current node and all logically-adjacent text nodes with the specified text. All logically-adjacent text nodes are removed including the current node unless it was the recipient of the replacement text.
content
- The content.Text
.public String getNodeName()
The name of this node, depending on its type.
Value: The name of the node.getNodeName
in class Node
public int getNodeType()
A code representing the type of the underlying object.
Value: The type of the node.getNodeType
in class Node
public String getNodeValue()
The value of this node, depending on its type.
Value: The node value.getNodeValue
in class Node
public void setNodeValue(String value)
The value of this node, depending on its type.
Value: The node value.setNodeValue
in class Node
public String getTextContent()
This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. On setting, any possible children this node may have are removed and, if it the new string is not empty or null, replaced by a single Text node containing the string this attribute is set to.
Value: The content of the text.getTextContent
in class Node
public void setTextContent(String value)
This attribute returns the text content of this node and its descendants. When it is defined to be null, setting it has no effect. On setting, any possible children this node may have are removed and, if it the new string is not empty or null, replaced by a single Text node containing the string this attribute is set to.
Value: The content of the text.setTextContent
in class Node