xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mm...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/templates ElemTemplateElement.java
Date Thu, 13 Sep 2001 14:52:27 GMT
mmidy       01/09/13 07:52:27

  Modified:    java/src/org/apache/xalan/templates ElemTemplateElement.java
  Log:
  Bug 3442: when building the prefix table for an element, just override prefixes defined
in parent element with uris that have been redefined by the element instead of keeping both
uris in the table.
  
  Revision  Changes    Path
  1.43      +26 -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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- ElemTemplateElement.java	2001/08/03 17:06:05	1.42
  +++ ElemTemplateElement.java	2001/09/13 14:52:27	1.43
  @@ -1012,6 +1012,7 @@
             decl = new XMLNSDecl(prefix, uri, shouldExclude);
   
           m_prefixTable.addElement(decl);
  +        
         }
       }
   
  @@ -1047,7 +1048,8 @@
                                    shouldExclude);
             }
             
  -          m_prefixTable.addElement(decl);
  +          //m_prefixTable.addElement(decl);
  +          addOrReplaceDecls(decl);
           }
         }
       }
  @@ -1057,6 +1059,29 @@
         // Must be stylesheet element without any result prefixes!
         m_prefixTable = new Vector();
       }
  +  }
  +  
  +  /**
  +   * Add or replace this namespace declaration in list
  +   * of namespaces in scope for this element.
  +   *
  +   * @param newDecl namespace declaration to add to list
  +   */
  +  void addOrReplaceDecls(XMLNSDecl newDecl)
  +  {
  +      int n = m_prefixTable.size();
  +
  +        for (int i = n - 1; i >= 0; i--)
  +        {
  +          XMLNSDecl decl = (XMLNSDecl) m_prefixTable.elementAt(i);
  +
  +          if (decl.getPrefix().equals(newDecl.getPrefix()))
  +          {
  +            return;
  +          }
  +        }
  +      m_prefixTable.addElement(newDecl);    
  +    
     }
     
     /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org


Mime
View raw message