cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r819076 - in /cxf/branches/2.1.x-fixes: ./ common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java common/common/src/main/java/org/apache/cxf/staxutils/StreamWriterContentHandler.java
Date Sat, 26 Sep 2009 00:43:16 GMT
Author: dkulp
Date: Sat Sep 26 00:43:15 2009
New Revision: 819076

URL: http://svn.apache.org/viewvc?rev=819076&view=rev
Log:
Merged revisions 819017 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r819017 | dkulp | 2009-09-25 17:20:17 -0400 (Fri, 25 Sep 2009) | 10 lines
  
  Merged revisions 819016 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r819016 | dkulp | 2009-09-25 17:19:07 -0400 (Fri, 25 Sep 2009) | 2 lines
    
    [CXF-2447] Fix problems of creating a default bus in SpringDM/OSGI when
    using the stax parser built into the Java6 jdk.
  ........
................

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
    cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StreamWriterContentHandler.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java?rev=819076&r1=819075&r2=819076&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
(original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StaxUtils.java
Sat Sep 26 00:43:15 2009
@@ -337,18 +337,22 @@
     public static void copy(Source source, XMLStreamWriter writer) throws XMLStreamException
{
         if (source instanceof SAXSource) {
             InputSource src = ((SAXSource)source).getInputSource();
-            if (src.getByteStream() == null && src.getCharacterStream() == null
-                && src.getSystemId() == null && src.getPublicId() == null
+            if (src.getSystemId() == null && src.getPublicId() == null
                 && ((SAXSource)source).getXMLReader() != null) {
-                //OK - reader is OK.  We'll dump that out
+                
+                //OK - reader is OK.  We'll use that out
                 StreamWriterContentHandler ch = new StreamWriterContentHandler(writer);
                 XMLReader reader = ((SAXSource)source).getXMLReader();
                 reader.setContentHandler(ch);
                 try {
+                    try {
+                        reader.setFeature("http://xml.org/sax/features/namespaces", true);
+                    } catch (Throwable t) {
+                        //ignore
+                    }
                     reader.parse(((SAXSource)source).getInputSource());
                     return;
                 } catch (Exception e) {
-                    e.printStackTrace();
                     throw new XMLStreamException(e);
                 }
             }

Modified: cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StreamWriterContentHandler.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StreamWriterContentHandler.java?rev=819076&r1=819075&r2=819076&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StreamWriterContentHandler.java
(original)
+++ cxf/branches/2.1.x-fixes/common/common/src/main/java/org/apache/cxf/staxutils/StreamWriterContentHandler.java
Sat Sep 26 00:43:15 2009
@@ -210,7 +210,11 @@
                 int attCount = atts.getLength();
                 for (int i = 0; i < attCount; i++) {
                     if (StringUtils.isEmpty(atts.getURI(i))) {
-                        writer.writeAttribute(atts.getLocalName(i),
+                        String s = atts.getLocalName(i);
+                        if (StringUtils.isEmpty(s)) {
+                            s = atts.getQName(i);
+                        }
+                        writer.writeAttribute(s,
                                               atts.getValue(i));
                     } else {
                         writer.writeAttribute(atts.getURI(i),



Mime
View raw message