gpt4 book ai didi

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

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

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

XPathStaticContext.getStackFrameMap介绍

[英]Get a Stack Frame Map containing definitions of all the declared variables. This will return a newly created object that the caller is free to modify by adding additional variables, without affecting the static context itself.
[中]获取包含所有声明变量定义的堆栈帧映射。这将返回一个新创建的对象,调用者可以通过添加其他变量自由修改该对象,而不会影响静态上下文本身。

代码示例

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

/**
 * Prepare (compile) an XSLT pattern for subsequent evaluation. The result is an XPathExpression
 * object representing a (pseudo-) expression that when evaluated returns a boolean result: true
 * if the context node matches the pattern, false if it does not.
 * @param pattern the XSLT pattern to be compiled, supplied as a string
 * @return an XPathExpression object representing the pattern, wrapped as an expression
 * @throws XPathException if the syntax of the expression is wrong, or if it references namespaces,
 * variables, or functions that have not been declared.
 * @since 9.1
 */
public XPathExpression createPattern(String pattern) throws XPathException {
  Pattern pat = Pattern.make(pattern, staticContext, staticContext.getExecutable());
  ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
  pat.analyze(visitor, Type.NODE_TYPE);
  SlotManager map = staticContext.getStackFrameMap();
  int slots = map.getNumberOfVariables();
  slots = pat.allocateSlots(staticContext, map, slots);
  PatternSponsor sponsor = new PatternSponsor(pat);
  XPathExpression xpe = new XPathExpression(this, sponsor);
  xpe.setStackFrameMap(map, slots);
  return xpe;
}

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

/**
* Prepare (compile) an XPath expression for subsequent evaluation.
* @param expression The XPath expression to be compiled, supplied as a string.
* @return an XPathExpression object representing the prepared expression
* @throws XPathException if the syntax of the expression is wrong, or if it references namespaces,
* variables, or functions that have not been declared.
*/
public XPathExpression createExpression(String expression) throws XPathException {
  Expression exp = ExpressionTool.make(expression, staticContext, 0, -1, 1, false);
  exp.setContainer(staticContext);
  ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
  visitor.setExecutable(getExecutable());
  exp = visitor.typeCheck(exp, Type.ITEM_TYPE);
  SlotManager map = staticContext.getStackFrameMap();
  int numberOfExternalVariables = map.getNumberOfVariables();
  ExpressionTool.allocateSlots(exp, numberOfExternalVariables, map);
  XPathExpression xpe = new XPathExpression(this, exp);
  xpe.setStackFrameMap(map, numberOfExternalVariables);
  return xpe;
}

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

/**
* Prepare (compile) an XPath expression for subsequent evaluation.
* @param expression The XPath expression to be compiled, supplied as a string.
* @return an XPathExpression object representing the prepared expression
* @throws XPathException if the syntax of the expression is wrong, or if it references namespaces,
* variables, or functions that have not been declared.
*/
public XPathExpression createExpression(String expression) throws XPathException {
  Expression exp = ExpressionTool.make(expression, staticContext, 0, -1, 1, false);
  exp.setContainer(staticContext);
  ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
  visitor.setExecutable(getExecutable());
  exp = visitor.typeCheck(exp, Type.ITEM_TYPE);
  exp = visitor.optimize(exp, Type.ITEM_TYPE);
  SlotManager map = staticContext.getStackFrameMap();
  int numberOfExternalVariables = map.getNumberOfVariables();
  ExpressionTool.allocateSlots(exp, numberOfExternalVariables, map);
  XPathExpression xpe = new XPathExpression(this, exp);
  xpe.setStackFrameMap(map, numberOfExternalVariables);
  return xpe;
}

代码示例来源:origin: net.sf.saxon/Saxon-HE

/**
 * Prepare (compile) an XSLT pattern for subsequent evaluation. The result is an XPathExpression
 * object representing a (pseudo-) expression that when evaluated returns a boolean result: true
 * if the context node matches the pattern, false if it does not.
 *
 * @param pattern the XSLT pattern to be compiled, supplied as a string
 * @return an XPathExpression object representing the pattern, wrapped as an expression
 * @throws XPathException if the syntax of the expression is wrong, or if it references namespaces,
 *                        variables, or functions that have not been declared.
 * @since 9.1
 */
/*@NotNull*/
public XPathExpression createPattern(String pattern) throws XPathException {
  Configuration config = getConfiguration();
  Executable exec = new Executable(config);
  Pattern pat = Pattern.make(pattern, staticContext, new PackageData(config));
  ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
  pat.typeCheck(visitor, config.makeContextItemStaticInfo(Type.NODE_TYPE, true));
  SlotManager map = staticContext.getStackFrameMap();
  int slots = map.getNumberOfVariables();
  slots = pat.allocateSlots(map, slots);
  //PatternSponsor sponsor = new PatternSponsor(pat);
  XPathExpression xpe = new XPathExpression(staticContext, pat, exec);
  xpe.setStackFrameMap(map, slots);
  return xpe;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

/**
 * Prepare (compile) an XSLT pattern for subsequent evaluation. The result is an XPathExpression
 * object representing a (pseudo-) expression that when evaluated returns a boolean result: true
 * if the context node matches the pattern, false if it does not.
 *
 * @param pattern the XSLT pattern to be compiled, supplied as a string
 * @return an XPathExpression object representing the pattern, wrapped as an expression
 * @throws XPathException if the syntax of the expression is wrong, or if it references namespaces,
 *                        variables, or functions that have not been declared.
 * @since 9.1
 */
/*@NotNull*/
public XPathExpression createPattern(String pattern) throws XPathException {
  Configuration config = getConfiguration();
  Executable exec = new Executable(config);
  Pattern pat = Pattern.make(pattern, staticContext, new PackageData(config));
  ExpressionVisitor visitor = ExpressionVisitor.make(staticContext);
  pat.typeCheck(visitor, config.makeContextItemStaticInfo(Type.NODE_TYPE, true));
  SlotManager map = staticContext.getStackFrameMap();
  int slots = map.getNumberOfVariables();
  slots = pat.allocateSlots(map, slots);
  //PatternSponsor sponsor = new PatternSponsor(pat);
  XPathExpression xpe = new XPathExpression(staticContext, pat, exec);
  xpe.setStackFrameMap(map, slots);
  return xpe;
}

代码示例来源:origin: net.sf.saxon/Saxon-HE

SlotManager map = staticContext.getStackFrameMap();
int numberOfExternalVariables = map.getNumberOfVariables();
ExpressionTool.allocateSlots(exp, numberOfExternalVariables, map);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.saxon

SlotManager map = staticContext.getStackFrameMap();
int numberOfExternalVariables = map.getNumberOfVariables();
ExpressionTool.allocateSlots(exp, numberOfExternalVariables, map);

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