sboag       01/03/05 21:50:25

  Modified:    java/src/org/apache/xalan/templates ElemElement.java
                        ElemForEach.java ElemLiteralResult.java
               java/src/org/apache/xalan/transformer
                        ClonerToResultTree.java QueuedSAXEvent.java
                        QueuedStartDocument.java QueuedStartElement.java
                        ResultTreeHandler.java TransformerImpl.java
                        TreeWalker2Result.java
  Log:
  Fix for http://nagoya.apache.org/bugzilla/show_bug.cgi?id=741.
  
  1) ResultTreeHandler now implements the TransformState interface.
  2) Queued state such as the current node and the current template is stored 
as part of QueuedStartElement.  Storage will only occur if the ContentHandler 
implements TransformClient.
  3) When state is requested (for instance TransformState#getCurrentElement()), 
if the queued element is null or not pending (for instance, in a characters 
event), it will get the state from the transformer, otherwise it will get the 
state from the queued element.
  
  Other fixes were attempted for this problem, including trying to
  get rid of queueing altogether, and flushing a bit earlier before
  the state was pushed on the various stacks, but both of
  these had show-stopping issues (see discussions
  on xalan-dev).
  
  Note that for the moment the ContextNodeList is node
  cloned as it needs to be in order for
  TransformState#getContextNodeList.
  
  Revision  Changes    Path
  1.17      +2 -2      
xml-xalan/java/src/org/apache/xalan/templates/ElemElement.java
  
  Index: ElemElement.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemElement.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ElemElement.java  2001/01/31 07:27:21     1.16
  +++ ElemElement.java  2001/03/06 05:50:22     1.17
  @@ -182,7 +182,7 @@
     {
       return Constants.ELEMNAME_ELEMENT_STRING;
     }
  -
  +  
     /**
      * Create an element in the result tree.
      * The xsl:element element allows an element to be created with a
  @@ -316,7 +316,7 @@
             }
     
             rhandler.startElement(elemNameSpace, QName.getLocalPart(elemName),
  -                                elemName);
  +                                elemName, null);
           }
         }
   
  
  
  
  1.18      +6 -2      
xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java
  
  Index: ElemForEach.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemForEach.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ElemForEach.java  2001/01/29 19:51:03     1.17
  +++ ElemForEach.java  2001/03/06 05:50:22     1.18
  @@ -465,10 +465,13 @@
               }
             }
   
  +          ElemTemplateElement t = template.m_firstChild;
  +            
             // If we are processing the default text rule, then just clone 
             // the value directly to the result tree.
             try
  -          {
  +          {              
  +            xctxt.pushCurrentNode(child);
               transformer.pushPairCurrentMatched(template, child);
   
               if (check)
  @@ -487,7 +490,7 @@
   
                 // Loop through the children of the template, calling execute 
on 
                 // each of them.
  -              for (ElemTemplateElement t = template.m_firstChild; t != null;
  +              for (; t != null;
                      t = t.m_nextSibling)
                 {
                   xctxt.setSAXLocator(t);
  @@ -503,6 +506,7 @@
             }
             finally
             {
  +            xctxt.popCurrentNode();
               transformer.popCurrentMatched();
   
               if (check)
  
  
  
  1.23      +2 -2      
xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java
  
  Index: ElemLiteralResult.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/templates/ElemLiteralResult.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- ElemLiteralResult.java    2001/02/13 20:28:57     1.22
  +++ ElemLiteralResult.java    2001/03/06 05:50:22     1.23
  @@ -677,7 +677,7 @@
         child.resolvePrefixTables();
       }
     }*/
  -
  +  
     /**
      * Copy a Literal Result Element into the Result tree, copy the
      * non-excluded namespace attributes, copy the attributes not
  @@ -701,7 +701,7 @@
   
         // Add namespace declarations.
         executeNSDecls(transformer);
  -      rhandler.startElement(getNamespace(), getLocalName(), getRawName());
  +      rhandler.startElement(getNamespace(), getLocalName(), getRawName(), 
null);
   
         try
         {
  
  
  
  1.9       +1 -1      
xml-xalan/java/src/org/apache/xalan/transformer/ClonerToResultTree.java
  
  Index: ClonerToResultTree.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/ClonerToResultTree.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ClonerToResultTree.java   2001/01/26 01:26:59     1.8
  +++ ClonerToResultTree.java   2001/03/06 05:50:23     1.9
  @@ -212,7 +212,7 @@
             String ns = dhelper.getNamespaceOfNode(node);
             String localName = dhelper.getLocalNameOfNode(node);
   
  -          m_rth.startElement(ns, localName, node.getNodeName());
  +          m_rth.startElement(ns, localName, node.getNodeName(), null);
           }
           break;
         case Node.CDATA_SECTION_NODE :
  
  
  
  1.7       +17 -2     
xml-xalan/java/src/org/apache/xalan/transformer/QueuedSAXEvent.java
  
  Index: QueuedSAXEvent.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/QueuedSAXEvent.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- QueuedSAXEvent.java       2001/01/07 04:19:17     1.6
  +++ QueuedSAXEvent.java       2001/03/06 05:50:23     1.7
  @@ -57,12 +57,13 @@
   package org.apache.xalan.transformer;
   
   import org.xml.sax.ContentHandler;
  -import javax.xml.transform.TransformerException;
   import org.xml.sax.Attributes;
   
   import org.apache.xalan.trace.TraceManager;
   import org.apache.xalan.trace.GenerateEvent;
   
  +import javax.xml.transform.TransformerException;
  +
   /**
    * Acts as a base class for queued SAX events.
    */
  @@ -95,6 +96,10 @@
     /** Instance of ContentHandler          */
     protected ContentHandler m_contentHandler;
   
  +  /** Flag indicating that the ContentHandler is a TransformerClient, 
  +   *  so we need to save the transform state of the queue. */
  +  protected boolean m_isTransformClient = false;
  +  
     /** Flag indicating that an event is pending          */
     public boolean isPending = false;
   
  @@ -103,7 +108,7 @@
   
     /** Type of SAX event          */
     private int m_type;
  -
  +  
     /**
      * Get the type of this SAX event 
      *
  @@ -175,6 +180,14 @@
     {
       m_contentHandler = ch;
     }
  +  
  +  /**
  +   * Tell this queued element if the content handler is a TransformerClient.
  +   */
  +  void setIsTransformClient(boolean b)
  +  {
  +    m_isTransformClient = b;
  +  }
   
     /**
      * Clear the pending event.
  @@ -194,6 +207,7 @@
     {
       isPending = b;
       this.isEnded = !isPending;
  +        
     }
   
     /**
  @@ -214,4 +228,5 @@
     {
       isPending = false;
     }
  +  
   }
  
  
  
  1.7       +3 -3      
xml-xalan/java/src/org/apache/xalan/transformer/QueuedStartDocument.java
  
  Index: QueuedStartDocument.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/QueuedStartDocument.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- QueuedStartDocument.java  2001/01/07 04:19:17     1.6
  +++ QueuedStartDocument.java  2001/03/06 05:50:23     1.7
  @@ -100,7 +100,7 @@
      *
      * @throws TransformerException
      */
  -  void flush() throws org.xml.sax.SAXException
  +  void flush(ResultTreeHandler rth) throws org.xml.sax.SAXException
     {
   
       if (isPending)
  @@ -111,12 +111,12 @@
         {
           fireGenerateEvent(GenerateEvent.EVENTTYPE_STARTDOCUMENT, null, null);
         }
  -
  +      
         ContentHandler chandler = getContentHandler();
   
         if ((null != chandler) && (chandler instanceof TransformerClient))
         {
  -        ((TransformerClient) chandler).setTransformState(m_transformer);
  +        ((TransformerClient) chandler).setTransformState(rth);
         }
   
         super.flush();
  
  
  
  1.8       +168 -4    
xml-xalan/java/src/org/apache/xalan/transformer/QueuedStartElement.java
  
  Index: QueuedStartElement.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/QueuedStartElement.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- QueuedStartElement.java   2001/01/07 04:19:17     1.7
  +++ QueuedStartElement.java   2001/03/06 05:50:23     1.8
  @@ -59,17 +59,26 @@
   import java.util.Vector;
   
   import org.xml.sax.ContentHandler;
  -import javax.xml.transform.TransformerException;
   import org.xml.sax.Attributes;
   
  +import javax.xml.transform.TransformerException;
  +import javax.xml.transform.Transformer;
  +
   import org.apache.xml.utils.MutableAttrListImpl;
  -import org.apache.xalan.trace.GenerateEvent;
   import org.apache.xml.utils.NameSpace;
   
  +import org.apache.xalan.trace.GenerateEvent;
  +
  +import org.apache.xalan.templates.ElemTemplateElement;
  +import org.apache.xalan.templates.ElemTemplate;
  +
  +import org.w3c.dom.Node;
  +import org.w3c.dom.traversal.NodeIterator;
  +
   /**
    * Tracks the state of a queued element event.
    */
  -public class QueuedStartElement extends QueuedSAXEvent
  +public class QueuedStartElement extends QueuedSAXEvent implements 
TransformState
   {
   
     /**
  @@ -106,6 +115,57 @@
   
     /** Local part of qualified name of the element           */
     private String m_localName;
  +  
  +  /**
  +   * The stylesheet element that produced the SAX event.
  +   */
  +  private ElemTemplateElement m_currentElement;
  +  
  +  /**
  +   * The current context node in the source tree.
  +   */
  +  private Node m_currentNode;
  +  
  +  /**
  +   * The xsl:template that is in effect, which may be a matched template
  +   * or a named template.
  +   */
  +  private ElemTemplate m_currentTemplate;
  +  
  +  /**
  +   * The xsl:template that was matched.
  +   */
  +  private ElemTemplate m_matchedTemplate;
  +  
  +  /**
  +   * The node in the source tree that matched
  +   * the template obtained via getMatchedTemplate().
  +   */
  +  private Node m_matchedNode;
  +  
  +  /**
  +   * The current context node list.
  +   */
  +  private NodeIterator m_contextNodeList;
  +  
  +  /**
  +   * Clear the pending event.
  +   */
  +  void clearPending()
  +  {
  +    super.clearPending();
  +    
  +    if(m_isTransformClient)
  +    {
  +      m_currentElement = null;
  +      m_currentNode = null;
  +      m_currentTemplate = null;
  +      m_matchedTemplate = null;
  +      m_matchedNode = null;
  +      m_contextNodeList = null; // TODO: Need to clone
  +    }
  +  }
  +
   
     /**
      * Set the pending element names.
  @@ -125,7 +185,18 @@
       if (null != atts)
         m_attributes.addAttributes(atts);
   
  -    setPending(true);
  +    super.setPending(true);
  +    
  +    if(m_isTransformClient)
  +    {
  +      m_currentElement = m_transformer.getCurrentElement();
  +      m_currentNode = m_transformer.getCurrentNode();
  +      m_currentTemplate = m_transformer.getCurrentTemplate();
  +      m_matchedTemplate = m_transformer.getMatchedTemplate();
  +      m_matchedNode = m_transformer.getMatchedNode();
  +      m_contextNodeList = m_transformer.getContextNodeList(); // TODO: Need 
to clone
  +    }
  +
     }
   
     /**
  @@ -297,4 +368,97 @@
         // super.flush();
       }
     }
  +  
  +  /**
  +   * Retrieves the stylesheet element that produced
  +   * the SAX event.
  +   *
  +   * <p>Please note that the ElemTemplateElement returned may
  +   * be in a default template, and thus may not be
  +   * defined in the stylesheet.</p>
  +   *
  +   * @return the stylesheet element that produced the SAX event.
  +   */
  +  public ElemTemplateElement getCurrentElement()
  +  {
  +    return m_currentElement;
  +  }
  +
  +  /**
  +   * This method retrieves the current context node
  +   * in the source tree.
  +   *
  +   * @return the current context node in the source tree.
  +   */
  +  public Node getCurrentNode()
  +  {
  +    return m_currentTemplate;
  +  }
  +  
  +  /**
  +   * This method retrieves the xsl:template
  +   * that is in effect, which may be a matched template
  +   * or a named template.
  +   *
  +   * <p>Please note that the ElemTemplate returned may
  +   * be a default template, and thus may not have a template
  +   * defined in the stylesheet.</p>
  +   *
  +   * @return the xsl:template that is in effect
  +   */
  +  public ElemTemplate getCurrentTemplate()
  +  {
  +    return m_currentTemplate;
  +  }
  +  
  +  /**
  +   * This method retrieves the xsl:template
  +   * that was matched.  Note that this may not be
  +   * the same thing as the current template (which
  +   * may be from getCurrentElement()), since a named
  +   * template may be in effect.
  +   *
  +   * <p>Please note that the ElemTemplate returned may
  +   * be a default template, and thus may not have a template
  +   * defined in the stylesheet.</p>
  +   *
  +   * @return the xsl:template that was matched.
  +   */
  +  public ElemTemplate getMatchedTemplate()
  +  {
  +    return m_matchedTemplate;
  +  }
  +
  +  /**
  +   * Retrieves the node in the source tree that matched
  +   * the template obtained via getMatchedTemplate().
  +   *
  +   * @return the node in the source tree that matched
  +   * the template obtained via getMatchedTemplate().
  +   */
  +  public Node getMatchedNode()
  +  {
  +    return m_matchedNode;
  +  }
  +  
  +  /**
  +   * Get the current context node list.
  +   *
  +   * @return the current context node list.
  +   */
  +  public NodeIterator getContextNodeList()
  +  {
  +    return m_contextNodeList;
  +  }
  +
  +  /**
  +   * Get the TrAX Transformer object in effect.
  +   *
  +   * @return the TrAX Transformer object in effect.
  +   */
  +  public Transformer getTransformer()
  +  {
  +    return m_transformer;
  +  }
  +
   }
  
  
  
  1.34      +128 -22   
xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java
  
  Index: ResultTreeHandler.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/ResultTreeHandler.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- ResultTreeHandler.java    2001/01/25 18:05:51     1.33
  +++ ResultTreeHandler.java    2001/03/06 05:50:23     1.34
  @@ -60,6 +60,8 @@
   
   import org.apache.xalan.templates.Stylesheet;
   import org.apache.xalan.templates.StylesheetRoot;
  +import org.apache.xalan.templates.ElemTemplate;
  +import org.apache.xalan.templates.ElemTemplateElement;
   import org.apache.xalan.trace.TraceManager;
   import org.apache.xalan.trace.GenerateEvent;
   import org.apache.xml.utils.MutableAttrListImpl;
  @@ -72,6 +74,7 @@
   import org.apache.xpath.XPathContext;
   
   import org.w3c.dom.Node;
  +import org.w3c.dom.traversal.NodeIterator;
   import org.w3c.dom.Attr;
   import org.w3c.dom.DocumentFragment;
   import org.w3c.dom.NodeList;
  @@ -82,9 +85,10 @@
   import org.xml.sax.ext.LexicalHandler;
   import org.xml.sax.helpers.NamespaceSupport;
   import org.xml.sax.Locator;
  -import javax.xml.transform.TransformerException;
   
  +import javax.xml.transform.TransformerException;
   import javax.xml.transform.ErrorListener;
  +import javax.xml.transform.Transformer;
   
   /**
    * This class is a layer between the direct calls to the result
  @@ -96,7 +100,7 @@
    * can call startElement.
    */
   public class ResultTreeHandler extends QueuedEvents
  -        implements ContentHandler, LexicalHandler
  +        implements ContentHandler, LexicalHandler, TransformState
   {
   
     /** Indicate whether running in Debug mode        */
  @@ -144,7 +148,9 @@
         m_lexicalHandler = (LexicalHandler) m_contentHandler;
       else
         m_lexicalHandler = null;
  -
  +      
  +    m_startElement.setIsTransformClient(m_contentHandler instanceof 
TransformerClient);
  +      
       m_cloner = new ClonerToResultTree(transformer, this);
   
       // The stylesheet is set at a rather late stage, so I do 
  @@ -200,23 +206,6 @@
      * @param ns Namespace URI of element
      * @param localName Local part of qname of element
      * @param name Name of element
  -   *
  -   * @throws org.xml.sax.SAXException
  -   */
  -  public void startElement(String ns, String localName, String name)
  -          throws org.xml.sax.SAXException
  -  {
  -    startElement(ns, localName, name, null);
  -  }
  -
  -  /**
  -   * Bottleneck the startElement event.  This is used to "pend" an
  -   * element, so that attributes can still be added to it before
  -   * the real "startElement" is called on the result tree listener.
  -   *
  -   * @param ns Namespace URI of element
  -   * @param localName Local part of qname of element
  -   * @param name Name of element
      * @param atts List of attributes for the element
      *
      * @throws org.xml.sax.SAXException
  @@ -755,7 +744,7 @@
   
       if ((type != EVT_STARTPREFIXMAPPING) && qdab.isPending)
       {
  -      qdab.flush();
  +      qdab.flush(this);
       }
   
       if ((null != qe) && qe.isPending)
  @@ -1109,6 +1098,7 @@
     {
   
       m_contentHandler = ch;
  +    m_startElement.setIsTransformClient(m_contentHandler instanceof 
TransformerClient);
   
       reInitEvents();
     }
  @@ -1322,8 +1312,124 @@
   
       return (null != qse) ? qse.isPending : false;
     }
  +  
  +  /**
  +   * Retrieves the stylesheet element that produced
  +   * the SAX event.
  +   *
  +   * <p>Please note that the ElemTemplateElement returned may
  +   * be in a default template, and thus may not be
  +   * defined in the stylesheet.</p>
  +   *
  +   * @return the stylesheet element that produced the SAX event.
  +   */
  +  public ElemTemplateElement getCurrentElement()
  +  {
  +    QueuedStartElement qe = getQueuedElem();
  +    if(null != qe && qe.isPending)
  +      return qe.getCurrentElement(); 
  +    else
  +      return m_transformer.getCurrentElement();
  +  }
   
     /**
  +   * This method retrieves the current context node
  +   * in the source tree.
  +   *
  +   * @return the current context node in the source tree.
  +   */
  +  public Node getCurrentNode()
  +  {
  +    QueuedStartElement qe = getQueuedElem();
  +    if(null != qe && qe.isPending)
  +      return qe.getCurrentNode();
  +    else
  +      return m_transformer.getCurrentNode();
  +  }
  +
  +  /**
  +   * This method retrieves the xsl:template
  +   * that is in effect, which may be a matched template
  +   * or a named template.
  +   *
  +   * <p>Please note that the ElemTemplate returned may
  +   * be a default template, and thus may not have a template
  +   * defined in the stylesheet.</p>
  +   *
  +   * @return the xsl:template that is in effect
  +   */
  +  public ElemTemplate getCurrentTemplate()
  +  {
  +    QueuedStartElement qe = getQueuedElem();
  +    if(null != qe && qe.isPending)
  +      return qe.getCurrentTemplate();
  +    else
  +      return m_transformer.getCurrentTemplate();
  +  }
  +
  +  /**
  +   * This method retrieves the xsl:template
  +   * that was matched.  Note that this may not be
  +   * the same thing as the current template (which
  +   * may be from getCurrentElement()), since a named
  +   * template may be in effect.
  +   *
  +   * <p>Please note that the ElemTemplate returned may
  +   * be a default template, and thus may not have a template
  +   * defined in the stylesheet.</p>
  +   *
  +   * @return the xsl:template that was matched.
  +   */
  +  public ElemTemplate getMatchedTemplate()
  +  {
  +    QueuedStartElement qe = getQueuedElem();
  +    if(null != qe && qe.isPending)
  +      return qe.getMatchedTemplate();
  +    else
  +      return m_transformer.getMatchedTemplate();
  +  }
  +
  +  /**
  +   * Retrieves the node in the source tree that matched
  +   * the template obtained via getMatchedTemplate().
  +   *
  +   * @return the node in the source tree that matched
  +   * the template obtained via getMatchedTemplate().
  +   */
  +  public Node getMatchedNode()
  +  {
  +    QueuedStartElement qe = getQueuedElem();
  +    if(null != qe && qe.isPending)
  +      return qe.getMatchedNode();
  +    else
  +      return m_transformer.getMatchedNode();
  +  }
  +
  +  /**
  +   * Get the current context node list.
  +   *
  +   * @return the current context node list.
  +   */
  +  public NodeIterator getContextNodeList()
  +  {
  +    QueuedStartElement qe = getQueuedElem();
  +    if(null != qe && qe.isPending)
  +      return qe.getContextNodeList();
  +    else
  +      return m_transformer.getContextNodeList();
  +  }
  +
  +  /**
  +   * Get the TrAX Transformer object in effect.
  +   *
  +   * @return the TrAX Transformer object in effect.
  +   */
  +  public Transformer getTransformer()
  +  {
  +    return m_transformer;
  +  }
  +
  +  /**
      * Use the SAX2 helper class to track result namespaces.
      */
     private NamespaceSupport m_nsSupport = new NamespaceSupport();
  @@ -1355,7 +1461,7 @@
   
     /** Prefix used to create unique prefix names          */
     private static final String S_NAMESPACEPREFIX = "ns";
  -
  +  
     /**
      * This class clones nodes to the result tree.
      */
  
  
  
  1.86      +11 -5     
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.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- TransformerImpl.java      2001/02/23 01:18:33     1.85
  +++ TransformerImpl.java      2001/03/06 05:50:24     1.86
  @@ -1989,6 +1989,8 @@
       // the value directly to the result tree.
       try
       {
  +      pushElemTemplateElement(template);
  +      m_xcontext.pushCurrentNode(child);
         pushPairCurrentMatched(template, child);
   
         if (isDefaultTextRule)
  @@ -2027,6 +2029,8 @@
           // also unclear that "execute" is really the right name for
           // that entry point.)
   
  +        m_xcontext.setSAXLocator(template);
  +
           if (template.isCompiledTemplate())
             template.execute(this, child, mode);
           else
  @@ -2039,7 +2043,9 @@
       }
       finally
       {
  +      m_xcontext.popCurrentNode();
         popCurrentMatched();
  +      popElemTemplateElement();
       }
   
       return true;
  @@ -2111,13 +2117,13 @@
     {
   
       // Does this element have any children?
  -    ElemTemplateElement firstChild = elem.getFirstChildElem();
  +    ElemTemplateElement t = elem.getFirstChildElem();
   
  -    if (null == firstChild)
  +    if (null == t)
         return;
  -
  +      
       XPathContext xctxt = getXPathContext();
  -
  +    
       // Check for infinite loops if we have to.
       boolean check = (m_stackGuard.m_recursionLimit > -1);
   
  @@ -2138,7 +2144,7 @@
   
         // Loop through the children of the template, calling execute on 
         // each of them.
  -      for (ElemTemplateElement t = firstChild; t != null;
  +      for (; t != null;
                 t = t.getNextSiblingElem())
         {
           if(!shouldAddAttrs && t.getXSLToken() == 
Constants.ELEMNAME_ATTRIBUTE)
  
  
  
  1.8       +1 -1      
xml-xalan/java/src/org/apache/xalan/transformer/TreeWalker2Result.java
  
  Index: TreeWalker2Result.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/transformer/TreeWalker2Result.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TreeWalker2Result.java    2000/12/13 17:23:04     1.7
  +++ TreeWalker2Result.java    2001/03/06 05:50:24     1.8
  @@ -133,7 +133,7 @@
           String localName = dhelper.getLocalNameOfNode(node);
           String namespace = dhelper.getNamespaceOfNode(node);
   
  -        m_handler.startElement(namespace, localName, elemName);
  +        m_handler.startElement(namespace, localName, elemName, null);
   
           for (Node parent = node; parent != null;
                parent = parent.getParentNode())
  
  
  

Reply via email to