morten      01/08/03 07:18:21

  Modified:    java/src/org/apache/xalan/xsltc/dom DOMImpl.java
               java/src/org/apache/xalan/xsltc/trax SAX2DOM.java
  Log:
  Fix to get around problem with Crimson. Crimson does not like attribute-
  nodes to be created with 'null' or "" namespace URI. Added an if-test to
  invoke setAttribute(name, value) instead of setAttributeNS(uri, name, value).
  Had to add a little test to DOMImpl$DOMBuilder.makeAttributeNode() to get
  around an internal NPE problem.
  PR:           n/a
  Obtained from:        n.a
  Submitted by: [EMAIL PROTECTED]
  Reviewed by:  [EMAIL PROTECTED]
  
  Revision  Changes    Path
  1.16      +2 -2      
xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java
  
  Index: DOMImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/dom/DOMImpl.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DOMImpl.java      2001/08/02 15:08:19     1.15
  +++ DOMImpl.java      2001/08/03 14:18:21     1.16
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: DOMImpl.java,v 1.15 2001/08/02 15:08:19 morten Exp $
  + * @(#)$Id: DOMImpl.java,v 1.16 2001/08/03 14:18:21 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -2773,7 +2773,7 @@
            }
            else {
                final String uri = attList.getURI(i);
  -             if (!uri.equals(EMPTYSTRING)) {
  +             if ((uri != null) && (!uri.equals(EMPTYSTRING))) {
                    namebuf.append(uri);
                    namebuf.append(':');
                }
  
  
  
  1.3       +5 -2      
xml-xalan/java/src/org/apache/xalan/xsltc/trax/SAX2DOM.java
  
  Index: SAX2DOM.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/SAX2DOM.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- SAX2DOM.java      2001/08/02 13:25:11     1.2
  +++ SAX2DOM.java      2001/08/03 14:18:21     1.3
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: SAX2DOM.java,v 1.2 2001/08/02 13:25:11 morten Exp $
  + * @(#)$Id: SAX2DOM.java,v 1.3 2001/08/03 14:18:21 morten Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -121,7 +121,10 @@
            String namespaceuri = attrs.getURI(i);
            String value = attrs.getValue(i);
            String qname = attrs.getQName(i);
  -         tmp.setAttributeNS(namespaceuri, qname, value);
  +         if ((namespaceuri == null) || (namespaceuri.equals("")))
  +             tmp.setAttribute(qname, value);
  +         else
  +             tmp.setAttributeNS(namespaceuri, qname, value);
        }
        // append this new node onto current stack node
        Node last = (Node)_nodeStk.peek();
  
  
  

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

Reply via email to