Package eu.bandm.tools.tpath.dom
Class DOMClient
java.lang.Object
eu.bandm.tools.tpath.dom.DOMClient
- All Implemented Interfaces:
DocumentClient<Node>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DocTypes
protected MessageReceiver<? super SimpleMessage<XMLDocumentIdentifier>>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionattributeAxis
(Node node) Returns a NodeSet with all attribute nodes.Returns a NodeSet with all child elements.boolean
commentTest
(Node node) Returns whether a node is a comment.Comparator<? super Node>
followingSiblingAxis
(Node node) Returns a NodeSet with all following sibling elements.getBaseURI
(Node node) Returns null iff not possible to find out.getDocument
(URI uri) The xpath core library "document()" function has complicated signatures, but finally breaks down to load a document from an URI.getElementById
(Node document, String id) retrieves an element (or null) by the text value of the ID-type attribute.getLocalName
(Node node) Returns null iff node is neither Element nor Attribute; otherwise the local name.getNamespaceName
(Node node) Returns null iff node is neither Element nor Attribute; otherwise the NamespaceName.getNamespaceURI
(Node node) Returns null iff node is neither Element nor Attribute; otherwise the URI the namespace prefix is bound to.returns the parent node; null for Document.getPITarget
(Node node) returns the target identifier; may only be called with a PI-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".parentAxis
(Node node) Returns a NodeSet with the one direct parent.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) void
stringValue
(StringBuilder buf, Element elem) stringValue
(Node node) Never returns null, but possibly empty String [XPath 1.0:5].boolean
Returns whether a node is PCDATA.
-
Field Details
-
msg
-
emptyNodeSet
-
emptyNodeSetReverse
-
documentCache
-
metatools_doc_sources
-
-
Constructor Details
-
DOMClient
public DOMClient()
-
-
Method Details
-
setMessageReceiver
-
getLocalName
Description copied from interface:DocumentClient
Returns null iff node is neither Element nor Attribute; otherwise the local name. This is the part after the colon ":" in namspace mode; otherwise the whole name. May be called with any node.- Specified by:
getLocalName
in interfaceDocumentClient<Node>
-
getNamespaceURI
Description copied from interface:DocumentClient
Returns null iff node is neither Element nor Attribute; otherwise the URI the namespace prefix is bound to. May be called with any node.- Specified by:
getNamespaceURI
in interfaceDocumentClient<Node>
-
getNamespaceName
Description copied from interface:DocumentClient
Returns null iff node is neither Element nor Attribute; otherwise the NamespaceName. May be called with any node.- Specified by:
getNamespaceName
in interfaceDocumentClient<Node>
-
getBaseURI
Returns null iff not possible to find out.- Specified by:
getBaseURI
in interfaceDocumentClient<Node>
-
getDocument
The xpath core library "document()" function has complicated signatures, but finally breaks down to load a document from an URI. This implementation needs any fragment id to be stripped, i.e. loads only COMPLETE documents (which can be inadequate for very large text bodies!-)
The parser is in NON-validating mode, because no DTD/schema is accessible.- Specified by:
getDocument
in interfaceDocumentClient<Node>
-
getRoot
Description copied from interface:DocumentClient
returns the owning Document. May be called with any node.- Specified by:
getRoot
in interfaceDocumentClient<Node>
-
getPITarget
Description copied from interface:DocumentClient
returns the target identifier; may only be called with a PI-node!- Specified by:
getPITarget
in interfaceDocumentClient<Node>
-
stringValue
Description copied from interface:DocumentClient
Never returns null, but possibly empty String [XPath 1.0:5]. May be called with any node.- Specified by:
stringValue
in interfaceDocumentClient<Node>
-
stringValue
-
documentOrder
- Specified by:
documentOrder
in interfaceDocumentClient<Node>
-
attributeAxis
Description copied from interface:DocumentClient
Returns a NodeSet with all attribute nodes. Is an empty set for all nodes which are not elements. May be called with any node.- Specified by:
attributeAxis
in interfaceDocumentClient<Node>
-
childAxis
Description copied from interface:DocumentClient
Returns a NodeSet with all child elements. FIXME STIMMT DAS ALLES ??- Specified by:
childAxis
in interfaceDocumentClient<Node>
-
followingSiblingAxis
Description copied from interface:DocumentClient
Returns a NodeSet with all following sibling elements. May be called with any node.- Specified by:
followingSiblingAxis
in interfaceDocumentClient<Node>
-
getParent
Description copied from interface:DocumentClient
returns the parent node; null for Document. May be called with any node.- Specified by:
getParent
in interfaceDocumentClient<Node>
-
parentAxis
Description copied from interface:DocumentClient
Returns a NodeSet with the one direct parent. May be called with any node.- Specified by:
parentAxis
in interfaceDocumentClient<Node>
-
precedingSiblingAxis
Description copied from interface:DocumentClient
Returns a NodeSet with all preceding sibling elements. May be called with any node.- Specified by:
precedingSiblingAxis
in interfaceDocumentClient<Node>
-
nameTest
uri and suffix may be ==null, which means "not tested". This is different from being the empty String.- Specified by:
nameTest
in interfaceDocumentClient<Node>
-
commentTest
Description copied from interface:DocumentClient
Returns whether a node is a comment. May be called with any node.- Specified by:
commentTest
in interfaceDocumentClient<Node>
-
textTest
Description copied from interface:DocumentClient
Returns whether a node is PCDATA. May be called with any node.- Specified by:
textTest
in interfaceDocumentClient<Node>
-
processingInstructionTest
Description copied from interface:DocumentClient
Returns whether a node is PI. target==null: returns true if node is any process instruction.
target!=null: returns true if node is a process instruction for this special target.
May be called with any node.- Specified by:
processingInstructionTest
in interfaceDocumentClient<Node>
-
getElementById
Description copied from interface:DocumentClient
retrieves an element (or null) by the text value of the ID-type attribute. Each Element may define 0 or 1 of this attribute.- Specified by:
getElementById
in interfaceDocumentClient<Node>
-