cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1492333 - /cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Date Wed, 12 Jun 2013 18:31:38 GMT
Author: dkulp
Date: Wed Jun 12 18:31:37 2013
New Revision: 1492333

URL: http://svn.apache.org/r1492333
Log:
Merged revisions 1492325 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1492325 | dkulp | 2013-06-12 14:25:09 -0400 (Wed, 12 Jun 2013) | 10 lines

  Merged revisions 1492301 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1492301 | dkulp | 2013-06-12 13:39:26 -0400 (Wed, 12 Jun 2013) | 2 lines

    [CXF-5070] Map the CDATA things in other places as well

  ........

........

Modified:
    cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java

Modified: cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=1492333&r1=1492332&r2=1492333&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Wed Jun 12 18:31:37 2013
@@ -662,7 +662,7 @@ public class JAXBDataBinding implements 
                 is.setPublicId(key);
                 opts.addGrammar(is);
                 try {
-                    schemaCompiler.parseSchema(key, StaxUtils.createXMLStreamReader(ele,
key));
+                    schemaCompiler.parseSchema(key, createNoCDATAReader(StaxUtils.createXMLStreamReader(ele,
key)));
                 } catch (XMLStreamException e) {
                     throw new ToolException(e);
                 }
@@ -687,7 +687,7 @@ public class JAXBDataBinding implements 
                     }
 
                     XMLStreamReader reader = StaxUtils.createXMLStreamReader(key, in);
-                    reader = new LocationFilterReader(reader, catalog);
+                    reader = createNoCDATAReader(new LocationFilterReader(reader, catalog));
                     InputSource is = new InputSource(key);
                     opts.addGrammar(is);
                     schemaCompiler.parseSchema(key, reader);
@@ -726,12 +726,7 @@ public class JAXBDataBinding implements 
                 is.setPublicId(key);
                 opts.addGrammar(is);
                 try {
-                    XMLStreamReader reader = new StreamReaderDelegate(StaxUtils.createXMLStreamReader(ele,
key)) {
-                        public int next() throws XMLStreamException {
-                            int i = super.next();
-                            return i == XMLStreamReader.CDATA ? XMLStreamReader.CHARACTERS
: i;
-                        }
-                    };
+                    XMLStreamReader reader = createNoCDATAReader(StaxUtils.createXMLStreamReader(ele,
key));
                     schemaCompiler.parseSchema(key, reader);
                 } catch (XMLStreamException e) {
                     throw new RuntimeException(e);
@@ -740,6 +735,15 @@ public class JAXBDataBinding implements 
         }
 
     }
+    
+    private XMLStreamReader createNoCDATAReader(final XMLStreamReader reader) {
+        return new StreamReaderDelegate(reader) {
+            public int next() throws XMLStreamException {
+                int i = super.next();
+                return i == XMLStreamReader.CDATA ? XMLStreamReader.CHARACTERS : i;
+            }
+        };
+    }
     private String getPluginUsageString(Options opts) {
         StringBuilder buf = new StringBuilder();
         buf.append("\nAvailable plugin options:\n");



Mime
View raw message