| 
 | Oracle® WebCenter Content Site Studio for External Applications Java API Reference 11g Release 1 (11.1.1) E17273-03 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
   oracle.stellent.wcm.common.xml.XPathEvaluator
oracle.stellent.wcm.common.xml.XPathEvaluator
public class XPathEvaluator
Parses an XML file from a given inputstream. Wraps calls into the XPath API.
| Field Summary | |
|---|---|
| protected  org.w3c.dom.Node | m_contextNode | 
| protected  java.lang.String | m_defaultPrefix | 
| protected  org.w3c.dom.Element | m_documentRoot | 
| protected  javax.xml.namespace.NamespaceContext | m_namespaceContext | 
| protected  javax.xml.xpath.XPath | m_xpath | 
| Constructor Summary | |
|---|---|
| XPathEvaluator(org.w3c.dom.Element rootElement)Initialize an Evaluator object based on the current element as the root | |
| XPathEvaluator(org.w3c.dom.Element rootElement, javax.xml.namespace.NamespaceContext namespaceContext)Initialize an Evaluator object based on the current element as the root | |
| XPathEvaluator(org.xml.sax.InputSource xmlSource, javax.xml.namespace.NamespaceContext namespaceContext, boolean validating, java.lang.String defaultPrefix)Builds a new XPath evaluator from an InputSource. | |
| XPathEvaluator(java.io.InputStream xmlStream)Builds an XPathEvaluator with no namespace evaluator and non-validating, using "wcm" as the default namespace prefix. | |
| XPathEvaluator(java.io.InputStream xmlStream, javax.xml.namespace.NamespaceContext namespaceContext, boolean validating, java.lang.String defaultPrefix)Builds a new XPath evaluator from InputStream. | |
| XPathEvaluator(java.io.Reader xmlReader) | |
| XPathEvaluator(java.io.Reader xmlReader, javax.xml.namespace.NamespaceContext namespaceContext, boolean validating, java.lang.String defaultPrefix)Builds a new XPath evaluator from a Reader. | |
| Method Summary | |
|---|---|
| protected  javax.xml.xpath.XPathExpression | compileXPathExpression(java.lang.String xpath) | 
|  org.w3c.dom.Node | evaluateToNode(java.lang.String xpath)Evaluate the xpath expression; return the result as a Node | 
|  org.w3c.dom.NodeList | evaluateToNodeList(java.lang.String xpath)Evaluate the xpath expression; return the result as a NodeList | 
|  java.lang.String | evaluateToString(java.lang.String xpath)Evaluate the xpath expression; return the result as a String. | 
| protected  java.lang.Object | evaluateXPath(java.lang.String xpath, javax.xml.namespace.QName returnType) | 
|  org.w3c.dom.Node | getContextNode() | 
|  org.w3c.dom.Node | getElementById(java.lang.String id)Retrieve an element by ID. | 
|  javax.xml.namespace.NamespaceContext | getNamespaceContext() | 
|  org.w3c.dom.Element | getRootNode() | 
| protected  javax.xml.xpath.XPath | getXPath() | 
| protected  void | initNamespaceContext(javax.xml.namespace.NamespaceContext namespaceContext)Initialize the namespace context. | 
|  void | resetContext()Reset the context to the root node | 
|  void | setContextNode(org.w3c.dom.Node node)Set the context of the queries | 
|  void | setContextNode(java.lang.String xpath)Set the context of the queries to be the result of the given xpath expression | 
|  void | setIdAttribute(java.lang.String attribute, boolean enable)Set the ID attribute feature against this DOM tree | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
protected javax.xml.namespace.NamespaceContext m_namespaceContext
protected org.w3c.dom.Element m_documentRoot
protected javax.xml.xpath.XPath m_xpath
protected org.w3c.dom.Node m_contextNode
protected java.lang.String m_defaultPrefix
| Constructor Detail | 
|---|
public XPathEvaluator(org.w3c.dom.Element rootElement)
rootElement - the root of all xpath queries
public XPathEvaluator(org.w3c.dom.Element rootElement,
                      javax.xml.namespace.NamespaceContext namespaceContext)
rootElement - the root of all xpath queriesnamespaceContext - the namespace context to use
public XPathEvaluator(java.io.InputStream xmlStream)
               throws XPathEvaluatorException
xmlStream - the stream to the xml file contentsXPathEvaluatorException
public XPathEvaluator(java.io.InputStream xmlStream,
                      javax.xml.namespace.NamespaceContext namespaceContext,
                      boolean validating,
                      java.lang.String defaultPrefix)
               throws XPathEvaluatorException
xmlStream - the stream to the xml file contentsnamespaceContext - (optional) the namespace resolvervalidating - true to set the parser to validatingdefaultPrefix - the prefix to use for querying in the default namespaceXPathEvaluatorException
public XPathEvaluator(java.io.Reader xmlReader)
               throws XPathEvaluatorException
XPathEvaluatorException
public XPathEvaluator(java.io.Reader xmlReader,
                      javax.xml.namespace.NamespaceContext namespaceContext,
                      boolean validating,
                      java.lang.String defaultPrefix)
               throws XPathEvaluatorException
xmlReader - the reader to the xml file contentsnamespaceContext - (optional) the namespace resolvervalidating - true to set the parser to validatingdefaultPrefix - the prefix to use for querying in the default namespaceXPathEvaluatorException
public XPathEvaluator(org.xml.sax.InputSource xmlSource,
                      javax.xml.namespace.NamespaceContext namespaceContext,
                      boolean validating,
                      java.lang.String defaultPrefix)
               throws XPathEvaluatorException
xmlSource - the inputSource to the xml file contentsnamespaceContext - (optional) the namespace resolvervalidating - true to set the parser to validatingdefaultPrefix - the prefix to use for querying in the default namespaceXPathEvaluatorException| Method Detail | 
|---|
protected void initNamespaceContext(javax.xml.namespace.NamespaceContext namespaceContext)
namespaceContext - the namespace context or null to use the defaultpublic javax.xml.namespace.NamespaceContext getNamespaceContext()
public void setIdAttribute(java.lang.String attribute,
                           boolean enable)
attribute - the attribute to declare as the DOM ID attributeenable - true to enable this attribute, false to disable the ID functionalitypublic org.w3c.dom.Node getElementById(java.lang.String id)
setIdAttribute(String, boolean) to enable the ID attribute functionality.id - the ID to querypublic void setContextNode(org.w3c.dom.Node node)
node - the context nodepublic void setContextNode(java.lang.String xpath)
xpath - the xpath to the root for the queriespublic org.w3c.dom.Node getContextNode()
public org.w3c.dom.Element getRootNode()
public void resetContext()
public java.lang.String evaluateToString(java.lang.String xpath)
xpath - the xpath expression from the current context rootpublic org.w3c.dom.Node evaluateToNode(java.lang.String xpath)
xpath - the xpath expression from the current context rootpublic org.w3c.dom.NodeList evaluateToNodeList(java.lang.String xpath)
xpath - the xpath expression from the current context root
protected java.lang.Object evaluateXPath(java.lang.String xpath,
                                         javax.xml.namespace.QName returnType)
protected javax.xml.xpath.XPathExpression compileXPathExpression(java.lang.String xpath)
                                                          throws XPathEvaluatorException
XPathEvaluatorExceptionprotected javax.xml.xpath.XPath getXPath()
| 
 | Oracle® WebCenter Content Site Studio for External Applications Java API Reference 11g Release 1 (11.1.1) E17273-03 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||