public class DOMClient extends Object implements DocumentClient<Node>
Modifier and Type | Field and Description |
---|---|
protected NodeSet<Node> |
emptyNodeSet |
protected NodeSet<Node> |
emptyNodeSetReverse |
protected DocTypes |
metatools_doc_sources |
protected MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>> |
msg |
Constructor and Description |
---|
DOMClient() |
Modifier and Type | Method and Description |
---|---|
NodeSet<Node> |
attributeAxis(Node node)
Returns a NodeSet with all attribute nodes.
|
NodeSet<Node> |
childAxis(Node node,
boolean reverse)
Returns a NodeSet with all child elements.
|
boolean |
commentTest(Node node)
Returns whether a node is a comment.
|
Comparator<? super Node> |
documentOrder() |
NodeSet<Node> |
followingSiblingAxis(Node node)
Returns a NodeSet with all following sibling elements.
|
URI |
getBaseURI(Node node)
Returns null iff not possible to find out.
|
Node |
getDocument(URI uri)
The xpath core library "document()" function has complicated signatures,
but finally breaks down to load a document from an URI.
|
Node |
getElementById(Node document,
String id)
retrieves an element (or null) by the text value of the ID-type attribute.
|
String |
getLocalName(Node node)
Returns null iff node is neither Element nor Attribute; otherwise the local name.
|
NamespaceName |
getNamespaceName(Node node)
Returns null iff node is neither Element nor Attribute; otherwise the NamespaceName.
|
String |
getNamespaceURI(Node node)
Returns null iff node is neither Element nor Attribute; otherwise the URI the
namespace prefix is bound to.
|
Node |
getParent(Node node)
returns the parent node; null for Document.
|
String |
getPITarget(Node node)
returns the target identifier; may only be called with a PI-node!
|
Document |
getRoot(Node node)
returns the owning Document.
|
boolean |
nameTest(Node node,
PrincipalNodeType pnt,
String uri,
String suffix)
uri and suffix may be ==null, which means "not tested".
|
NodeSet<Node> |
parentAxis(Node node)
Returns a NodeSet with the one direct parent.
|
NodeSet<Node> |
precedingSiblingAxis(Node node)
Returns a NodeSet with all preceding sibling elements.
|
boolean |
processingInstructionTest(Node node,
String target)
Returns whether a node is PI.
|
void |
setMessageReceiver(MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>> msg) |
String |
stringValue(Node node)
Never returns null, but possibly empty String [XPath 1.0:5].
|
void |
stringValue(StringBuilder buf,
Element elem) |
boolean |
textTest(Node node)
Returns whether a node is PCDATA.
|
protected MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>> msg
protected final DocTypes metatools_doc_sources
public void setMessageReceiver(MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>> msg)
public String getLocalName(Node node)
DocumentClient
getLocalName
in interface DocumentClient<Node>
public String getNamespaceURI(Node node)
DocumentClient
getNamespaceURI
in interface DocumentClient<Node>
public NamespaceName getNamespaceName(Node node)
DocumentClient
getNamespaceName
in interface DocumentClient<Node>
public URI getBaseURI(Node node)
getBaseURI
in interface DocumentClient<Node>
public Node getDocument(URI uri)
getDocument
in interface DocumentClient<Node>
public Document getRoot(Node node)
DocumentClient
getRoot
in interface DocumentClient<Node>
public String getPITarget(Node node)
DocumentClient
getPITarget
in interface DocumentClient<Node>
public String stringValue(Node node)
DocumentClient
stringValue
in interface DocumentClient<Node>
public void stringValue(StringBuilder buf, Element elem)
public Comparator<? super Node> documentOrder()
documentOrder
in interface DocumentClient<Node>
public NodeSet<Node> attributeAxis(Node node)
DocumentClient
attributeAxis
in interface DocumentClient<Node>
public NodeSet<Node> childAxis(Node node, boolean reverse)
DocumentClient
childAxis
in interface DocumentClient<Node>
public NodeSet<Node> followingSiblingAxis(Node node)
DocumentClient
followingSiblingAxis
in interface DocumentClient<Node>
public Node getParent(Node node)
DocumentClient
getParent
in interface DocumentClient<Node>
public NodeSet<Node> parentAxis(Node node)
DocumentClient
parentAxis
in interface DocumentClient<Node>
public NodeSet<Node> precedingSiblingAxis(Node node)
DocumentClient
precedingSiblingAxis
in interface DocumentClient<Node>
public boolean nameTest(Node node, PrincipalNodeType pnt, String uri, String suffix)
nameTest
in interface DocumentClient<Node>
public boolean commentTest(Node node)
DocumentClient
commentTest
in interface DocumentClient<Node>
public boolean textTest(Node node)
DocumentClient
textTest
in interface DocumentClient<Node>
public boolean processingInstructionTest(Node node, String target)
DocumentClient
processingInstructionTest
in interface DocumentClient<Node>
public Node getElementById(Node document, String id)
DocumentClient
getElementById
in interface DocumentClient<Node>
see also the complete user documentation .