santiagopg    2003/03/12 11:57:09

  Modified:    java/src/org/apache/xml/utils Tag: jdk-1_4_2 DOMBuilder.java
  Log:
   Use DOM L2 calls to properly handle namespaces (jdk-1_4_2 branch).
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.11.6.1  +8 -8      xml-xalan/java/src/org/apache/xml/utils/DOMBuilder.java
  
  Index: DOMBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/DOMBuilder.java,v
  retrieving revision 1.11
  retrieving revision 1.11.6.1
  diff -u -r1.11 -r1.11.6.1
  --- DOMBuilder.java   10 Jul 2002 21:44:21 -0000      1.11
  +++ DOMBuilder.java   12 Mar 2003 19:57:09 -0000      1.11.6.1
  @@ -325,15 +325,15 @@
     
             String attrNS = atts.getURI(i);
             
  -          if("".equals(attrNS))
  -            attrNS = null; // DOM represents no-namespace as null
  -  
  -          // System.out.println("attrNS: "+attrNS+", localName: "+atts.getQName(i)
  -          //                   +", qname: "+atts.getQName(i)+", value: 
"+atts.getValue(i));
  -          // Crimson won't let us set an xmlns: attribute on the DOM.
             String attrQName = atts.getQName(i);
  -          // ALWAYS use the DOM Level 2 call!
  -          elem.setAttributeNS(attrNS,attrQName, atts.getValue(i));
  +          if((attrQName.equals("xmlns") || attrQName.startsWith("xmlns:")) )
  +          {
  +            elem.setAttributeNS("http://www.w3.org/2000/xmlns/",attrQName, 
atts.getValue(i));
  +          }
  +          else
  +          {
  +             elem.setAttributeNS(atts.getURI(i),attrQName, atts.getValue(i));
  +          }
           }
         }
         
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to