cziegeler    01/07/12 01:25:37

  Modified:    src/org/apache/cocoon/xml/dom Tag: cocoon_20_branch
                        DOMBuilder.java
  Log:
  Fixing dom level 2 problems. Namespace for namespace attributes now set
  correctly and new element without namespace get null as the namespace.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.1 +5 -5      xml-cocoon2/src/org/apache/cocoon/xml/dom/DOMBuilder.java
  
  Index: DOMBuilder.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/xml/dom/DOMBuilder.java,v
  retrieving revision 1.1.1.1
  retrieving revision 1.1.1.1.2.1
  diff -u -r1.1.1.1 -r1.1.1.1.2.1
  --- DOMBuilder.java   2001/05/09 20:49:31     1.1.1.1
  +++ DOMBuilder.java   2001/07/12 08:25:32     1.1.1.1.2.1
  @@ -36,7 +36,7 @@
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Pierpaolo Fumagalli</a>
    *         (Apache Software Foundation, Exoffice Technologies)
  - * @version CVS $Revision: 1.1.1.1 $ $Date: 2001/05/09 20:49:31 $
  + * @version CVS $Revision: 1.1.1.1.2.1 $ $Date: 2001/07/12 08:25:32 $
    */
   public class DOMBuilder implements XMLConsumer, Loggable {
       protected Logger log;
  @@ -110,7 +110,7 @@
        * <code>Node</code>, because the notification occurs at 
<code>endDocument()</code>
        * which does not happen here.
        */
  -    
  +
       public DOMBuilder(Node parentNode) {
           // Set the document as the owner of this node
           this.document = parentNode.getOwnerDocument();
  @@ -121,7 +121,7 @@
           // Go directly to BODY state
           this.state = S_BODY;
       }
  -        
  +
       /**     * Return the newly built Document.
        */
       public Document getDocument() {
  @@ -280,7 +280,7 @@
           // element check
           if(state!=S_BODY) throw new SAXException("Invalid state"+location());
           // Create the Element node
  -        Element e=this.document.createElementNS(n.getUri(),n.getQName());
  +        Element e=this.document.createElementNS(("".equals(n.getUri()) ? null : 
n.getUri()),n.getQName());
           // Process all attributes, leave out namespace attributes
           for(int x=0;x<a.getLength();x++) {
               String auri=a.getURI(x);
  @@ -301,7 +301,7 @@
                   dec=(NamespacesTable.Declaration)this.undecl.elementAt(x);
                   String aname="xmlns";
                   if (dec.getPrefix().length()>0) aname="xmlns:"+dec.getPrefix();
  -                e.setAttribute(aname,dec.getUri());
  +                e.setAttributeNS("http://www.w3.org/2000/xmlns/";, 
aname,dec.getUri());
               }
               this.undecl.clear();
           }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to