Extends (or replaces?)
DOM2 Node
.
Adds:
I will only show the new methods. Currently, the plan is to
simple add these to the exiting Node
interface.
In IDL:
interface Node {
readonly attribute DOMString baseURI;
typedef enum _DocumentOrder {
DOCUMENT_ORDER_PRECEDING,
DOCUMENT_ORDER_FOLLOWING,
DOCUMENT_ORDER_SAME,
DOCUMENT_ORDER_UNORDERED
};
DocumentOrder;
DocumentOrder compareDocumentOrder(in Node other) raises(DOMException);
typedef enum _TreePosition {
TREE_POSITION_PRECEDING,
TREE_POSITION_FOLLOWING,
TREE_POSITION_ANCESTOR,
TREE_POSITION_DESCENDANT,
TREE_POSITION_SAME,
TREE_POSITION_UNORDERED
};
TreePosition;
TreePosition compareTreePosition(in Node other) raises(DOMException);
attribute DOMString textContent;
readonly attribute DOMKey key;
boolean isSameNode(in Node other);
DOMString lookupNamespacePrefix(in DOMString namespaceURI);
DOMString lookupNamespaceURI(in DOMString prefix);
void normalizeNS();
boolean equalsNode(in Node arg, in boolean deep);
Node getAs(in DOMString feature);
};
};
Java binding:
package org.w3c.dom;
public interface Node {
public String getBaseURI();
public static final int DOCUMENT_ORDER_PRECEDING = 1;
public static final int DOCUMENT_ORDER_FOLLOWING = 2;
public static final int DOCUMENT_ORDER_SAME = 3;
public static final int DOCUMENT_ORDER_UNORDERED = 4;
public int compareDocumentOrder(Node other) throws DOMException;
public static final int TREE_POSITION_PRECEDING = 1;
public static final int TREE_POSITION_FOLLOWING = 2;
public static final int TREE_POSITION_ANCESTOR = 3;
public static final int TREE_POSITION_DESCENDANT = 4;
public static final int TREE_POSITION_SAME = 5;
public static final int TREE_POSITION_UNORDERED = 6;
public int compareTreePosition(Node other) throws DOMException;
public String getTextContent();
public void setTextContent(String textContent);
public boolean isSameNode(Node other);
public boolean equalsNode(Node arg, boolean deep);
public String lookupNamespacePrefix(String namespaceURI);
public String lookupNamespaceURI(String prefix);
public void normalizeNS();
public Node getAs(String feature);
public Object getKey();
}