garyp       01/07/10 01:38:33

  Modified:    java/src/org/apache/xalan/lib Extensions.java
               java/src/org/apache/xpath XPathContext.java
  Log:
  Resolve bugzilla 2523 
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2523>.  evaluate extension 
function was not refactored with DTM.  Also need to add function to 
XPathContext.XPathExpressionContext to allow an extension to obtain the 
associated XPathContext.
  
  Revision  Changes    Path
  1.12      +4 -3      xml-xalan/java/src/org/apache/xalan/lib/Extensions.java
  
  Index: Extensions.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/Extensions.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Extensions.java   2001/06/15 05:13:51     1.11
  +++ Extensions.java   2001/07/10 08:38:21     1.12
  @@ -259,7 +259,7 @@
       for (int i = 0; i < ns.getLength(); i++)
       {
         Node n = ns.elementAt(i);
  -      String key = DOMHelper.getNodeData(n);
  +      String key = DOMHelper.getNodeData(n);  // TODO:  Fix this to use DTM
   
         if (!stringTable.containsKey(key))
         {
  @@ -318,11 +318,12 @@
               throws SAXNotSupportedException, Exception
     {
   
  -    if (myContext instanceof XPathContext)
  +    if (myContext instanceof XPathContext.XPathExpressionContext)
       {
         try
         {
  -        XPathContext xctxt = (XPathContext) myContext;
  +        XPathContext xctxt =
  +                    ((XPathContext.XPathExpressionContext) 
myContext).getXPathContext();
           XPath dynamicXPath = new XPath(xpathExpr, xctxt.getSAXLocator(),
                                          xctxt.getNamespaceContext(),
                                          XPath.SELECT);
  
  
  
  1.27      +12 -3     xml-xalan/java/src/org/apache/xpath/XPathContext.java
  
  Index: XPathContext.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/XPathContext.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- XPathContext.java 2001/07/10 07:49:12     1.26
  +++ XPathContext.java 2001/07/10 08:38:30     1.27
  @@ -1040,6 +1040,18 @@
     public class XPathExpressionContext implements ExpressionContext
     {
       /**
  +     * Return the XPathContext associated with this XPathExpressionContext.
  +     * Extensions should use this judiciously and only when special 
processing
  +     * requirements cannot be met another way.  Consider requesting an 
enhancement
  +     * to the ExpressionContext interface to avoid having to call this 
method.
  +     * @return the XPathContext associated with this XPathExpressionContext.
  +     */
  +     public XPathContext getXPathContext()
  +     {
  +       return XPathContext.this;
  +     }
  +
  +    /**
        * Return the DTMManager object.  Though XPathContext context extends 
        * the DTMManager, it really is a proxy for the real DTMManager.  If a 
        * caller needs to make a lot of calls to the DTMManager, it is faster 
  @@ -1101,11 +1113,8 @@
   
       /**
        * Get a variable based on it's qualified name.
  -     *
        * @param qname The qualified name of the variable.
  -     *
        * @return The evaluated value of the variable.
  -     *
        * @throws javax.xml.transform.TransformerException
        */
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to