You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by ks...@apache.org on 2002/02/22 23:38:55 UTC

cvs commit: xml-xindice/java/src/org/apache/xindice/xml/dom NodeImpl.java

kstaken     02/02/22 14:38:55

  Modified:    java/src/org/apache/xindice/xml/dom NodeImpl.java
  Log:
  Adding fix for attribute in default namespace bug.
  Submitted by: Mike Gratton
  Reviewed by: Kimbro Staken
  
  Revision  Changes    Path
  1.2       +5 -4      xml-xindice/java/src/org/apache/xindice/xml/dom/NodeImpl.java
  
  Index: NodeImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/xml/dom/NodeImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- NodeImpl.java	6 Dec 2001 19:34:00 -0000	1.1
  +++ NodeImpl.java	22 Feb 2002 22:38:55 -0000	1.2
  @@ -56,7 +56,7 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    *
  - * $Id: NodeImpl.java,v 1.1 2001/12/06 19:34:00 bradford Exp $
  + * $Id: NodeImpl.java,v 1.2 2002/02/22 22:38:55 kstaken Exp $
    */
   
   import org.apache.xindice.core.*;
  @@ -765,9 +765,10 @@
       * @return The URI (or null)
       */
      public final String lookupDefaultNamespaceURI() {
  -      String uri = null;
  -      if ( getNodeType() == Node.ELEMENT_NODE )
  -         uri = ((Element)this).getAttribute(XMLNS_PREFIX);
  +      if ( getNodeType() != Node.ELEMENT_NODE )
  +         return null;
  +
  +      String uri = ((Element)this).getAttribute(XMLNS_PREFIX);
         if ( uri != null && uri.length() > 0 )
            return uri;
         return parentNode != null ? parentNode.lookupDefaultNamespaceURI()