You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by sh...@apache.org on 2002/04/29 18:31:43 UTC

cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/xml TransformSupport.java XPathUtil.java

shawn       02/04/29 09:31:43

  Modified:    standard/lib jaxen-full.jar saxpath.jar
               standard/src/org/apache/taglibs/standard/lang/support
                        ExpressionEvaluatorManager.java
               standard/src/org/apache/taglibs/standard/tag/common/xml
                        TransformSupport.java XPathUtil.java
  Log:
  - New Jaxen / Saxpath supports
  - Updates to ExpressionEvaluatorManager for the benefit of JSP 1.3.
  - Improved error message for "file not found" in TransformSupport's URIResolver.
  
  Revision  Changes    Path
  1.2       +702 -697  jakarta-taglibs/standard/lib/jaxen-full.jar
  
  	<<Binary file>>
  
  
  1.2       +99 -112   jakarta-taglibs/standard/lib/saxpath.jar
  
  	<<Binary file>>
  
  
  1.5       +18 -0     jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager.java
  
  Index: ExpressionEvaluatorManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ExpressionEvaluatorManager.java	5 Mar 2002 14:36:41 -0000	1.4
  +++ ExpressionEvaluatorManager.java	29 Apr 2002 16:31:43 -0000	1.5
  @@ -110,6 +110,24 @@
               attributeName, expression, expectedType, tag, pageContext));
       }
   
  +    /** 
  +     * Invokes the evaluate() method on the "active" ExpressionEvaluator
  +     * for the given pageContext.
  +     */ 
  +    public static Object evaluate(String attributeName, 
  +                                  String expression, 
  +                                  Class expectedType, 
  +                                  PageContext pageContext) 
  +           throws JspException
  +    {
  +
  +        // the evaluator we'll use
  +        ExpressionEvaluator target = getEvaluatorByName(EVALUATOR_CLASS);
  +
  +        // delegate the call
  +        return (target.evaluate(
  +            attributeName, expression, expectedType, null, pageContext));
  +    }
   
       //*********************************************************************
       // Public static utility method (un-spec'd, local to RI)
  
  
  
  1.8       +2 -0      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/xml/TransformSupport.java
  
  Index: TransformSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/xml/TransformSupport.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TransformSupport.java	17 Apr 2002 12:42:39 -0000	1.7
  +++ TransformSupport.java	29 Apr 2002 16:31:43 -0000	1.8
  @@ -369,6 +369,8 @@
                       pagePath.substring(0, pagePath.lastIndexOf("/"));
                   s = ctx.getServletContext().getResourceAsStream(
                         basePath + "/" + href);
  +		if (s == null)
  +		    throw new TransformerException(href);
               }
               return new StreamSource(s);
           }
  
  
  
  1.7       +6 -5      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java
  
  Index: XPathUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XPathUtil.java	24 Apr 2002 02:30:15 -0000	1.6
  +++ XPathUtil.java	29 Apr 2002 16:31:43 -0000	1.7
  @@ -230,22 +230,23 @@
        */
       public String valueOf(Node n, String xpath) throws SAXPathException {
   	staticInit();
  -        XPath xp = new XPath(xpath);
  -        return xp.valueOf(getLocalContext(n));
  +        XPath xp = new DOMXPath(xpath);
  +        // return xp.valueOf(getLocalContext(n));
  +        return xp.stringValueOf(getLocalContext(n));
       }
   
       /** Evaluates an XPath expression to a boolean value. */
       public boolean booleanValueOf(Node n, String xpath)
   	    throws SAXPathException {
   	staticInit();
  -	XPath xp = new XPath(xpath);
  +	XPath xp = new DOMXPath(xpath);
   	return xp.booleanValueOf(getLocalContext(n));
       }
   
       /** Evalutes an XPath expression to a List of nodes. */
       public List selectNodes(Node n, String xpath) throws SAXPathException {
   	staticInit();
  -	XPath xp = new XPath(xpath);
  +	XPath xp = new DOMXPath(xpath);
   	return xp.selectNodes(getLocalContext(n));
       }
   
  @@ -253,7 +254,7 @@
       public Node selectSingleNode(Node n, String xpath)
   	    throws SAXPathException {
   	staticInit();
  -	XPath xp = new XPath(xpath);
  +	XPath xp = new DOMXPath(xpath);
   	return (Node) xp.selectSingleNode(getLocalContext(n));
       }
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>