You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ne...@apache.org on 2002/05/12 14:55:11 UTC

cvs commit: xml-xerces/java/src/org/apache/xerces/impl XMLNamespaceBinder.java

neeraj      02/05/12 05:55:11

  Modified:    java/src/org/apache/xerces/impl XMLNamespaceBinder.java
  Log:
  <foo xmlns:a="blah" a="blah"> shouldn't give error.
  Thanks to Pavani for the patch.
  
  Revision  Changes    Path
  1.14      +9 -5      xml-xerces/java/src/org/apache/xerces/impl/XMLNamespaceBinder.java
  
  Index: XMLNamespaceBinder.java
  ===================================================================
  RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLNamespaceBinder.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XMLNamespaceBinder.java	23 Jan 2002 15:31:21 -0000	1.13
  +++ XMLNamespaceBinder.java	12 May 2002 12:55:11 -0000	1.14
  @@ -95,7 +95,7 @@
    *
    * @author Andy Clark, IBM
    *
  - * @version $Id: XMLNamespaceBinder.java,v 1.13 2002/01/23 15:31:21 rahuls Exp $
  + * @version $Id: XMLNamespaceBinder.java,v 1.14 2002/05/12 12:55:11 neeraj Exp $
    */
   public class XMLNamespaceBinder
       implements XMLComponent, XMLDocumentFilter {
  @@ -811,14 +811,18 @@
           for (int i = 0; i < attrCount - 1; i++) {
               String alocalpart = attributes.getLocalName(i);
               String auri = attributes.getURI(i);
  +            String arawName = attributes.getQName(i);
               for (int j = i + 1; j < attrCount; j++) {
                   String blocalpart = attributes.getLocalName(j);
                   String buri = attributes.getURI(j);
  +                String brawName = attributes.getQName(j);
                   if (alocalpart == blocalpart && auri == buri) {
  -                    fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
  -                                               "AttributeNSNotUnique",
  -                                               new Object[]{element.rawname,alocalpart, auri},
  -                                               XMLErrorReporter.SEVERITY_FATAL_ERROR);
  +                    if ((arawName == brawName) ||  (!arawName.startsWith("xmlns") && !brawName.startsWith("xmlns"))) {
  +                        fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
  +                                                   "AttributeNSNotUnique",
  +                                                   new Object[]{element.rawname,alocalpart, auri},
  +                                                   XMLErrorReporter.SEVERITY_FATAL_ERROR);
  +                    }
                   }
               }
           }
  
  
  

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