gpt4 book ai didi

net.sf.saxon.sxpath.XPathStaticContext.setNamespaceResolver()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 23:05:05 26 4
gpt4 key购买 nike

本文整理了Java中net.sf.saxon.sxpath.XPathStaticContext.setNamespaceResolver()方法的一些代码示例,展示了XPathStaticContext.setNamespaceResolver()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPathStaticContext.setNamespaceResolver()方法的具体详情如下:
包路径:net.sf.saxon.sxpath.XPathStaticContext
类名称:XPathStaticContext
方法名:setNamespaceResolver

XPathStaticContext.setNamespaceResolver介绍

[英]Set an external namespace resolver. If this is set, then all resolution of namespace prefixes is delegated to the external namespace resolver, and namespaces declared individually on this IndependentContext object are ignored.
[中]设置外部名称空间解析器。如果设置了此选项,则名称空间前缀的所有解析都将委托给外部名称空间解析程序,并忽略在此独立上下文对象上单独声明的名称空间。

代码示例

代码示例来源:origin: org.opengis.cite.saxon/saxon9

/**
 * Set the external namespace resolver to be used. The NamespaceResolver is stored
 * as part of the static context. It overrides any namespaces declared directly
 * using declareNamespace on the staticContext object
 * @param namespaceResolver The namespace resolver, which maintains a mapping of prefixes to URIs.
 * Any namespace prefix used in the XPath expression is resolved using this namespaceResolver.
 */
public void setNamespaceResolver(NamespaceResolver namespaceResolver) {
  staticContext.setNamespaceResolver(namespaceResolver);
}

代码示例来源:origin: net.sourceforge.saxon/saxon

/**
 * Set the external namespace resolver to be used. The NamespaceResolver is stored
 * as part of the static context. It overrides any namespaces declared directly
 * using declareNamespace on the staticContext object
 * @param namespaceResolver The namespace resolver, which maintains a mapping of prefixes to URIs.
 * Any namespace prefix used in the XPath expression is resolved using this namespaceResolver.
 */
public void setNamespaceResolver(NamespaceResolver namespaceResolver) {
  staticContext.setNamespaceResolver(namespaceResolver);
}

代码示例来源:origin: org.daisy.pipeline/common-utils

public static XPathExpression compileExpression(String expression, Hashtable<String,String> namespaceBindings, Configuration configuration)
    throws XPathException {
  XPathEvaluator xpathEvaluator = new XPathEvaluator(configuration);
  xpathEvaluator.getStaticContext().setNamespaceResolver(new MatchingNamespaceResolver(namespaceBindings));
  return xpathEvaluator.createPattern(expression);
}

代码示例来源:origin: org.daisy.libs/com.xmlcalabash

public int count(XdmNode doc, RuntimeValue match, boolean deep) {
  count = 0;
  try {
    XPathEvaluator xeval = new XPathEvaluator(saxonConfig);
    NamespaceResolver resolver = new MatchingNamespaceResolver(match.getNamespaceBindings());
    xeval.getStaticContext().setNamespaceResolver(resolver);
    matcher = xeval.createPattern(match.getString());
    traverse(doc, deep);
  } catch (XProcException e) {
    throw e;
  } catch (Exception e) {
    throw new XProcException(e);
  }
  return count;
}

代码示例来源:origin: com.xmlcalabash/xmlcalabash

public int count(XdmNode doc, RuntimeValue match, boolean deep) {
  count = 0;
  try {
    XPathEvaluator xeval = new XPathEvaluator(saxonConfig);
    NamespaceResolver resolver = new MatchingNamespaceResolver(match.getNamespaceBindings());
    xeval.getStaticContext().setNamespaceResolver(resolver);
    matcher = xeval.createPattern(match.getString());
    traverse(doc, deep);
  } catch (XProcException e) {
    throw e;
  } catch (Exception e) {
    throw new XProcException(e);
  }
  return count;
}

代码示例来源:origin: org.daisy.libs/com.xmlcalabash

XPathEvaluator xeval = new XPathEvaluator(saxonConfig);
NamespaceResolver resolver = new MatchingNamespaceResolver(match.getNamespaceBindings());
xeval.getStaticContext().setNamespaceResolver(resolver);

代码示例来源:origin: com.xmlcalabash/xmlcalabash

XPathEvaluator xeval = new XPathEvaluator(saxonConfig);
NamespaceResolver resolver = new MatchingNamespaceResolver(match.getNamespaceBindings());
xeval.getStaticContext().setNamespaceResolver(resolver);

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com