You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sb...@locus.apache.org on 2000/02/22 04:47:41 UTC

cvs commit: xml-xalan/src/org/apache/xalan/xslt TreeWalker2Result.java XSLTEngineImpl.java

sboag       00/02/21 19:47:41

  Modified:    src/org/apache/xalan/xslt TreeWalker2Result.java
                        XSLTEngineImpl.java
  Log:
  Don't use exclude-namespace stuff for xsl:copy-of, make sure namespaces aren't duplicated when they don't need to be for xsl:copy-of.
  
  Revision  Changes    Path
  1.2       +20 -5     xml-xalan/src/org/apache/xalan/xslt/TreeWalker2Result.java
  
  Index: TreeWalker2Result.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/TreeWalker2Result.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TreeWalker2Result.java	2000/02/21 20:44:51	1.1
  +++ TreeWalker2Result.java	2000/02/22 03:47:40	1.2
  @@ -40,7 +40,8 @@
     {
       if((Node.ELEMENT_NODE == node.getNodeType()) && (m_startNode == node))
       {
  -      m_processor.m_resultTreeHandler.startElement (node.getNodeName());
  +      String elemName = node.getNodeName();
  +      m_processor.m_resultTreeHandler.startElement (elemName);
           
         for(Node parent = node; parent != null; parent = parent.getParentNode())
         {
  @@ -84,15 +85,29 @@
             
             // Make sure namespace is not in the excluded list then
             // add to result tree
  -          if((nsDeclPrefix == null) ||!(m_elem.shouldExcludeResultNamespaceNode(m_elem, nsDeclPrefix, value)))
  -          {  
  -            if(!m_processor.m_pendingAttributes.contains(name))
  +          // if((nsDeclPrefix == null)  ||!(m_elem.shouldExcludeResultNamespaceNode(m_elem, nsDeclPrefix, value)))
  +          if(!m_processor.m_pendingAttributes.contains(name))
  +          {
  +            if(nsDeclPrefix == null)
  +            {  
                 m_processor.m_pendingAttributes.addAttribute(name, "CDATA", value);
  +            }
  +            else
  +            {
  +              String desturi = m_processor.getResultNamespaceForPrefix(nsDeclPrefix);
  +              if(null == desturi)
  +              {
  +                m_processor.m_pendingAttributes.addAttribute(name, "CDATA", value);
  +              }
  +              else if(!desturi.equals(value))
  +              {
  +                m_processor.m_pendingAttributes.addAttribute(name, "CDATA", value);
  +              }
  +            }
             }
           }
   
         }
  -      
         m_elem.processResultNS(m_processor);           
         
       }
  
  
  
  1.43      +3 -2      xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java
  
  Index: XSLTEngineImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/src/org/apache/xalan/xslt/XSLTEngineImpl.java,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- XSLTEngineImpl.java	2000/02/21 08:14:28	1.42
  +++ XSLTEngineImpl.java	2000/02/22 03:47:40	1.43
  @@ -3931,6 +3931,7 @@
       public void startElement (String name)
         throws SAXException
       {
  +      // name = excludePrefix(name);
         flushPending();
         m_resultNameSpaces.push(m_emptyNamespace);
         m_pendingElementName = name;
  @@ -3943,7 +3944,7 @@
       public void startElement (String name, AttributeList atts)
         throws SAXException
       {
  -      name = excludePrefix(name);
  +      // name = excludePrefix(name);
         flushPending();
         int nAtts = atts.getLength();
         m_pendingAttributes.clear();
  @@ -3963,7 +3964,7 @@
       public void endElement (String name)
         throws SAXException
       {
  -      name = excludePrefix(name);
  +      // name = excludePrefix(name);
         flushPending();
         m_flistener.endElement(name);
         if(null != m_traceListeners)