gpt4 book ai didi

net.sf.saxon.expr.XPathContextMajor.setLocalParameters()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 19:23:40 25 4
gpt4 key购买 nike

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

XPathContextMajor.setLocalParameters介绍

[英]Set the local parameters for the current template call.
[中]为当前模板调用设置本地参数。

代码示例

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

public TailCall processLeavingTail(XPathContext context) throws XPathException {
  XPathContextMajor cm = (XPathContextMajor)context;
  ParameterSet params = assembleParams(context, actualParams);
  cm.setLocalParameters(params);
  cm.requestTailCall(continueFunction, emptyArgs);
  return null;
}

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

/**
  * Process the template call encapsulated by this package.
  * @return another TailCall. This will never be the original call, but it may be the next
  * recursive call. For example, if A calls B which calls C which calls D, then B may return
  * a TailCall to A representing the call from B to C; when this is processed, the result may be
  * a TailCall representing the call from C to D.
   * @throws XPathException if a dynamic error occurs
  */
  public TailCall processLeavingTail() throws XPathException {
    // TODO: the idea of tail call optimization is to reuse the caller's stack frame rather than
    // creating a new one. We're doing this for the Java stack, but not for the context stack where
    // local variables are held. It should be possible to avoid creating a new context, and instead
    // to update the existing one in situ.
    XPathContextMajor c2 = evaluationContext.newContext();
    c2.setOrigin(CallTemplate.this);
    c2.setLocalParameters(params);
    c2.setTunnelParameters(tunnelParams);
    c2.openStackFrame(target.getStackFrameMap());
    // System.err.println("Tail call on template");
    return target.expand(c2);
  }
}

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

/**
  * Process the template call encapsulated by this package.
  * @return another TailCall. This will never be the original call, but it may be the next
  * recursive call. For example, if A calls B which calls C which calls D, then B may return
  * a TailCall to A representing the call from B to C; when this is processed, the result may be
  * a TailCall representing the call from C to D.
   * @throws XPathException if a dynamic error occurs
  */
  public TailCall processLeavingTail() throws XPathException {
    // TODO: the idea of tail call optimization is to reuse the caller's stack frame rather than
    // creating a new one. We're doing this for the Java stack, but not for the context stack where
    // local variables are held. It should be possible to avoid creating a new context, and instead
    // to update the existing one in situ.
    XPathContextMajor c2 = evaluationContext.newContext();
    c2.setOrigin(instruction);
    c2.setLocalParameters(params);
    c2.setTunnelParameters(tunnelParams);
    c2.openStackFrame(target.getStackFrameMap());
    // System.err.println("Tail call on template");
    return target.expand(c2);
  }
}

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

/**
  * Process the template call encapsulated by this package.
  * @return another TailCall. This will never be the original call, but it may be the next
  * recursive call. For example, if A calls B which calls C which calls D, then B may return
  * a TailCall to A representing the call from B to C; when this is processed, the result may be
  * a TailCall representing the call from C to D.
   * @throws XPathException if a dynamic error occurs
  */
  public TailCall processLeavingTail() throws XPathException {
    Template nh = (Template)rule.getAction();
    XPathContextMajor c2 = evaluationContext.newContext();
    c2.setOrigin(NextMatch.this);
    c2.setLocalParameters(params);
    c2.setTunnelParameters(tunnelParams);
    c2.openStackFrame(nh.getStackFrameMap());
    // System.err.println("Tail call on template");
    return nh.applyLeavingTail(c2, rule);
  }
}

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

/**
   * Process the template call encapsulated by this package.
   *
   * @return another TailCall. This will never be the original call, but it may be the next
   *         recursive call. For example, if A calls B which calls C which calls D, then B may return
   *         a TailCall to A representing the call from B to C; when this is processed, the result may be
   *         a TailCall representing the call from C to D.
   * @throws XPathException if a dynamic error occurs
   */
  public TailCall processLeavingTail() throws XPathException {
    // TODO: the idea of tail call optimization is to reuse the caller's stack frame rather than
    // creating a new one. We're doing this for the Java stack, but not for the context stack where
    // local variables are held. It should be possible to avoid creating a new context, and instead
    // to update the existing one in situ.
    NamedTemplate template = (NamedTemplate)targetComponent.getActor();
    XPathContextMajor c2 = evaluationContext.newContext();
    c2.setCurrentComponent(targetComponent);
    c2.setOrigin(instruction);
    c2.setLocalParameters(params);
    c2.setTunnelParameters(tunnelParams);
    c2.openStackFrame(template.getStackFrameMap());
    // System.err.println("Tail call on template");
    return template.expand(c2);
  }
}

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

/**
   * Process the template call encapsulated by this package.
   *
   * @return another TailCall. This will never be the original call, but it may be the next
   *         recursive call. For example, if A calls B which calls C which calls D, then B may return
   *         a TailCall to A representing the call from B to C; when this is processed, the result may be
   *         a TailCall representing the call from C to D.
   * @throws XPathException if a dynamic error occurs
   */
  public TailCall processLeavingTail() throws XPathException {
    // TODO: the idea of tail call optimization is to reuse the caller's stack frame rather than
    // creating a new one. We're doing this for the Java stack, but not for the context stack where
    // local variables are held. It should be possible to avoid creating a new context, and instead
    // to update the existing one in situ.
    NamedTemplate template = (NamedTemplate)targetComponent.getActor();
    XPathContextMajor c2 = evaluationContext.newContext();
    c2.setCurrentComponent(targetComponent);
    c2.setOrigin(instruction);
    c2.setLocalParameters(params);
    c2.setTunnelParameters(tunnelParams);
    c2.openStackFrame(template.getStackFrameMap());
    // System.err.println("Tail call on template");
    return template.expand(c2);
  }
}

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

/**
   * Process the template call encapsulated by this package.
   *
   * @return another TailCall. This will never be the original call, but it may be the next
   *         recursive call. For example, if A calls B which calls C which calls D, then B may return
   *         a TailCall to A representing the call from B to C; when this is processed, the result may be
   *         a TailCall representing the call from C to D.
   * @throws XPathException if a dynamic error occurs
   */
  public TailCall processLeavingTail() throws XPathException {
    TemplateRule nh = (TemplateRule) rule.getAction();
    nh.initialize();
    XPathContextMajor c2 = evaluationContext.newContext();
    c2.setOrigin(NextMatch.this);
    //c2.setOriginatingConstructType(LocationKind.TEMPLATE);
    c2.setLocalParameters(params);
    c2.setTunnelParameters(tunnelParams);
    c2.openStackFrame(nh.getStackFrameMap());
    c2.setCurrentTemplateRule(rule);
    c2.setCurrentComponent(evaluationContext.getCurrentComponent());
    // System.err.println("Tail call on template");
    return nh.applyLeavingTail(c2);
  }
}

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

/**
   * Process the template call encapsulated by this package.
   *
   * @return another TailCall. This will never be the original call, but it may be the next
   *         recursive call. For example, if A calls B which calls C which calls D, then B may return
   *         a TailCall to A representing the call from B to C; when this is processed, the result may be
   *         a TailCall representing the call from C to D.
   * @throws XPathException if a dynamic error occurs
   */
  public TailCall processLeavingTail() throws XPathException {
    TemplateRule nh = (TemplateRule) rule.getAction();
    nh.initialize();
    XPathContextMajor c2 = evaluationContext.newContext();
    c2.setOrigin(NextMatch.this);
    //c2.setOriginatingConstructType(LocationKind.TEMPLATE);
    c2.setLocalParameters(params);
    c2.setTunnelParameters(tunnelParams);
    c2.openStackFrame(nh.getStackFrameMap());
    c2.setCurrentTemplateRule(rule);
    c2.setCurrentComponent(evaluationContext.getCurrentComponent());
    // System.err.println("Tail call on template");
    return nh.applyLeavingTail(c2);
  }
}

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

/**
 * Process this instruction, without leaving any tail calls.
 * @param context the dynamic context for this transformation
 * @throws XPathException if a dynamic error occurs
 */
public void process(XPathContext context) throws XPathException {
  Template t = getTargetTemplate(context);
  XPathContextMajor c2 = context.newContext();
  c2.setOrigin(this);
  c2.openStackFrame(t.getStackFrameMap());
  c2.setLocalParameters(assembleParams(context, actualParams));
  c2.setTunnelParameters(assembleTunnelParams(context, tunnelParams));
  try {
    TailCall tc = t.expand(c2);
    while (tc != null) {
      tc = tc.processLeavingTail();
    }
  } catch (StackOverflowError e) {
    XPathException err = new XPathException("Too many nested template or function calls. The stylesheet may be looping.");
    err.setLocator(this);
    err.setXPathContext(context);
    throw err;
  }
}

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

/**
 * Process this instruction, without leaving any tail calls.
 * @param context the dynamic context for this transformation
 * @throws XPathException if a dynamic error occurs
 */
public void process(XPathContext context) throws XPathException {
  Template t = getTargetTemplate(context);
  XPathContextMajor c2 = context.newContext();
  c2.setOrigin(this);
  c2.openStackFrame(t.getStackFrameMap());
  c2.setLocalParameters(assembleParams(context, actualParams));
  c2.setTunnelParameters(assembleTunnelParams(context, tunnelParams));
  try {
    TailCall tc = t.expand(c2);
    while (tc != null) {
      tc = tc.processLeavingTail();
    }
  } catch (StackOverflowError e) {
    XPathException err = new XPathException("Too many nested template or function calls. The stylesheet may be looping.");
    err.setLocator(this);
    err.setXPathContext(context);
    throw err;
  }
}

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

c2.setLocalParameters(params);
c2.setTunnelParameters(tunnels);
c2.setCurrentTemplateRule(rule);

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

c2.setLocalParameters(params);
c2.setTunnelParameters(tunnels);
c2.setCurrentTemplateRule(rule);

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

c2.setOrigin(this);
c2.setLocalParameters(params);
c2.setTunnelParameters(tunnels);
c2.openStackFrame(nh.getStackFrameMap());

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

c2.setOrigin(this);
c2.setLocalParameters(params);
c2.setTunnelParameters(tunnels);
c2.openStackFrame(nh.getStackFrameMap());

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

c2.setOrigin(this);
c2.openStackFrame(t.getStackFrameMap());
c2.setLocalParameters(assembleParams(context, actualParams));
c2.setTunnelParameters(assembleTunnelParams(context, tunnelParams));
if (isWithinDeclaredStreamableConstruct) {

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

c2.setOrigin(this);
c2.openStackFrame(t.getStackFrameMap());
c2.setLocalParameters(assembleParams(context, actualParams));
c2.setTunnelParameters(assembleTunnelParams(context, tunnelParams));
if (isWithinDeclaredStreamableConstruct) {

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

c2.setOrigin(this);
c2.openStackFrame(nh.getStackFrameMap());
c2.setLocalParameters(params);
c2.setTunnelParameters(tunnels);
nh.apply(c2, rule);

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

c2.setOrigin(this);
c2.openStackFrame(nh.getStackFrameMap());
c2.setLocalParameters(params);
c2.setTunnelParameters(tunnels);
nh.apply(c2, rule);

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

c2.setCurrentComponent(initialComponent);
c2.openStackFrame(t.getStackFrameMap());
c2.setLocalParameters(ordinaryParams);
c2.setTunnelParameters(tunnelParams);

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

Template nh = (Template)rule.getAction();
c2.setOrigin(this);
c2.setLocalParameters(params);
c2.setTunnelParameters(tunnels);
c2.openStackFrame(nh.getStackFrameMap());

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