You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by aj...@apache.org on 2007/06/16 07:04:32 UTC
svn commit: r547864 -
/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java
Author: ajith
Date: Fri Jun 15 22:04:32 2007
New Revision: 547864
URL: http://svn.apache.org/viewvc?view=rev&rev=547864
Log:
1. Adding the XML declaration support for the serialized schemas (AXIS2-2685). This depends on a newer change in the XMLSchema!
Modified:
webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java
Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java?view=diff&rev=547864&r1=547863&r2=547864
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java (original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/SchemaWriter.java Fri Jun 15 22:04:32 2007
@@ -3,8 +3,11 @@
import org.apache.axis2.util.FileWriter;
import org.apache.ws.commons.schema.XmlSchema;
+import javax.xml.transform.OutputKeys;
import java.io.File;
import java.io.FileOutputStream;
+import java.util.Map;
+import java.util.HashMap;
/*
* Copyright 2004,2005 The Apache Software Foundation.
*
@@ -41,7 +44,9 @@
".")),
".xsd");
FileOutputStream fos = new FileOutputStream(outputFile);
- schema.write(fos);
+
+ //set the options for the schemas
+ schema.write(fos,getDefaultOptionMap());
fos.flush();
fos.close();
}
@@ -49,5 +54,14 @@
throw new RuntimeException("Schema writing failed!", e);
}
}
+
+ private Map getDefaultOptionMap(){
+ Map options = new HashMap();
+ options.put(OutputKeys.OMIT_XML_DECLARATION,"no");
+ options.put(OutputKeys.INDENT,"yes");
+
+ return options;
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org