geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r219766 - in /geronimo/branches/v1_0_M4-QA/modules: axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
Date Tue, 19 Jul 2005 19:49:00 GMT
Author: djencks
Date: Tue Jul 19 12:49:00 2005
New Revision: 219766

URL: http://svn.apache.org/viewcvs?rev=219766&view=rev
Log:
GERONIMO-779. Help xmlbeans recognize schemas

Modified:
    geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
    geronimo/branches/v1_0_M4-QA/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java

Modified: geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java?rev=219766&r1=219765&r2=219766&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/SchemaInfoBuilder.java
Tue Jul 19 12:49:00 2005
@@ -86,16 +86,19 @@
     private static final QName LOCATION_QNAME = new QName("", "location");
 
     static {
-        URL url = WSDescriptorParser.class.getClassLoader().getResource("soap_encoding_1_1.xsd");
-        if (url == null) {
+        InputStream is = WSDescriptorParser.class.getClassLoader().getResourceAsStream("soap_encoding_1_1.xsd");
+        if (is == null) {
             throw new RuntimeException("Could not locate soap encoding schema");
         }
-        Collection errors = new ArrayList();
-        XmlOptions xmlOptions = new XmlOptions();
-        xmlOptions.setErrorListener(errors);
+        ArrayList errors = new ArrayList();
+        XmlOptions xmlOptions = SchemaConversionUtils.createXmlOptions(errors);
         try {
-            XmlObject xmlObject = SchemaConversionUtils.parse(url);
-            basicTypeSystem = XmlBeans.compileXsd(new XmlObject[]{xmlObject}, XmlBeans.getBuiltinTypeSystem(),
xmlOptions);
+            SchemaDocument parsed = SchemaDocument.Factory.parse(is, xmlOptions);
+            if (errors.size() != 0) {
+                throw new XmlException(errors.toArray().toString());
+            }
+
+            basicTypeSystem = XmlBeans.compileXsd(new XmlObject[]{parsed}, XmlBeans.getBuiltinTypeSystem(),
xmlOptions);
             if (errors.size() > 0) {
                 throw new RuntimeException("Could not compile schema type system: errors:
" + errors);
             }

Modified: geronimo/branches/v1_0_M4-QA/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/v1_0_M4-QA/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java?rev=219766&r1=219765&r2=219766&view=diff
==============================================================================
--- geronimo/branches/v1_0_M4-QA/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
(original)
+++ geronimo/branches/v1_0_M4-QA/modules/j2ee-schema/src/java/org/apache/geronimo/schema/SchemaConversionUtils.java
Tue Jul 19 12:49:00 2005
@@ -90,7 +90,7 @@
         return parsed;
     }
 
-    private static XmlOptions createXmlOptions(ArrayList errors) {
+    public static XmlOptions createXmlOptions(ArrayList errors) {
         XmlOptions options = new XmlOptions();
         options.setLoadLineNumbers();
         options.setErrorListener(errors);



Mime
View raw message