public class DOM2Helper extends DOMHelper
m_candidateNoAncestorXMLNS, m_DOMFactory, m_NSInfoNullNoAncestorXMLNS, m_NSInfoNullWithoutXMLNS, m_NSInfoNullWithXMLNS, m_NSInfoUnProcNoAncestorXMLNS, m_NSInfoUnProcWithoutXMLNS, m_NSInfoUnProcWithXMLNS
Constructor and Description |
---|
DOM2Helper()
Deprecated.
Construct an instance.
|
Modifier and Type | Method and Description |
---|---|
void |
checkNode(Node node)
Deprecated.
Check node to see if it was created by a DOM implementation
that this helper is intended to support.
|
Document |
getDocument()
Deprecated.
Query which document this helper is currently operating on.
|
Element |
getElementByID(String id,
Document doc)
Deprecated.
Given an XML ID, return the element.
|
String |
getLocalNameOfNode(Node n)
Deprecated.
Returns the local name of the given node, as defined by the
XML Namespaces specification.
|
String |
getNamespaceOfNode(Node n)
Deprecated.
Returns the Namespace Name (Namespace URI) for the given node.
|
static Node |
getParentOfNode(Node node)
Deprecated.
Get the XPath-model parent of a node.
|
static boolean |
isNodeAfter(Node node1,
Node node2)
Deprecated.
Figure out whether node2 should be considered as being later
in the document than node1, in Document Order as defined
by the XPath model.
|
void |
parse(InputSource source)
Deprecated.
Parse an XML document.
|
void |
setDocument(Document doc)
Deprecated.
Specify which document this helper is currently operating on.
|
boolean |
supportsSAX()
Deprecated.
Returns true if the DOM implementation handled by this helper
supports the SAX ContentHandler interface.
|
createDocument, createDocument, getDOMFactory, getExpandedAttributeName, getExpandedElementName, getLevel, getNamespaceForPrefix, getNodeData, getNodeData, getRoot, getRootNode, getUniqueID, getUnparsedEntityURI, isIgnorableWhitespace, isNamespaceNode, isNodeTheSame, setDOMFactory, shouldStripSourceNode
public void checkNode(Node node) throws TransformerException
node
- The node to be tested.TransformerException
- if the node is not one which this
DOM2Helper can support. If we return without throwing the exception,
the node is compatable.public boolean supportsSAX()
public void setDocument(Document doc)
doc
- The DOM Document node for this document.getDocument()
public Document getDocument()
setDocument(org.w3c.dom.Document)
public void parse(InputSource source) throws TransformerException
Right now the Xerces DOMParser class is used. This needs fixing, either via jaxp, or via some other, standard method.
The application can use this method to instruct the SAX parser to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).
Applications may not invoke this method while a parse is in progress (they should create a new Parser instead for each additional XML document). Once a parse is complete, an application may reuse the same Parser object, possibly with a different input source.
source
- The input source for the top-level of the
XML document.TransformerException
- if any checked exception is thrown.public Element getElementByID(String id, Document doc)
getElementByID
in class DOMHelper
id
- The ID to search for, as a String.doc
- The document to search within, as a DOM Document node.public static boolean isNodeAfter(Node node1, Node node2)
There are some cases where ordering isn't defined, and neither are the results of this function -- though we'll generally return true.
TODO: Make sure this does the right thing with attribute nodes!!!
node1
- DOM Node to perform position comparison on.node2
- DOM Node to perform position comparison on .(node1.documentOrderPosition <= node2.documentOrderPosition)
.public static Node getParentOfNode(Node node)
node
- Node to be examinedpublic String getLocalNameOfNode(Node n)
getLocalNameOfNode
in class DOMHelper
n
- Node to be examinedpublic String getNamespaceOfNode(Node n)
TODO: Reconcile with getLocalNameOfNode.
getNamespaceOfNode
in class DOMHelper
n
- Node to be examinedCopyright © 2017 JBoss by Red Hat. All rights reserved.