当前位置: 首页>>代码示例>>Java>>正文


Java XPathEvaluator类代码示例

本文整理汇总了Java中org.w3c.dom.xpath.XPathEvaluator的典型用法代码示例。如果您正苦于以下问题:Java XPathEvaluator类的具体用法?Java XPathEvaluator怎么用?Java XPathEvaluator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


XPathEvaluator类属于org.w3c.dom.xpath包,在下文中一共展示了XPathEvaluator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getXPathEvaluator

import org.w3c.dom.xpath.XPathEvaluator; //导入依赖的package包/类
XPathEvaluator getXPathEvaluator(Document doc)
  throws XMLStreamException
{
  DOMImplementation dom = doc.getImplementation();
  if (!dom.hasFeature("XPath", "3.0"))
    throw new XMLStreamException("XPath not supported");
  return (XPathEvaluator) doc;
}
 
开发者ID:vilie,项目名称:javify,代码行数:9,代码来源:XIncludeFilter.java

示例2: createEvaluator

import org.w3c.dom.xpath.XPathEvaluator; //导入依赖的package包/类
public static final native XPathEvaluator createEvaluator() /*-{
	return new XPathEvaluator();
}-*/;
 
开发者ID:xose,项目名称:gwt-xml,代码行数:4,代码来源:XPathUtils.java

示例3: fromDocument

import org.w3c.dom.xpath.XPathEvaluator; //导入依赖的package包/类
public static final native XPathEvaluator fromDocument(Document doc) /*-{
	return doc;
}-*/;
 
开发者ID:xose,项目名称:gwt-xml,代码行数:4,代码来源:XPathUtils.java

示例4: test5

import org.w3c.dom.xpath.XPathEvaluator; //导入依赖的package包/类
public void test5() {
	XPathEvaluator eval = XPathUtils.createEvaluator();
	ASSERT.that(eval).isNotNull();
}
 
开发者ID:xose,项目名称:gwt-xml,代码行数:5,代码来源:NodeTestGwt.java

示例5: compileXQExpr

import org.w3c.dom.xpath.XPathEvaluator; //导入依赖的package包/类
/**
 * Take the received string, which is an XML query expression,
 * compile it, and store the compiled query locally.  Note
 * that for now, we only support XPath because that's what
 * Xalan supports.
 *
 * @param queryExpr The XPath expression to compile
 */
public void compileXQExpr(String queryExpr, String opName)
    throws StandardException
{
    try {

        /* The following XPath constructor compiles the expression
         * as part of the construction process.  We pass a null
         * namespace resolver object so that the implementation will
         * provide one for us, which means prefixes will not be resolved
         * in the query (Xalan will just throw an error if a prefix
         * is used).  In the future we may want to revisit this
         * to make it easier for users to query based on namespaces.
         */
        XPathEvaluator eval = (XPathEvaluator)
            dBuilder.getDOMImplementation().getFeature("+XPath", "3.0");
        query = eval.createExpression(queryExpr, null);

        this.queryExpr = queryExpr;
        this.opName = opName;
        this.recompileQuery = false;

    } catch (Throwable te) {

        /* Something went wrong during compilation of the
         * expression; wrap the error and re-throw it.
         * Note: we catch "Throwable" here to catch as many
         * Xalan-produced errors as possible in order to
         * minimize the chance of an uncaught Xalan error
         * (such as a NullPointerException) causing Derby
         * to fail in a more serious way.  In particular, an
         * uncaught Java exception like NPE can result in
         * Derby throwing "ERROR 40XT0: An internal error was
         * identified by RawStore module" for all statements on
         * the connection after the failure--which we clearly
         * don't want.  If we catch the error and wrap it,
         * though, the statement will fail but Derby will
         * continue to run as normal. 
         */
        throw StandardException.newException(
            SQLState.LANG_XML_QUERY_ERROR, te, opName, te.getMessage());

    }
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:52,代码来源:SqlXmlUtil.java


注:本文中的org.w3c.dom.xpath.XPathEvaluator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。