sboag       01/05/16 22:38:50

  Modified:    java/src/org/apache/xalan/extensions Tag: DTM_EXP
                        XSLProcessorContext.java
               java/src/org/apache/xalan/lib Tag: DTM_EXP Redirect.java
               java/src/org/apache/xalan/templates Tag: DTM_EXP
                        ElemExtensionCall.java ElemTemplateElement.java
                        FuncDocument.java
               java/src/org/apache/xalan/transformer Tag: DTM_EXP
                        TransformerImpl.java
               java/src/org/apache/xml/dtm/dom2dtm Tag: DTM_EXP
                        DOM2DTM.java
               java/src/org/apache/xpath Tag: DTM_EXP NodeSet.java
                        XPath.java XPathContext.java
               java/src/org/apache/xpath/axes Tag: DTM_EXP AxesWalker.java
                        ChildWalkerMultiStep.java FilterExprWalker.java
                        LocPathIterator.java RootWalkerMultiStep.java
                        UnionPathIterator.java
               java/src/org/apache/xpath/functions Tag: DTM_EXP
                        FuncExtFunction.java
               java/src/org/apache/xpath/objects Tag: DTM_EXP XObject.java
  Log:
  Enable redirect, and extensions for dtm-to-dom support.  NodeIterator
  support really hasn't been enabled yet.  And there is a significant
  issue regarding node-to-dtm on the way out from extensions, where
  we should really get the same DTM handle back.  A job for Joe!
  (see DTMManagerDefault#getDTMHandleFromNode).
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.2   +77 -74    
xml-xalan/java/src/org/apache/xalan/extensions/XSLProcessorContext.java
  
  Index: XSLProcessorContext.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/XSLProcessorContext.java,v
  retrieving revision 1.8.2.1
  retrieving revision 1.8.2.2
  diff -u -r1.8.2.1 -r1.8.2.2
  --- XSLProcessorContext.java  2001/04/10 18:44:38     1.8.2.1
  +++ XSLProcessorContext.java  2001/05/17 05:38:44     1.8.2.2
  @@ -77,6 +77,8 @@
   import org.apache.xpath.objects.XNodeSet;
   import org.apache.xpath.XPathContext;
   
  +import org.apache.xml.dtm.DTM;
  +
   // import org.apache.xalan.xslt.*;
   
   /**
  @@ -105,9 +107,10 @@
       this.transformer = transformer;
       this.stylesheetTree = stylesheetTree;
       // %TBD%
  -//    this.mode = mode;
  -//    this.sourceTree = sourceTree;
  -//    this.sourceNode = sourceNode;
  +    org.apache.xpath.XPathContext xctxt = transformer.getXPathContext();
  +    this.mode = transformer.getMode();
  +    this.sourceNode = xctxt.getCurrentNode();
  +    this.sourceTree = xctxt.getDTM(this.sourceNode);
     }
   
     /** An instance of a transformer          */
  @@ -137,32 +140,30 @@
     }
   
     /**  The root of the source tree being executed.        */
  -  private int sourceTree;
  +  private org.apache.xml.dtm.DTM sourceTree;
   
  -  // %TBD%
  -//  /**
  -//   * Get the root of the source tree being executed.
  -//   *
  -//   * @return the root of the source tree being executed.
  -//   */
  -//  public Node getSourceTree()
  -//  {
  -//    return sourceTree;
  -//  }
  +  /**
  +   * Get the root of the source tree being executed.
  +   *
  +   * @return the root of the source tree being executed.
  +   */
  +  public org.w3c.dom.Node getSourceTree()
  +  {
  +    return sourceTree.getNode(sourceTree.getDocument());
  +  }
   
     /** the current context node.          */
     private int sourceNode;
   
  -  // %TBD%
  -//  /**
  -//   * Get the current context node.
  -//   *
  -//   * @return the current context node.
  -//   */
  -//  public Node getContextNode()
  -//  {
  -//    return sourceNode;
  -//  }
  +  /**
  +   * Get the current context node.
  +   *
  +   * @return the current context node.
  +   */
  +  public org.w3c.dom.Node getContextNode()
  +  {
  +    return sourceTree.getNode(sourceNode);
  +  }
   
     /** the current mode being executed.         */
     private QName mode;
  @@ -250,57 +251,59 @@
           s = value.str();
   
           rtreeHandler.characters(s.toCharArray(), 0, s.length());
  +        break;
  +
  +      case XObject.CLASS_NODESET :  // System.out.println(value);
  +        DTMIterator nl = value.nodeset();
  +        
  +        int pos;
  +
  +        while (DTM.NULL != (pos = nl.nextNode()))
  +        {
  +          DTM dtm = nl.getDTM(pos);
  +          int top = pos;
  +
  +          while (DTM.NULL != pos)
  +          {
  +            rtreeHandler.flushPending();
  +            rtreeHandler.cloneToResultTree(pos, true);
  +
  +            int nextNode = dtm.getFirstChild(pos);
  +
  +            while (DTM.NULL == nextNode)
  +            {
  +              if (DTM.ELEMENT_NODE == dtm.getNodeType(pos))
  +              {
  +                rtreeHandler.endElement("", "", dtm.getNodeName(pos));
  +              }
  +
  +              if (top == pos)
  +                break;
  +
  +              nextNode = dtm.getNextSibling(pos);
  +
  +              if (DTM.NULL == nextNode)
  +              {
  +                pos = dtm.getParent(pos);
  +
  +                if (top == pos)
  +                {
  +                  if (DTM.ELEMENT_NODE == dtm.getNodeType(pos))
  +                  {
  +                    rtreeHandler.endElement("", "", dtm.getNodeName(pos));
  +                  }
  +
  +                  nextNode = DTM.NULL;
  +
  +                  break;
  +                }
  +              }
  +            }
  +
  +            pos = nextNode;
  +          }
  +        }
           break;
  -        // %TBD%
  -//      case XObject.CLASS_NODESET :  // System.out.println(value);
  -//        DTMIterator nl = value.nodeset();
  -//        int pos;
  -//
  -//        while (DTM.NULL != (pos = nl.nextNode()))
  -//        {
  -//          int top = pos;
  -//
  -//          while (null != pos)
  -//          {
  -//            rtreeHandler.flushPending();
  -//            rtreeHandler.cloneToResultTree(pos, true);
  -//
  -//            Node nextNode = pos.getFirstChild();
  -//
  -//            while (null == nextNode)
  -//            {
  -//              if (Node.ELEMENT_NODE == pos.getNodeType())
  -//              {
  -//                rtreeHandler.endElement("", "", pos.getNodeName());
  -//              }
  -//
  -//              if (top == pos)
  -//                break;
  -//
  -//              nextNode = pos.getNextSibling();
  -//
  -//              if (null == nextNode)
  -//              {
  -//                pos = pos.getParentNode();
  -//
  -//                if (top == pos)
  -//                {
  -//                  if (Node.ELEMENT_NODE == pos.getNodeType())
  -//                  {
  -//                    rtreeHandler.endElement("", "", pos.getNodeName());
  -//                  }
  -//
  -//                  nextNode = null;
  -//
  -//                  break;
  -//                }
  -//              }
  -//            }
  -//
  -//            pos = nextNode;
  -//          }
  -//        }
  -//        break;
         case XObject.CLASS_RTREEFRAG :
           rtreeHandler.outputResultTreeFragment(value,
                                                 transformer.getXPathContext());
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.12.2.3  +270 -269  xml-xalan/java/src/org/apache/xalan/lib/Redirect.java
  
  Index: Redirect.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/lib/Redirect.java,v
  retrieving revision 1.12.2.2
  retrieving revision 1.12.2.3
  diff -u -r1.12.2.2 -r1.12.2.3
  --- Redirect.java     2001/05/08 01:09:55     1.12.2.2
  +++ Redirect.java     2001/05/17 05:38:45     1.12.2.3
  @@ -75,6 +75,8 @@
   import javax.xml.transform.Result;
   import javax.xml.transform.TransformerException;
   
  +import org.w3c.dom.*;
  +
   /**
    * Implements three extension elements to allow an XSLT transformation to
    * redirect its output to multiple output files.
  @@ -153,274 +155,273 @@
      * List of output streams indexed by filename.
      */
     protected Hashtable m_outputStreams = new Hashtable ();
  +
  +  /**
  +   * Open the given file and put it in the XML, HTML, or Text formatter 
listener's table.
  +   */
  +  public void open(XSLProcessorContext context, ElemExtensionCall elem)
  +    throws java.net.MalformedURLException,
  +           java.io.FileNotFoundException,
  +           java.io.IOException,
  +           javax.xml.transform.TransformerException
  +  {
  +    String fileName = getFilename(context, elem);
  +    Object flistener = m_formatterListeners.get(fileName);
  +    if(null == flistener)
  +    {
  +      String mkdirsExpr 
  +        = elem.getAttribute ("mkdirs", context.getContextNode(), 
  +                                                  context.getTransformer());
  +      boolean mkdirs = (mkdirsExpr != null)
  +                       ? (mkdirsExpr.equals("true") || 
mkdirsExpr.equals("yes")) : true;
  +          // ContentHandler fl = 
  +          makeFormatterListener(context, elem, fileName, true, mkdirs);
  +          // fl.startDocument();
  +    }
  +  }
  +  
  +  /**
  +   * Write the evalutation of the element children to the given file. Then 
close the file
  +   * unless it was opened with the open extension element and is in the 
formatter listener's table.
  +   */
  +  public void write(XSLProcessorContext context, ElemExtensionCall elem)
  +    throws java.net.MalformedURLException,
  +           java.io.FileNotFoundException,
  +           java.io.IOException,
  +           javax.xml.transform.TransformerException
  +  {
  +    String fileName = getFilename(context, elem);
  +    Object flObject = m_formatterListeners.get(fileName);
  +    ContentHandler formatter;
  +    boolean inTable = false;
  +    if(null == flObject)
  +    {
  +      String mkdirsExpr 
  +        = ((ElemExtensionCall)elem).getAttribute ("mkdirs", 
  +                                                  context.getContextNode(), 
  +                                                  context.getTransformer());
  +      boolean mkdirs = (mkdirsExpr != null)
  +                       ? (mkdirsExpr.equals("true") || 
mkdirsExpr.equals("yes")) : true;
  +      formatter = makeFormatterListener(context, elem, fileName, true, 
mkdirs);
  +    }
  +    else
  +    {
  +      inTable = true;
  +      formatter = (ContentHandler)flObject;
  +    }
  +    
  +    TransformerImpl transf = context.getTransformer();
  +    
  +    transf.executeChildTemplates(elem,
  +                                 context.getContextNode(),
  +                                 context.getMode(), formatter);
  +    
  +    if(!inTable)
  +    {
  +      OutputStream ostream = (OutputStream)m_outputStreams.get(fileName);
  +      if(null != ostream)
  +      {
  +        try
  +        {
  +          formatter.endDocument();
  +        }
  +        catch(org.xml.sax.SAXException se)
  +        {
  +          throw new TransformerException(se);
  +        }
  +        ostream.close();
  +        m_outputStreams.remove(fileName);
  +        m_formatterListeners.remove(fileName);
  +      }
  +    }
  +  }
  +
  +
  +  /**
  +   * Close the given file and remove it from the formatter listener's table.
  +   */
  +  public void close(XSLProcessorContext context, ElemExtensionCall elem)
  +    throws java.net.MalformedURLException,
  +    java.io.FileNotFoundException,
  +    java.io.IOException,
  +    javax.xml.transform.TransformerException
  +  {
  +    String fileName = getFilename(context, elem);
  +    Object formatterObj = m_formatterListeners.get(fileName);
  +    if(null != formatterObj)
  +    {
  +      ContentHandler fl = (ContentHandler)formatterObj;
  +      try
  +      {
  +        fl.endDocument();
  +      }
  +      catch(org.xml.sax.SAXException se)
  +      {
  +        throw new TransformerException(se);
  +      }
  +      OutputStream ostream = (OutputStream)m_outputStreams.get(fileName);
  +      if(null != ostream)
  +      {
  +        ostream.close();
  +        m_outputStreams.remove(fileName);
  +      }
  +      m_formatterListeners.remove(fileName);
  +    }
  +  }
  +
  +  /**
  +   * Get the filename from the 'select' or the 'file' attribute.
  +   */
  +  private String getFilename(XSLProcessorContext context, ElemExtensionCall 
elem)
  +    throws java.net.MalformedURLException,
  +    java.io.FileNotFoundException,
  +    java.io.IOException,
  +    javax.xml.transform.TransformerException
  +  {
  +    String fileName;
  +    String fileNameExpr 
  +      = ((ElemExtensionCall)elem).getAttribute ("select", 
  +                                                context.getContextNode(), 
  +                                                context.getTransformer());
  +    if(null != fileNameExpr)
  +    {
  +      org.apache.xpath.XPathContext xctxt 
  +        = context.getTransformer().getXPathContext();
  +      XPath myxpath = new XPath(fileNameExpr, elem, 
xctxt.getNamespaceContext(), XPath.SELECT);
  +      XObject xobj = myxpath.execute(xctxt, context.getContextNode(), 
xctxt.getNamespaceContext());
  +      fileName = xobj.str();
  +      if((null == fileName) || (fileName.length() == 0))
  +      {
  +        fileName = elem.getAttribute ("file", 
  +                                      context.getContextNode(), 
  +                                      context.getTransformer());
  +      }
  +    }
  +    else
  +    {
  +      fileName = elem.getAttribute ("file", context.getContextNode(), 
  +                                                               
context.getTransformer());
  +    }
  +    if(null == fileName)
  +    {
  +      context.getTransformer().getMsgMgr().error(elem, elem, 
  +                                     context.getContextNode(), 
  +                                     
XSLTErrorResources.ER_REDIRECT_COULDNT_GET_FILENAME);
  +                              //"Redirect extension: Could not get filename 
- file or select attribute must return vald string.");
  +    }
  +    return fileName;
  +  }
  +  
  +  // yuck.
  +  private String urlToFileName(String base)
  +  {
  +    if(null != base)
  +    {
  +      if(base.startsWith("file:////"))
  +      {
  +        base = base.substring(7);
  +      }
  +      else if(base.startsWith("file:///"))
  +      {
  +        base = base.substring(6);
  +      }
  +      else if(base.startsWith("file://"))
  +      {
  +        base = base.substring(5); // absolute?
  +      }
  +      else if(base.startsWith("file:/"))
  +      {
  +        base = base.substring(5);
  +      }
  +      else if(base.startsWith("file:"))
  +      {
  +        base = base.substring(4);
  +      }
  +    }
  +    return base;
  +  }
  +
  +  /**
  +   * Create a new ContentHandler, based on attributes of the current 
ContentHandler.
  +   */
  +  private ContentHandler makeFormatterListener(XSLProcessorContext context,
  +                                               ElemExtensionCall elem,
  +                                               String fileName,
  +                                               boolean shouldPutInTable,
  +                                               boolean mkdirs)
  +    throws java.net.MalformedURLException,
  +    java.io.FileNotFoundException,
  +    java.io.IOException,
  +    javax.xml.transform.TransformerException
  +  {
  +    File file = new File(fileName);
  +    TransformerImpl transformer = context.getTransformer();
  +    String base;          // Base URI to use for relative paths
  +
  +    if(!file.isAbsolute())
  +    {
  +      // This code is attributed to Jon Grov <[EMAIL PROTECTED]>.  A 
relative file name
  +      // is relative to the Result used to kick off the transform.  If no 
such
  +      // Result was supplied, the filename is relative to the source 
document.
  +      // When transforming with a SAXResult or DOMResult, call
  +      // TransformerImpl.setOutputTarget() to set the desired Result base.
  +  //      String base = urlToFileName(elem.getStylesheet().getSystemId());
  +
  +      Result outputTarget = transformer.getOutputTarget();
  +      if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) != 
null) ) {
  +        base = urlToFileName(base);
  +      }
  +      else
  +      {
  +        base = urlToFileName(transformer.getBaseURLOfSource());
  +      }
  +
  +      if(null != base)
  +      {
  +        File baseFile = new File(base);
  +        file = new File(baseFile.getParent(), fileName);
  +      }
  +    }
  +
  +    if(mkdirs)
  +    {
  +      String dirStr = file.getParent();
  +      if((null != dirStr) && (dirStr.length() > 0))
  +      {
  +        File dir = new File(dirStr);
  +        dir.mkdirs();
  +      }
  +    }
  +
  +    // This should be worked on so that the output format can be 
  +    // defined by a first child of the redirect element.
  +    OutputProperties format = transformer.getOutputFormat();
   
  -  // %TBD%
  -//  /**
  -//   * Open the given file and put it in the XML, HTML, or Text formatter 
listener's table.
  -//   */
  -//  public void open(XSLProcessorContext context, ElemExtensionCall elem)
  -//    throws java.net.MalformedURLException,
  -//           java.io.FileNotFoundException,
  -//           java.io.IOException,
  -//           javax.xml.transform.TransformerException
  -//  {
  -//    String fileName = getFilename(context, elem);
  -//    Object flistener = m_formatterListeners.get(fileName);
  -//    if(null == flistener)
  -//    {
  -//      String mkdirsExpr 
  -//        = elem.getAttribute ("mkdirs", context.getContextNode(), 
  -//                                                  
context.getTransformer());
  -//      boolean mkdirs = (mkdirsExpr != null)
  -//                       ? (mkdirsExpr.equals("true") || 
mkdirsExpr.equals("yes")) : true;
  -//          // ContentHandler fl = 
  -//          makeFormatterListener(context, elem, fileName, true, mkdirs);
  -//          // fl.startDocument();
  -//    }
  -//  }
  -//  
  -//  /**
  -//   * Write the evalutation of the element children to the given file. Then 
close the file
  -//   * unless it was opened with the open extension element and is in the 
formatter listener's table.
  -//   */
  -//  public void write(XSLProcessorContext context, ElemExtensionCall elem)
  -//    throws java.net.MalformedURLException,
  -//           java.io.FileNotFoundException,
  -//           java.io.IOException,
  -//           javax.xml.transform.TransformerException
  -//  {
  -//    String fileName = getFilename(context, elem);
  -//    Object flObject = m_formatterListeners.get(fileName);
  -//    ContentHandler formatter;
  -//    boolean inTable = false;
  -//    if(null == flObject)
  -//    {
  -//      String mkdirsExpr 
  -//        = ((ElemExtensionCall)elem).getAttribute ("mkdirs", 
  -//                                                  
context.getContextNode(), 
  -//                                                  
context.getTransformer());
  -//      boolean mkdirs = (mkdirsExpr != null)
  -//                       ? (mkdirsExpr.equals("true") || 
mkdirsExpr.equals("yes")) : true;
  -//      formatter = makeFormatterListener(context, elem, fileName, true, 
mkdirs);
  -//    }
  -//    else
  -//    {
  -//      inTable = true;
  -//      formatter = (ContentHandler)flObject;
  -//    }
  -//    
  -//    TransformerImpl transf = context.getTransformer();
  -//    
  -//    transf.executeChildTemplates(elem,
  -//                                 context.getContextNode(),
  -//                                 context.getMode(), formatter);
  -//    
  -//    if(!inTable)
  -//    {
  -//      OutputStream ostream = (OutputStream)m_outputStreams.get(fileName);
  -//      if(null != ostream)
  -//      {
  -//        try
  -//        {
  -//          formatter.endDocument();
  -//        }
  -//        catch(org.xml.sax.SAXException se)
  -//        {
  -//          throw new TransformerException(se);
  -//        }
  -//        ostream.close();
  -//        m_outputStreams.remove(fileName);
  -//        m_formatterListeners.remove(fileName);
  -//      }
  -//    }
  -//  }
  -//
  -//
  -//  /**
  -//   * Close the given file and remove it from the formatter listener's 
table.
  -//   */
  -//  public void close(XSLProcessorContext context, ElemExtensionCall elem)
  -//    throws java.net.MalformedURLException,
  -//    java.io.FileNotFoundException,
  -//    java.io.IOException,
  -//    javax.xml.transform.TransformerException
  -//  {
  -//    String fileName = getFilename(context, elem);
  -//    Object formatterObj = m_formatterListeners.get(fileName);
  -//    if(null != formatterObj)
  -//    {
  -//      ContentHandler fl = (ContentHandler)formatterObj;
  -//      try
  -//      {
  -//        fl.endDocument();
  -//      }
  -//      catch(org.xml.sax.SAXException se)
  -//      {
  -//        throw new TransformerException(se);
  -//      }
  -//      OutputStream ostream = (OutputStream)m_outputStreams.get(fileName);
  -//      if(null != ostream)
  -//      {
  -//        ostream.close();
  -//        m_outputStreams.remove(fileName);
  -//      }
  -//      m_formatterListeners.remove(fileName);
  -//    }
  -//  }
  -//
  -//  /**
  -//   * Get the filename from the 'select' or the 'file' attribute.
  -//   */
  -//  private String getFilename(XSLProcessorContext context, 
ElemExtensionCall elem)
  -//    throws java.net.MalformedURLException,
  -//    java.io.FileNotFoundException,
  -//    java.io.IOException,
  -//    javax.xml.transform.TransformerException
  -//  {
  -//    String fileName;
  -//    String fileNameExpr 
  -//      = ((ElemExtensionCall)elem).getAttribute ("select", 
  -//                                                context.getContextNode(), 
  -//                                                context.getTransformer());
  -//    if(null != fileNameExpr)
  -//    {
  -//      org.apache.xpath.XPathContext xctxt 
  -//        = context.getTransformer().getXPathContext();
  -//      XPath myxpath = new XPath(fileNameExpr, elem, 
xctxt.getNamespaceContext(), XPath.SELECT);
  -//      XObject xobj = myxpath.execute(xctxt, context.getContextNode(), 
xctxt.getNamespaceContext());
  -//      fileName = xobj.str();
  -//      if((null == fileName) || (fileName.length() == 0))
  -//      {
  -//        fileName = elem.getAttribute ("file", 
  -//                                      context.getContextNode(), 
  -//                                      context.getTransformer());
  -//      }
  -//    }
  -//    else
  -//    {
  -//      fileName = elem.getAttribute ("file", context.getContextNode(), 
  -//                                                               
context.getTransformer());
  -//    }
  -//    if(null == fileName)
  -//    {
  -//      context.getTransformer().getMsgMgr().error(elem, elem, 
  -//                                     context.getContextNode(), 
  -//                                     
XSLTErrorResources.ER_REDIRECT_COULDNT_GET_FILENAME);
  -//                              //"Redirect extension: Could not get 
filename - file or select attribute must return vald string.");
  -//    }
  -//    return fileName;
  -//  }
  -//  
  -//  // yuck.
  -//  private String urlToFileName(String base)
  -//  {
  -//    if(null != base)
  -//    {
  -//      if(base.startsWith("file:////"))
  -//      {
  -//        base = base.substring(7);
  -//      }
  -//      else if(base.startsWith("file:///"))
  -//      {
  -//        base = base.substring(6);
  -//      }
  -//      else if(base.startsWith("file://"))
  -//      {
  -//        base = base.substring(5); // absolute?
  -//      }
  -//      else if(base.startsWith("file:/"))
  -//      {
  -//        base = base.substring(5);
  -//      }
  -//      else if(base.startsWith("file:"))
  -//      {
  -//        base = base.substring(4);
  -//      }
  -//    }
  -//    return base;
  -//  }
  -//
  -//  /**
  -//   * Create a new ContentHandler, based on attributes of the current 
ContentHandler.
  -//   */
  -//  private ContentHandler makeFormatterListener(XSLProcessorContext context,
  -//                                               ElemExtensionCall elem,
  -//                                               String fileName,
  -//                                               boolean shouldPutInTable,
  -//                                               boolean mkdirs)
  -//    throws java.net.MalformedURLException,
  -//    java.io.FileNotFoundException,
  -//    java.io.IOException,
  -//    javax.xml.transform.TransformerException
  -//  {
  -//    File file = new File(fileName);
  -//    TransformerImpl transformer = context.getTransformer();
  -//    String base;          // Base URI to use for relative paths
  -//
  -//    if(!file.isAbsolute())
  -//    {
  -//      // This code is attributed to Jon Grov <[EMAIL PROTECTED]>.  A 
relative file name
  -//      // is relative to the Result used to kick off the transform.  If no 
such
  -//      // Result was supplied, the filename is relative to the source 
document.
  -//      // When transforming with a SAXResult or DOMResult, call
  -//      // TransformerImpl.setOutputTarget() to set the desired Result base.
  -//  //      String base = urlToFileName(elem.getStylesheet().getSystemId());
  -//
  -//      Result outputTarget = transformer.getOutputTarget();
  -//      if ( (null != outputTarget) && ((base = outputTarget.getSystemId()) 
!= null) ) {
  -//        base = urlToFileName(base);
  -//      }
  -//      else
  -//      {
  -//        base = urlToFileName(transformer.getBaseURLOfSource());
  -//      }
  -//
  -//      if(null != base)
  -//      {
  -//        File baseFile = new File(base);
  -//        file = new File(baseFile.getParent(), fileName);
  -//      }
  -//    }
  -//
  -//    if(mkdirs)
  -//    {
  -//      String dirStr = file.getParent();
  -//      if((null != dirStr) && (dirStr.length() > 0))
  -//      {
  -//        File dir = new File(dirStr);
  -//        dir.mkdirs();
  -//      }
  -//    }
  -//
  -//    // This should be worked on so that the output format can be 
  -//    // defined by a first child of the redirect element.
  -//    OutputProperties format = transformer.getOutputFormat();
  -//
  -//    FileOutputStream ostream = new FileOutputStream(file);
  -//    
  -//    try
  -//    {
  -//      ContentHandler flistener 
  -//        = transformer.createResultContentHandler(new 
StreamResult(ostream), format);
  -//      try
  -//      {
  -//        flistener.startDocument();
  -//      }
  -//      catch(org.xml.sax.SAXException se)
  -//      {
  -//        throw new TransformerException(se);
  -//      }
  -//      if(shouldPutInTable)
  -//      {
  -//        m_outputStreams.put(fileName, ostream);
  -//        m_formatterListeners.put(fileName, flistener);
  -//      }
  -//      return flistener;
  -//    }
  -//    catch(TransformerException te)
  -//    {
  -//      throw new javax.xml.transform.TransformerException(te);
  -//    }
  -//    
  -//  }
  +    FileOutputStream ostream = new FileOutputStream(file);
  +    
  +    try
  +    {
  +      ContentHandler flistener 
  +        = transformer.createResultContentHandler(new StreamResult(ostream), 
format);
  +      try
  +      {
  +        flistener.startDocument();
  +      }
  +      catch(org.xml.sax.SAXException se)
  +      {
  +        throw new TransformerException(se);
  +      }
  +      if(shouldPutInTable)
  +      {
  +        m_outputStreams.put(fileName, ostream);
  +        m_formatterListeners.put(fileName, flistener);
  +      }
  +      return flistener;
  +    }
  +    catch(TransformerException te)
  +    {
  +      throw new javax.xml.transform.TransformerException(te);
  +    }
  +    
  +  }
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.24.2.3  +7 -2      
xml-xalan/java/src/org/apache/xalan/templates/ElemExtensionCall.java
  
  Index: ElemExtensionCall.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemExtensionCall.java,v
  retrieving revision 1.24.2.2
  retrieving revision 1.24.2.3
  diff -u -r1.24.2.2 -r1.24.2.3
  --- ElemExtensionCall.java    2001/05/06 02:09:28     1.24.2.2
  +++ ElemExtensionCall.java    2001/05/17 05:38:45     1.24.2.3
  @@ -81,6 +81,8 @@
   
   import javax.xml.transform.TransformerException;
   
  +import org.apache.xml.dtm.DTM;
  +
   /**
    * <meta name="usage" content="advanced"/>
    * Implement an extension element.
  @@ -386,7 +388,7 @@
      * @throws TransformerException
      */
     public String getAttribute(
  -          String rawName, int sourceNode /* %DTBD% Node varient? */, 
TransformerImpl transformer)
  +          String rawName, org.w3c.dom.Node sourceNode, TransformerImpl 
transformer)
               throws TransformerException
     {
   
  @@ -396,9 +398,12 @@
       {
         XPathContext xctxt = transformer.getXPathContext();
   
  -      return avt.evaluate(xctxt, sourceNode, this);
  +      return avt.evaluate(xctxt, 
  +            xctxt.getDTMHandleFromNode(sourceNode), 
  +            this);
       }
   
       return null;
     }
  +  
   }
  
  
  
  1.38.2.3  +1 -1      
xml-xalan/java/src/org/apache/xalan/templates/ElemTemplateElement.java
  
  Index: ElemTemplateElement.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemTemplateElement.java,v
  retrieving revision 1.38.2.2
  retrieving revision 1.38.2.3
  diff -u -r1.38.2.2 -r1.38.2.3
  --- ElemTemplateElement.java  2001/05/06 02:09:29     1.38.2.2
  +++ ElemTemplateElement.java  2001/05/17 05:38:45     1.38.2.3
  @@ -106,7 +106,7 @@
    *
    * @see Stylesheet
    */
  -public class ElemTemplateElement /* %DTBD% extends UnImplNode */
  +public class ElemTemplateElement extends UnImplNode
           implements PrefixResolver, Serializable, SourceLocator, 
                      WhitespaceStrippingElementMatcher
   {
  
  
  
  1.19.2.6  +3 -1      
xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java
  
  Index: FuncDocument.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/FuncDocument.java,v
  retrieving revision 1.19.2.5
  retrieving revision 1.19.2.6
  diff -u -r1.19.2.5 -r1.19.2.6
  --- FuncDocument.java 2001/05/16 23:28:29     1.19.2.5
  +++ FuncDocument.java 2001/05/17 05:38:46     1.19.2.6
  @@ -152,9 +152,11 @@
           DTM baseDTM = xctxt.getDTM(baseNode);
           base = baseDTM.getDocumentBaseURI();
   
  +        // %REVIEW% This doesn't seem to be a problem with the conformance
  +        // suite, but maybe it's just not doing a good test?
   //        int baseDoc = baseDTM.getDocument();
   //
  -//        if (baseDoc == DTM.NULL /* || baseDoc instanceof Stylesheet  %TBD% 
What to do?? */)
  +//        if (baseDoc == DTM.NULL /* || baseDoc instanceof Stylesheet  
-->What to do?? */)
   //        {
   //
   //          // base = ((Stylesheet)baseDoc).getBaseIdentifier();
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.90.2.11 +36 -4     
xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java
  
  Index: TransformerImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TransformerImpl.java,v
  retrieving revision 1.90.2.10
  retrieving revision 1.90.2.11
  diff -u -r1.90.2.10 -r1.90.2.11
  --- TransformerImpl.java      2001/05/16 23:28:39     1.90.2.10
  +++ TransformerImpl.java      2001/05/17 05:38:46     1.90.2.11
  @@ -170,7 +170,7 @@
    * representation of the transformation execution.</p>
    */
   public class TransformerImpl extends Transformer
  -        implements Runnable, DTMWSFilter /* %TBD% , TransformState */
  +        implements Runnable, DTMWSFilter
   {
     // Synch object to gaurd against setting values from the TrAX interface 
     // or reentry while the transform is going on.
  @@ -938,7 +938,6 @@
       
       // If the Result object contains a Node, then create 
       // a ContentHandler that will add nodes to the input node.
  -    // %TBD%
       org.w3c.dom.Node outputNode = null;
       if(outputTarget instanceof DOMResult)
       {
  @@ -1949,15 +1948,48 @@
   
       return true;
     }
  -
  +  
     /**
      * <meta name="usage" content="advanced"/>
  -   * Execute each of the children of a template element.
  +   * Execute each of the children of a template element.  This method 
  +   * is only for extension use.
      *
      * @param elem The ElemTemplateElement that contains the children 
      * that should execute.
      * @param sourceNode The current context node.
      * @param mode The current mode.
  +   * @param handler The ContentHandler to where the result events 
  +   * should be fed.
  +   * 
  +   * @throws TransformerException
  +   */
  +  public void executeChildTemplates(
  +          ElemTemplateElement elem, org.w3c.dom.Node context, QName mode, 
  +           ContentHandler handler)
  +            throws TransformerException
  +  {
  +    XPathContext xctxt = getXPathContext();
  +    try
  +    {
  +      xctxt.pushCurrentNode(
  +           xctxt.getDTMHandleFromNode(context));
  +             
  +      executeChildTemplates( elem, handler);
  +    }
  +    finally
  +    {
  +      xctxt.popCurrentNode();
  +      if(null != mode)
  +        popMode();
  +    }
  +  }
  +
  +  /**
  +   * <meta name="usage" content="advanced"/>
  +   * Execute each of the children of a template element.
  +   *
  +   * @param elem The ElemTemplateElement that contains the children 
  +   * that should execute.
      * @param handler The ContentHandler to where the result events 
      * should be fed.
      * 
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.14  +4 -4      
xml-xalan/java/src/org/apache/xml/dtm/dom2dtm/Attic/DOM2DTM.java
  
  Index: DOM2DTM.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xml/dtm/dom2dtm/Attic/DOM2DTM.java,v
  retrieving revision 1.1.2.13
  retrieving revision 1.1.2.14
  diff -u -r1.1.2.13 -r1.1.2.14
  --- DOM2DTM.java      2001/05/16 05:33:21     1.1.2.13
  +++ DOM2DTM.java      2001/05/17 05:38:47     1.1.2.14
  @@ -440,13 +440,13 @@
     }
   
     /**
  -   * Get a Node from a handle.
  +   * Return an DOM node for the given node.
      *
  -   * NEEDSDOC @param nodeHandle
  +   * @param nodeHandle The node ID.
      *
  -   * NEEDSDOC ($objectName$) @return
  +   * @return A node representation of the DTM node.
      */
  -  protected Node getNode(int nodeHandle)
  +  public Node getNode(int nodeHandle)
     {
   
       int identity = nodeHandle & m_mask;
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.4  +1 -1      xml-xalan/java/src/org/apache/xpath/NodeSet.java
  
  Index: NodeSet.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/NodeSet.java,v
  retrieving revision 1.10.2.3
  retrieving revision 1.10.2.4
  diff -u -r1.10.2.3 -r1.10.2.4
  --- NodeSet.java      2001/05/07 13:15:33     1.10.2.3
  +++ NodeSet.java      2001/05/17 05:38:47     1.10.2.4
  @@ -190,7 +190,7 @@
      */
     public void setEnvironment(Object environment)
     {
  -    // %TBD%
  +    // no-op
     }
   
   
  
  
  
  1.18.2.2  +32 -7     xml-xalan/java/src/org/apache/xpath/XPath.java
  
  Index: XPath.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/XPath.java,v
  retrieving revision 1.18.2.1
  retrieving revision 1.18.2.2
  diff -u -r1.18.2.1 -r1.18.2.2
  --- XPath.java        2001/04/10 18:45:11     1.18.2.1
  +++ XPath.java        2001/05/17 05:38:47     1.18.2.2
  @@ -230,7 +230,7 @@
     {  
       this(exprString, locator, prefixResolver, type, null);    
     }
  -
  +  
     /**
      * <meta name="usage" content="experimental"/>
      * Given an expression and a context, evaluate the XPath
  @@ -238,18 +238,43 @@
      * types of expresions right now can call back, so if this
      * method returns null, then the callbacks have been called, otherwise
      * a valid XObject will be returned.
  +   * 
      * @param xctxt The execution context.
      * @param contextNode The node that "." expresses.
      * @param namespaceContext The context in which namespaces in the
      * XPath are supposed to be expanded.
  -   * @throws TransformerException thrown if the active ProblemListener 
decides
  -   * the error condition is severe enough to halt processing.
  -   * @param callback Interface that implements the processLocatedNode method.
  -   * @param callbackInfo Object that will be passed to the 
processLocatedNode method.
  -   * @param stopAtFirst True if the search should stop once the first node 
in document
  -   * order is found.
  +
      * @return The result of the XPath or null if callbacks are used.
      * @throws TransformerException thrown if
  +   * the error condition is severe enough to halt processing.
  +   *
  +   * @throws javax.xml.transform.TransformerException
  +   */
  +  public XObject execute(
  +          XPathContext xctxt, org.w3c.dom.Node contextNode, 
  +          PrefixResolver namespaceContext)
  +            throws javax.xml.transform.TransformerException
  +  {
  +    return execute(
  +          xctxt, xctxt.getDTMHandleFromNode(contextNode), 
  +          namespaceContext);
  +  }
  +  
  +
  +  /**
  +   * <meta name="usage" content="experimental"/>
  +   * Given an expression and a context, evaluate the XPath
  +   * and call the callback as nodes are found.  Only some simple
  +   * types of expresions right now can call back, so if this
  +   * method returns null, then the callbacks have been called, otherwise
  +   * a valid XObject will be returned.
  +   * 
  +   * @param xctxt The execution context.
  +   * @param contextNode The node that "." expresses.
  +   * @param namespaceContext The context in which namespaces in the
  +   * XPath are supposed to be expanded.
  +   * 
  +   * @throws TransformerException thrown if the active ProblemListener 
decides
      * the error condition is severe enough to halt processing.
      *
      * @throws javax.xml.transform.TransformerException
  
  
  
  1.20.2.6  +90 -0     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.20.2.5
  retrieving revision 1.20.2.6
  diff -u -r1.20.2.5 -r1.20.2.6
  --- XPathContext.java 2001/05/16 05:33:43     1.20.2.5
  +++ XPathContext.java 2001/05/17 05:38:47     1.20.2.6
  @@ -177,6 +177,20 @@
     }
     
     /**
  +   * Given a W3C DOM node, try and return a DTM handle.
  +   * Note: calling this may be non-optimal.
  +   * 
  +   * @param node Non-null reference to a DOM node.
  +   * 
  +   * @return a valid DTM handle.
  +   */
  +  public int getDTMHandleFromNode(org.w3c.dom.Node node)
  +  {
  +    return m_dtmManager.getDTMHandleFromNode(node);
  +  }
  +
  +  
  +  /**
      * %TBD% Doc
      */
     public int getDTMIdentity(DTM dtm)
  @@ -863,6 +877,82 @@
       {
         return null;  // error reporting?
       }
  +  }
  +  
  +  XPathExpressionContext expresionContext = new XPathExpressionContext();
  +  
  +  /**
  +   * The the expression context for extensions for this context.
  +   * 
  +   * @return An object that implements the ExpressionContext.
  +   */
  +  public ExpressionContext getExpressionContext()
  +  {
  +    return expresionContext;
  +  }
  +  
  +  class XPathExpressionContext implements ExpressionContext
  +  {
  +    
  +    /**
  +     * Get the current context node.
  +     * @return The current context node.
  +     */
  +    public org.w3c.dom.Node getContextNode()
  +    {
  +      int context = m_currentNodes.peepOrNull();
  +      
  +      return getDTM(context).getNode(context);
  +    }
  +  
  +    /**
  +     * Get the current context node list.
  +     * @return An iterator for the current context list, as
  +     * defined in XSLT.
  +     */
  +    public org.w3c.dom.traversal.NodeIterator getContextNodes()
  +    {
  +      // %TBD%
  +      return null;
  +    }
  +  
  +    /**
  +     * Get the value of a node as a number.
  +     * @param n Node to be converted to a number.  May be null.
  +     * @return value of n as a number.
  +     */
  +    public double toNumber(org.w3c.dom.Node n)
  +    {
  +      // %REVIEW% You can't get much uglier than this...
  +      int nodeHandle = getDTMHandleFromNode(n);
  +      DTM dtm = getDTM(nodeHandle);
  +      String strVal = dtm.getStringValue(nodeHandle);
  +      XObject xobj = new org.apache.xpath.objects.XString(strVal);
  +      try
  +      {
  +        return xobj.num();
  +      }
  +      catch(TransformerException te)
  +      {
  +        throw new org.apache.xml.utils.WrappedRuntimeException(te);
  +      }
  +    }
  +  
  +    /**
  +     * Get the value of a node as a string.
  +     * @param n Node to be converted to a string.  May be null.
  +     * @return value of n as a string, or an empty string if n is null.
  +     */
  +    public String toString(org.w3c.dom.Node n)
  +    {
  +      // %REVIEW% You can't get much uglier than this...
  +      int nodeHandle = getDTMHandleFromNode(n);
  +      DTM dtm = getDTM(nodeHandle);
  +      String strVal = dtm.getStringValue(nodeHandle);
  +      return strVal;
  +    }
  +
  +    
     }
   
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.18.2.3  +11 -3     xml-xalan/java/src/org/apache/xpath/axes/AxesWalker.java
  
  Index: AxesWalker.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/axes/AxesWalker.java,v
  retrieving revision 1.18.2.2
  retrieving revision 1.18.2.3
  diff -u -r1.18.2.2 -r1.18.2.3
  --- AxesWalker.java   2001/05/06 02:09:49     1.18.2.2
  +++ AxesWalker.java   2001/05/17 05:38:48     1.18.2.3
  @@ -1024,7 +1024,7 @@
   
       int current = this.getCurrentNode();
   
  -    // %TBD%
  +    // %NODETESTFILTER%
   //    if (current.isSupported(FEATURE_NODETESTFILTER, "1.0"))
   //      ((NodeTestFilter) current).setNodeTest(this);
   
  @@ -1368,13 +1368,21 @@
      */
     private DTM m_dtm;
     
  -  // %TBD% Doc 
  +  /**
  +   * Set the DTM for this walker.
  +   * 
  +   * @param dtm Non-null reference to a DTM.
  +   */
     public void setDefaultDTM(DTM dtm)
     {
       m_dtm = dtm;
     }
     
  -  // %TBD% Doc 
  +  /**
  +   * Get the DTM for this walker.
  +   * 
  +   * @return Non-null reference to a DTM.
  +   */
     public DTM getDTM(int node)
     {
       //
  
  
  
  1.6.2.2   +1 -1      
xml-xalan/java/src/org/apache/xpath/axes/ChildWalkerMultiStep.java
  
  Index: ChildWalkerMultiStep.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/ChildWalkerMultiStep.java,v
  retrieving revision 1.6.2.1
  retrieving revision 1.6.2.2
  diff -u -r1.6.2.1 -r1.6.2.2
  --- ChildWalkerMultiStep.java 2001/04/10 18:45:15     1.6.2.1
  +++ ChildWalkerMultiStep.java 2001/05/17 05:38:48     1.6.2.2
  @@ -95,7 +95,7 @@
   
       int current = this.getCurrentNode();
       
  -    // %TBD%
  +    // %NODETESTFILTER%
   //    if (current.isSupported(FEATURE_NODETESTFILTER, "1.0"))
   //      ((NodeTestFilter) current).setNodeTest(this);
       DTM dtm = getDTM(m_root);
  
  
  
  1.14.2.3  +1 -1      
xml-xalan/java/src/org/apache/xpath/axes/FilterExprWalker.java
  
  Index: FilterExprWalker.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/FilterExprWalker.java,v
  retrieving revision 1.14.2.2
  retrieving revision 1.14.2.3
  diff -u -r1.14.2.2 -r1.14.2.3
  --- FilterExprWalker.java     2001/05/06 02:09:50     1.14.2.2
  +++ FilterExprWalker.java     2001/05/17 05:38:48     1.14.2.3
  @@ -259,7 +259,7 @@
         {
           int current = this.getCurrentNode();
   
  -        // %TBD%
  +        // %NODETESTFILTER%
   //        if (current instanceof NodeTestFilter)
   //          ((NodeTestFilter) current).setNodeTest(this);
   
  
  
  
  1.24.2.5  +2 -2      
xml-xalan/java/src/org/apache/xpath/axes/LocPathIterator.java
  
  Index: LocPathIterator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/LocPathIterator.java,v
  retrieving revision 1.24.2.4
  retrieving revision 1.24.2.5
  diff -u -r1.24.2.4 -r1.24.2.5
  --- LocPathIterator.java      2001/05/10 20:48:52     1.24.2.4
  +++ LocPathIterator.java      2001/05/17 05:38:48     1.24.2.5
  @@ -217,7 +217,7 @@
      */
     public void setEnvironment(Object environment)
     {
  -    // %TBD% ?
  +    // no-op for now.
     }
     
     /**
  @@ -531,7 +531,7 @@
      */
     private void resetToCachedList()
     {
  -    // %TBD% ? This doesn't seem to work so well...
  +    // %REVIEW% ? This doesn't seem to work so well...
       int pos = this.getCurrentPos();
   
       if ((null == m_cachedNodes) || (pos != 0))
  
  
  
  1.2.2.2   +1 -1      
xml-xalan/java/src/org/apache/xpath/axes/RootWalkerMultiStep.java
  
  Index: RootWalkerMultiStep.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/RootWalkerMultiStep.java,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- RootWalkerMultiStep.java  2001/04/10 18:45:18     1.2.2.1
  +++ RootWalkerMultiStep.java  2001/05/17 05:38:48     1.2.2.2
  @@ -107,7 +107,7 @@
   
       int current = this.getCurrentNode();
   
  -    // %TBD%
  +    // %NODETESTFILTER%
   //    if (current.isSupported(FEATURE_NODETESTFILTER, "1.0"))
   //      ((NodeTestFilter) current).setNodeTest(this);
   
  
  
  
  1.15.2.5  +2 -2      
xml-xalan/java/src/org/apache/xpath/axes/UnionPathIterator.java
  
  Index: UnionPathIterator.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/axes/UnionPathIterator.java,v
  retrieving revision 1.15.2.4
  retrieving revision 1.15.2.5
  diff -u -r1.15.2.4 -r1.15.2.5
  --- UnionPathIterator.java    2001/05/10 20:48:54     1.15.2.4
  +++ UnionPathIterator.java    2001/05/17 05:38:49     1.15.2.5
  @@ -667,7 +667,7 @@
     public int getLength()
     {
   
  -    // %TBD% ??
  +    // %REVIEW% ??
   //    resetToCachedList();
   
       return m_cachedNodes.getLength();
  @@ -732,7 +732,7 @@
      */
     public void setEnvironment(Object environment)
     {
  -    // %TBD% ?
  +    // no-op for now.
     }
     
     /**
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.2   +7 -8      
xml-xalan/java/src/org/apache/xpath/functions/FuncExtFunction.java
  
  Index: FuncExtFunction.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/functions/FuncExtFunction.java,v
  retrieving revision 1.7.2.1
  retrieving revision 1.7.2.2
  diff -u -r1.7.2.1 -r1.7.2.2
  --- FuncExtFunction.java      2001/04/10 18:45:29     1.7.2.1
  +++ FuncExtFunction.java      2001/05/17 05:38:50     1.7.2.2
  @@ -138,10 +138,8 @@
       }
   
       ExtensionsTable etable = xctxt.getExtensionsTable();
  -    // %TBD% Not sure why this won't compile
  -    Object val = null;
  -//    Object val = etable.extFunction(m_namespace, m_extensionName, argVec,
  -//                                    m_methodKey, xctxt);
  +    Object val = etable.extFunction(m_namespace, m_extensionName, argVec,
  +                                    m_methodKey, 
xctxt.getExpressionContext());
   
       if (null != val)
       {
  @@ -179,10 +177,11 @@
   //      {
   //        result = new XNodeSet((NodeIterator) val);
   //      }
  -//      else if (val instanceof Node)
  -//      {
  -//        result = new XNodeSet((Node) val);
  -//      }
  +      else if (val instanceof org.w3c.dom.Node)
  +      {
  +        result = new 
XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node)val), 
  +                              xctxt.getDTMManager());
  +      }
         else
         {
           result = new XObject(val);
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.8.2.3   +19 -13    xml-xalan/java/src/org/apache/xpath/objects/XObject.java
  
  Index: XObject.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/objects/XObject.java,v
  retrieving revision 1.8.2.2
  retrieving revision 1.8.2.3
  diff -u -r1.8.2.2 -r1.8.2.3
  --- XObject.java      2001/05/07 13:16:00     1.8.2.2
  +++ XObject.java      2001/05/17 05:38:50     1.8.2.3
  @@ -146,19 +146,25 @@
       {
         result = new XNumber(((Double) val).doubleValue());
       }
  -      // %TBD%
  -//    else if (val instanceof DocumentFragment)
  -//    {
  -//      result = new XRTreeFrag((DocumentFragment) val);
  -//    }
  -//    else if (val instanceof Node)
  -//    {
  -//      result = new XNodeSet((Node) val);
  -//    }
  -//    else if (val instanceof NodeIterator)
  -//    {
  -//      result = new XNodeSet((NodeIterator) val);
  -//    }
  +    else if (val instanceof org.w3c.dom.DocumentFragment)
  +    {
  +      // result = new XRTreeFrag((DocumentFragment) val);
  +      // %REVIEW%
  +      result = new XObject(val);
  +    }
  +    else if (val instanceof org.w3c.dom.traversal.NodeIterator)
  +    {
  +      // result = new XNodeSet((NodeIterator) val);
  +      // %REVIEW%
  +      result = new XObject(val);
  +    }
  +    else if (val instanceof org.w3c.dom.Node)
  +    {
  +      // result = new 
XNodeSet(xctxt.getDTMHandleFromNode((org.w3c.dom.Node)val), 
  +      //                      xctxt.getDTMManager());
  +      // %REVIEW%
  +      result = new XObject(val);
  +    }
       else
       {
         result = new XObject(val);
  
  
  

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

Reply via email to