Package com.caucho.xpath

Examples of com.caucho.xpath.Env


    addFunction("document", new DocumentFun(transformer));
    DocumentFun docFun = new DocumentFun(transformer);
    docFun.setHtml(true);
    addFunction("html_document", docFun);

    Env env = XPath.createEnv();
    env.setFunctions(_funs);
    StylesheetEnv ssEnv = new StylesheetEnv();
    ssEnv.setPath(getPath());
    env.setStylesheetEnv(ssEnv);

    out.disableEscaping(_defaultDisableEscaping);

    if (_strip != null && ! _strip.isEmpty()) {
      stripSpaces(xml);
View Full Code Here


      JspWriter out = pageContext.getOut();

      Node node = pageContext.getNodeEnv();

      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());

      String value = _select.evalString(node, env);

      env.free();

      if (_escapeXml)
        com.caucho.el.Expr.toStreamEscaped(out, value);
      else
        out.print(value);
View Full Code Here

                              com.caucho.xpath.Expr select,
                              boolean doEscape)
    throws JspException, XPathException, IOException
  {
    try {
      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());
     
      Node node = pageContext.getNodeEnv();

      String value = select.evalString(node, env);

      env.free();

      if (doEscape)
        com.caucho.el.Expr.toStreamEscaped(out, value);
      else
        out.print(value);
View Full Code Here

  public static Object evalObject(PageContextImpl pageContext,
                                  com.caucho.xpath.Expr select)
    throws XPathException, JspException
  {
    try {
      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());
     
      Node node = pageContext.getNodeEnv();
     
      Object value = select.evalObject(node, env);

      env.free();

      return value;
    } catch (javax.el.ELException e) {
      throw new JspException(e);
    }
View Full Code Here

  public int doStartTag()
    throws JspException
  {
    try {
      PageContextImpl pageContext = (PageContextImpl) this.pageContext;
      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());
     
      _oldEnv = pageContext.getNodeEnv();
      Object obj = _select.evalObject(_oldEnv, env);

      env.free();

      if (obj == null)
        return SKIP_BODY;

      if (obj instanceof Iterator)
View Full Code Here

  public static boolean evalBoolean(PageContextImpl pageContext,
                                    com.caucho.xpath.Expr select)
    throws XPathException, JspException
  {
    try {
      Env env = XPath.createEnv();
      env.setVarEnv(((PageContextImpl) pageContext).getVarEnv());
     
      Node node = pageContext.getNodeEnv();
     
      boolean test = select.evalBoolean(node, env);

      env.free();

      return test;
    } catch (javax.el.ELException e) {
      throw new JspException(e);
    }
View Full Code Here

      if (chooseTag.isMatch())
        return SKIP_BODY;

      PageContextImpl pageContext = (PageContextImpl) this.pageContext;

      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());
     
      Node node = pageContext.getNodeEnv();
     
      boolean test = _select.evalBoolean(node, env);

      env.free();

      if (test) {
        chooseTag.setMatch();
     
        return EVAL_BODY_INCLUDE;
View Full Code Here

      if (chooseTag.isMatch())
        return SKIP_BODY;

      PageContextImpl pageContext = (PageContextImpl) this.pageContext;

      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());
     
      Node node = pageContext.getNodeEnv();
     
      boolean test = _select.evalBoolean(node, env);

      env.free();

      if (test) {
        chooseTag.setMatch();
     
        return EVAL_BODY_INCLUDE;
View Full Code Here

  public static boolean evalBoolean(PageContextImpl pageContext,
            com.caucho.xpath.Expr select)
    throws XPathException, JspException
  {
    try {
      Env env = XPath.createEnv();
      env.setVarEnv(((PageContextImpl) pageContext).getVarEnv());
     
      Node node = pageContext.getNodeEnv();
     
      boolean test = select.evalBoolean(node, env);

      env.free();

      return test;
    } catch (javax.el.ELException e) {
      throw new JspException(e);
    }
View Full Code Here

            com.caucho.xpath.Expr select,
            boolean doEscape)
    throws JspException, XPathException, IOException
  {
    try {
      Env env = XPath.createEnv();
      env.setVarEnv(pageContext.getVarEnv());
     
      Node node = pageContext.getNodeEnv();

      String value = select.evalString(node, env);

      env.free();

      if (doEscape)
        com.caucho.el.Expr.toStreamEscaped(out, value);
      else
        out.print(value);
View Full Code Here

TOP

Related Classes of com.caucho.xpath.Env

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.