Interface: Text

sync.api.dom. Text

Interface for the text nodes.
Properties:
Name Type Description
wholeText string The whole text - it does not merge it with text in neighboring entity references.
isElementContentWhitespace boolean true if the node is element content whitespace. Always false.
data string The text.
length number The length of the text.

Extends

Methods


compareDocumentPosition(other)

Compares the reference node, i.e. the node on which this method is being called, with a node, i.e. the one passed as a parameter, with regard to their position in the document and according to the document order.
Parameters:
Name Type Description
other sync.api.dom.Node The node to compare to.
Inherited From:
Returns:
A bitmask with the following values from the Node class:
  • DOCUMENT_POSITION_CONTAINED_BY - The node is contained by the reference node. A node which is contained is always following, too.
  • DOCUMENT_POSITION_CONTAINS - The node contains the reference node. A node which contains is always preceding, too.
  • DOCUMENT_POSITION_DISCONNECTED - The two nodes are disconnected. Order between disconnected nodes is always implementation-specific.
  • DOCUMENT_POSITION_FOLLOWING - The node follows the reference node.
  • DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC - The determination of preceding versus following is implementation-specific.
  • DOCUMENT_POSITION_PRECEDING - The second node precedes the reference node.
  • Type
    number

    hasAttributes()

    Returns true if the node has attributes.
    Inherited From:
    Returns:
    if the node has attributes.
    Type
    true

    hasChildNodes()

    Returns whether this node has any children.
    Inherited From:
    Overrides:
    Returns:
    true if the node has child nodes.
    Type
    boolean

    isEqualNode(other)

    Test if two nodes have the same structure.
    Parameters:
    Name Type Description
    other sync.api.dom.Node The node to compare to.
    Inherited From:
    Returns:
    true if the two nodes have the same structure.
    Type
    boolean

    isSameNode(other)

    The API may return different JS DOM objects for the same XML node - to detect this case, use this method.
    Parameters:
    Name Type Description
    other sync.api.dom.Node The node to compare to.
    Inherited From:
    Returns:
    true if the two objects represent the same XML node.
    Type
    boolean

    lookupNamespaceURI(prefix)

    Look up the namespace URI associated to the given prefix, starting from this node.
    Parameters:
    Name Type Description
    prefix string The URI of the namespace.
    Inherited From:
    Returns:
    the mapped namespace URI.
    Type
    string

    lookupPrefix(namespaceURI)

    Look up the prefix associated to the given namespace URI, starting from this node. The default namespace declarations are ignored by this method.
    Parameters:
    Name Type Description
    namespaceURI string The URI of the namespace.
    Inherited From:
    Returns:
    the associated prefix, or null if there is no associated prefix. If there are multiple mappings, return the closest one to this node.
    Type
    string