|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xpath.DOMHelper org.apache.xpath.DOM2Helper
Field Summary | |
private org.w3c.dom.Document |
m_doc
Deprecated. Field m_doc: Document Node for the document this helper is currently accessing or building |
Fields inherited from class org.apache.xpath.DOMHelper |
m_candidateNoAncestorXMLNS, m_DOMFactory, m_NSInfoNullNoAncestorXMLNS, m_NSInfoNullWithoutXMLNS, m_NSInfoNullWithXMLNS, m_NSInfos, m_NSInfoUnProcNoAncestorXMLNS, m_NSInfoUnProcWithoutXMLNS, m_NSInfoUnProcWithXMLNS |
Constructor Summary | |
DOM2Helper()
Deprecated. Construct an instance. |
Method Summary | |
void |
checkNode(org.w3c.dom.Node node)
Deprecated. Check node to see if it was created by a DOM implementation that this helper is intended to support. |
org.w3c.dom.Document |
getDocument()
Deprecated. Query which document this helper is currently operating on. |
org.w3c.dom.Element |
getElementByID(String id,
org.w3c.dom.Document doc)
Deprecated. Given an XML ID, return the element. |
String |
getLocalNameOfNode(org.w3c.dom.Node n)
Deprecated. Returns the local name of the given node, as defined by the XML Namespaces specification. |
String |
getNamespaceOfNode(org.w3c.dom.Node n)
Deprecated. Returns the Namespace Name (Namespace URI) for the given node. |
static org.w3c.dom.Node |
getParentOfNode(org.w3c.dom.Node node)
Deprecated. Get the XPath-model parent of a node. |
static boolean |
isNodeAfter(org.w3c.dom.Node node1,
org.w3c.dom.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(org.xml.sax.InputSource source)
Deprecated. Parse an XML document. |
void |
setDocument(org.w3c.dom.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. |
Methods inherited from class org.apache.xpath.DOMHelper |
createDocument, getDOMFactory, getExpandedAttributeName, getExpandedElementName, getLevel, getNamespaceForPrefix, getNodeData, getNodeData, getRoot, getRootNode, getUniqueID, getUnparsedEntityURI, isIgnorableWhitespace, isNamespaceNode, isNodeTheSame, setDOMFactory, shouldStripSourceNode |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private org.w3c.dom.Document m_doc
setDocument(org.w3c.dom.Document)
,
getDocument()
Constructor Detail |
public DOM2Helper()
Method Detail |
public void checkNode(org.w3c.dom.Node node) throws javax.xml.transform.TransformerException
node
- The node to be tested.
javax.xml.transform.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(org.w3c.dom.Document doc)
doc
- The DOM Document node for this document.getDocument()
public org.w3c.dom.Document getDocument()
setDocument(org.w3c.dom.Document)
public void parse(org.xml.sax.InputSource source) throws javax.xml.transform.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.
javax.xml.transform.TransformerException
- if any checked exception is thrown.public org.w3c.dom.Element getElementByID(String id, org.w3c.dom.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(org.w3c.dom.Node node1, org.w3c.dom.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 org.w3c.dom.Node getParentOfNode(org.w3c.dom.Node node)
node
- Node to be examined
public String getLocalNameOfNode(org.w3c.dom.Node n)
getLocalNameOfNode
in class DOMHelper
n
- Node to be examined
public String getNamespaceOfNode(org.w3c.dom.Node n)
TODO: Reconcile with getLocalNameOfNode.
getNamespaceOfNode
in class DOMHelper
n
- Node to be examined
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |