cziegeler    01/07/05 02:11:26

  Modified:    src/org/apache/cocoon/xml/dom Tag: cocoon_20_branch
                        DOMStreamer.java
  Log:
  Fixed element and attribute handling of namespaces
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.1.1.2.1 +10 -10    xml-cocoon2/src/org/apache/cocoon/xml/dom/DOMStreamer.java
  
  Index: DOMStreamer.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/xml/dom/DOMStreamer.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
  --- DOMStreamer.java  2001/05/09 20:49:32     1.1.1.1
  +++ DOMStreamer.java  2001/07/05 09:11:25     1.1.1.1.2.1
  @@ -34,7 +34,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:32 $
  + * @version CVS $Revision: 1.1.1.1.2.1 $ $Date: 2001/07/05 09:11:25 $
    */
   public class DOMStreamer extends AbstractXMLProducer {
   
  @@ -176,11 +176,11 @@
               if (map.item(x).getNodeType()!=Node.ATTRIBUTE_NODE) continue;
               Attr a=(Attr)map.item(x);
               // Start getting and normalizing the values from the attribute
  -            String uri=a.getNamespaceURI(); uri=(uri==null)?"":uri;
  -            String pre=a.getPrefix();       pre=(pre==null)?"":pre;
  -            String loc=a.getLocalName();    loc=(loc==null)?"":loc;
  -            String raw=a.getName();         raw=(raw==null)?"":raw;
  -            String val=a.getValue();        val=(val==null)?"":val;
  +            String uri=a.getNamespaceURI(); uri= (uri==null ? "" : uri);
  +            String pre=a.getPrefix();       pre= (pre==null ? "" : pre);
  +            String raw=a.getName();         raw= (raw==null ? "" : raw);
  +            String loc=a.getLocalName();    loc= (loc==null ? raw : loc);
  +            String val=a.getValue();        val= (val==null ? "" : val);
               // Check if we need to declare the start of a namespace prefix
               // Should we rely on URI instead of prefixes???
               if (raw.equals("xmlns") || raw.startsWith("xmlns:")) {
  @@ -192,10 +192,10 @@
               atts.addAttribute(uri,loc,raw,"CDATA",val);
           }
           // Get and normalize values for the Element
  -        String uri=n.getNamespaceURI(); uri=(uri==null)?"":uri;
  -        String pre=n.getPrefix();       pre=(pre==null)?"":pre;
  -        String loc=n.getLocalName();    loc=(loc==null)?"":loc;
  -        String raw=n.getTagName();      raw=(raw==null)?"":raw;
  +        String uri=n.getNamespaceURI(); uri= (uri==null ? "" : uri);
  +        String pre=n.getPrefix();       pre= (pre==null ? "" : pre);
  +        String raw=n.getTagName();      raw= (raw==null ? "" : raw);
  +        String loc=n.getLocalName();    loc= (loc==null ? raw : loc);
           super.contentHandler.startElement(uri,loc,raw,atts);
           this.processChildren(n);
           super.contentHandler.endElement(uri,loc,raw);
  
  
  

----------------------------------------------------------------------
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