You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by aj...@apache.org on 2006/04/21 15:09:16 UTC

svn commit: r395875 - /webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchema.java

Author: ajith
Date: Fri Apr 21 06:09:14 2006
New Revision: 395875

URL: http://svn.apache.org/viewcvs?rev=395875&view=rev
Log:
The write method of the XMLSchema always serialized all the schemas (including imported ones) and took the first schema. This is wrong behavior
1.Changed the default behavior to serialize only the relevant schema
2.Added a new method to get all schemas as DOM documents

Modified:
    webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchema.java

Modified: webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchema.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchema.java?rev=395875&r1=395874&r2=395875&view=diff
==============================================================================
--- webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchema.java (original)
+++ webservices/commons/trunk/modules/XmlSchema/src/org/apache/ws/commons/schema/XmlSchema.java Fri Apr 21 06:09:14 2006
@@ -202,9 +202,17 @@
         serialize_internal(this, writer);
     }
 
+    public Document[] getAllSchemas() {
+        try {
+            return XmlSchemaSerializer.serializeSchema(this, true);
+        } catch (XmlSchemaSerializer.XmlSchemaSerializerException e) {
+            throw new XmlSchemaException(e.getMessage());
+        }
+    }
+
     private static void serialize_internal(XmlSchema schema, Writer out) {
         try {
-            Document[] serializedSchemas = XmlSchemaSerializer.serializeSchema(schema, true);
+            Document[] serializedSchemas = XmlSchemaSerializer.serializeSchema(schema, false);
             TransformerFactory trFac = TransformerFactory.newInstance();
             Source source = new DOMSource(serializedSchemas[0]);
             Result result = new StreamResult(out);