You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-cvs@xml.apache.org by zi...@apache.org on 2004/01/12 10:07:15 UTC

cvs commit: xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal ByNameRuntimeBindingType.java

zieg        2004/01/12 01:07:15

  Modified:    v2/src/marshal/org/apache/xmlbeans/impl/marshal
                        ByNameRuntimeBindingType.java
  Log:
  match no namespace uri to "" or null to deal with different 173 impls
  
  Revision  Changes    Path
  1.17      +16 -8     xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/ByNameRuntimeBindingType.java
  
  Index: ByNameRuntimeBindingType.java
  ===================================================================
  RCS file: /home/cvs/xml-xmlbeans/v2/src/marshal/org/apache/xmlbeans/impl/marshal/ByNameRuntimeBindingType.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ByNameRuntimeBindingType.java	12 Jan 2004 07:26:01 -0000	1.16
  +++ ByNameRuntimeBindingType.java	12 Jan 2004 09:07:15 -0000	1.17
  @@ -180,11 +180,8 @@
               final Property prop = properties[i];
               if (prop.isAttribute()) continue;
   
  -            QName qn = prop.getQName();
  -            if (qn.getLocalPart().equals(localname) &&
  -                qn.getNamespaceURI().equals(uri)) {
  +            if (doesPropMatch(uri, localname, prop))
                   return prop;
  -            }
           }
           return null;
       }
  @@ -197,13 +194,24 @@
               final Property prop = properties[i];
               if (!prop.isAttribute()) continue;
   
  -            QName qn = prop.getQName();
  -            if (qn.getLocalPart().equals(localname) &&
  -                qn.getNamespaceURI().equals(uri)) {
  +            if (doesPropMatch(uri, localname, prop))
                   return prop;
  -            }
           }
           return null;
  +    }
  +
  +    private static boolean doesPropMatch(String uri,
  +                                         String localname,
  +                                         Property prop)
  +    {
  +        final QName qn = prop.getQName();
  +
  +        if (qn.getLocalPart().equals(localname)) {
  +            //QNames always uses "" for no namespace, but the incoming uri
  +            //might use null or "".
  +            return qn.getNamespaceURI().equals(uri == null ? "" : uri);
  +        }
  +        return false;
       }
   
       public int getPropertyCount()
  
  
  

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