You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by na...@apache.org on 2006/05/17 12:46:07 UTC

svn commit: r407216 - in /webservices/axis2/trunk/c: include/platforms/windows/ modules/platforms/windows/ modules/util/ modules/xml/attachments/ modules/xml/om/ modules/xml/soap/ modules/xml/xml_schema/ modules/xml/xml_schema/include/xml_schema/

Author: nandika
Date: Wed May 17 03:46:06 2006
New Revision: 407216

URL: http://svn.apache.org/viewcvs?rev=407216&view=rev
Log:
jira issue 153 patch applied to fix warnings on windows build 

Modified:
    webservices/axis2/trunk/c/include/platforms/windows/axis2_getopt_windows.h
    webservices/axis2/trunk/c/include/platforms/windows/axis2_windows.h
    webservices/axis2/trunk/c/modules/platforms/windows/getopt_windows.c
    webservices/axis2/trunk/c/modules/util/generic_obj.c
    webservices/axis2/trunk/c/modules/util/network_handler.c
    webservices/axis2/trunk/c/modules/xml/attachments/mime_body_part.c
    webservices/axis2/trunk/c/modules/xml/om/om_namespace.c
    webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c
    webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c
    webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
    webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema.h
    webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_collection.h
    webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_form.h
    webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema.c
    webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_builder.c
    webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.c

Modified: webservices/axis2/trunk/c/include/platforms/windows/axis2_getopt_windows.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/platforms/windows/axis2_getopt_windows.h?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/platforms/windows/axis2_getopt_windows.h (original)
+++ webservices/axis2/trunk/c/include/platforms/windows/axis2_getopt_windows.h Wed May 17 03:46:06 2006
@@ -16,9 +16,9 @@
  * @{
  */
 
-AXIS2_DECLARE_DATA  extern int	opterr;
-AXIS2_DECLARE_DATA  extern int 	optopt;	
-AXIS2_DECLARE_DATA  extern char	*optarg;
+AXIS2_DECLARE_DATA  int	opterr;
+AXIS2_DECLARE_DATA  int 	optopt;	
+AXIS2_DECLARE_DATA  char	*optarg;
 
 /**
   * return and log error

Modified: webservices/axis2/trunk/c/include/platforms/windows/axis2_windows.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/platforms/windows/axis2_windows.h?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/platforms/windows/axis2_windows.h (original)
+++ webservices/axis2/trunk/c/include/platforms/windows/axis2_windows.h Wed May 17 03:46:06 2006
@@ -61,11 +61,11 @@
 /* get opt */
 #include "axis2_getopt_windows.h"
 
-/* for minizip uncompression library */
+/* for minizip uncompression library 
 #define USEWIN32IOAPI
 #include "iowin32.h"
 
-
+*/
 /***************************************************************
  * Default paths to shared library/DLLs and files
  ***************************************************************

Modified: webservices/axis2/trunk/c/modules/platforms/windows/getopt_windows.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/platforms/windows/getopt_windows.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/platforms/windows/getopt_windows.c (original)
+++ webservices/axis2/trunk/c/modules/platforms/windows/getopt_windows.c Wed May 17 03:46:06 2006
@@ -7,7 +7,7 @@
 int		opterr = 1; /*default - log error*/
 int		optind = 1;
 int		optopt;
-char	*optarg;
+char*	optarg;
 
 #define AXIS2_OPT_ERR_NO_ARG			1
 #define	AXIS2_OPT_ERR_INVALID_OPTION	2

Modified: webservices/axis2/trunk/c/modules/util/generic_obj.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/generic_obj.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/generic_obj.c (original)
+++ webservices/axis2/trunk/c/modules/util/generic_obj.c Wed May 17 03:46:06 2006
@@ -152,7 +152,7 @@
 {
     axis2_generic_obj_impl_t *generic_obj_impl = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_ENV_CHECK(env, NULL);
     generic_obj_impl = AXIS2_INTF_TO_IMPL(generic_obj);
 
     return generic_obj_impl->value;

Modified: webservices/axis2/trunk/c/modules/util/network_handler.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/network_handler.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/network_handler.c (original)
+++ webservices/axis2/trunk/c/modules/util/network_handler.c Wed May 17 03:46:06 2006
@@ -83,11 +83,11 @@
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_SOCKET_ERROR, AXIS2_FAILURE);
         return AXIS2_INVALID_SOCKET;
     }
-	setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &nodelay, 
+	setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, (const char *)&nodelay, 
 						sizeof(nodelay));
 	ll.l_onoff = 1;
     ll.l_linger = 5;
-    setsockopt(sock, SOL_SOCKET, SO_LINGER , &ll, sizeof(struct linger));
+    setsockopt(sock, SOL_SOCKET, SO_LINGER , (const char *)&ll, sizeof(struct linger));
 	return sock;
 }
 
@@ -175,7 +175,7 @@
 	return AXIS2_FAILURE;    
 }
 
-AXIS2_DECLARE(axis2_socket_t)						
+AXIS2_DECLARE(int)						
 axis2_network_handler_svr_socket_accept(axis2_env_t **env, 
 						axis2_socket_t svr_socket)
 {

Modified: webservices/axis2/trunk/c/modules/xml/attachments/mime_body_part.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/attachments/mime_body_part.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/attachments/mime_body_part.c (original)
+++ webservices/axis2/trunk/c/modules/xml/attachments/mime_body_part.c Wed May 17 03:46:06 2006
@@ -16,6 +16,7 @@
  
 #include <axis2_mime_body_part.h>
 #include <axis2_data_handler.h>
+#include <memory.h>
 
 typedef struct axis2_mime_body_part_impl
 {

Modified: webservices/axis2/trunk/c/modules/xml/om/om_namespace.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/om_namespace.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/om_namespace.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/om_namespace.c Wed May 17 03:46:06 2006
@@ -16,7 +16,7 @@
 
 #include <axis2_om_namespace.h>
 #include <axis2_string.h>
-#include <axis2_om_namespace_internal.h>
+#include "axis2_om_namespace_internal.h"
 /**************************** Function Prototypes ******************************/
 
 axis2_status_t AXIS2_CALL 

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap11_builder_helper.c Wed May 17 03:46:06 2006
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
  
- #include <axis2_soap11_builder_helper.h>
+ #include "axis2_soap11_builder_helper.h"
  #include <axis2_om_stax_builder.h>
  #include <axis2_soap_builder.h>
  #include <axis2_soap_const.h>

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap12_builder_helper.c Wed May 17 03:46:06 2006
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
  
- #include <axis2_soap12_builder_helper.h>
+ #include "axis2_soap12_builder_helper.h"
  #include <axis2_array_list.h>
  #include "_axis2_soap_body.h"
  #include "_axis2_soap_fault.h"

Modified: webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/soap/soap_builder.c Wed May 17 03:46:06 2006
@@ -18,8 +18,8 @@
  #include <axis2_soap_message.h>
  #include "_axis2_soap_envelope.h"
  #include "_axis2_soap_header.h"
- #include <axis2_soap11_builder_helper.h>
- #include <axis2_soap12_builder_helper.h>
+ #include "axis2_soap11_builder_helper.h"
+ #include "axis2_soap12_builder_helper.h"
  #include <axis2_soap_const.h>
  #include "_axis2_soap_body.h"
  #include "_axis2_soap_header_block.h"

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema.h?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema.h (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema.h Wed May 17 03:46:06 2006
@@ -203,6 +203,11 @@
     add_type) (void *schema,
                     axis2_env_t **env,
                     struct axis2_xml_schema_type *type);
+                    
+    axis2_status_t (AXIS2_CALL *
+    set_schema_ns_prefix)(void *schema,
+                          axis2_env_t **env,
+                          axis2_char_t *ns_prefix);                    
 
 };
 
@@ -362,7 +367,13 @@
             
 #define AXIS2_XML_SCHEMA_ADD_TYPE(schema, env, type)\
         (((axis2_xml_schema_t *) schema)->ops->\
-            add_type(schema, env, type))                 
+            add_type(schema, env, type)) 
+            
+#define AXIS2_XML_SCHEMA_SET_SCHEMA_NS_PREFIX(schema, env, ns_prefix) \
+        (((axis2_xml_schema_t *) schema)->ops->\
+            set_schema_ns_prefix(schema, env, ns_prefix))
+            
+                                        
                                               
                       
 /** @} */

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_collection.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_collection.h?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_collection.h (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_collection.h Wed May 17 03:46:06 2006
@@ -33,6 +33,8 @@
 #include <axis2_qname.h>
 #include <xml_schema/axis2_xml_schema_obj.h>
 #include <xml_schema/axis2_validation_event_handler.h>
+#include <axis2_xml_reader.h>
+#include <axis2_om_document.h>
 
 #ifdef __cplusplus
 extern "C"
@@ -54,14 +56,10 @@
 struct axis2_xml_schema_collection_ops
 {
     axis2_status_t (AXIS2_CALL *
-    free) (axis2_xml_schema_collection_t* collection,
-           axis2_env_t **env);
+    free)(
+            axis2_xml_schema_collection_t* collection,
+            axis2_env_t **env);
 
-    /**
-     * Set the base URI. This is used when schemas need to be
-     * loaded from relative locations
-     * @param base_uri
-     */
     axis2_status_t (AXIS2_CALL *
     set_base_uri)(
             axis2_xml_schema_collection_t* collection,
@@ -75,55 +73,44 @@
 
 
     struct axis2_xml_schema* (AXIS2_CALL *
-    read_a_reader_and_validation_event_handler) (
+    read_with_reader)(
             axis2_xml_schema_collection_t* collection,
             axis2_env_t **env,
-            void *reader, 
-            axis2_validation_event_handler_t *veh); 
-
-    struct axis2_xml_schema* (AXIS2_CALL *
-    read_a_input_source_and_validation_event_handler)(
-            axis2_xml_schema_collection_t* collection,
-            axis2_env_t **env,
-            void *input_source, 
-            axis2_validation_event_handler_t *veh);
-            
+            axis2_xml_reader_t *reader); 
 
+    
     struct axis2_xml_schema *(AXIS2_CALL *
-    read_a_source_and_validation_event_handler) (
+    read_document) (
             axis2_xml_schema_collection_t* collection,
             axis2_env_t **env,
-            void *source, 
-            axis2_validation_event_handler_t *veh); 
+            axis2_om_document_t *document);
 
     struct axis2_xml_schema *(AXIS2_CALL *
-    read_a_document_and_validation_event_handler) (
+    read_element)(
             axis2_xml_schema_collection_t* collection,
             axis2_env_t **env,
-            void *document, 
-            axis2_validation_event_handler_t *veh);
-
-    struct axis2_xml_schema *(AXIS2_CALL *
-    read_a_element)(
-            axis2_xml_schema_collection_t* collection,
-            axis2_env_t **env,
-            struct axis2_om_node *node);
+            axis2_om_node_t *ele_node);
 
     struct axis2_xml_schema* (AXIS2_CALL *
-    read_a_document_uri_and_validation_event_handler) (
+    read_document_with_uri) (
             axis2_xml_schema_collection_t* collection,
             axis2_env_t **env,
-            void *document,
-            axis2_char_t *uri,
-            axis2_validation_event_handler_t *veh); 
+            axis2_om_document_t *document,
+            axis2_char_t *uri); 
 
     struct axis2_xml_schema *(AXIS2_CALL *
-    read_a_element_and_uri)(
+    read_element_with_uri)(
             axis2_xml_schema_collection_t* collection,
             axis2_env_t **env,
-            struct axis2_om_node *node,
+            axis2_om_node_t *ele_node,
             axis2_char_t *uri);
-
+            
+    const axis2_hash_t* (AXIS2_CALL *
+    get_xml_schema)(
+            axis2_xml_schema_collection_t* collection,
+            axis2_env_t **env,
+            axis2_char_t *system_id);
+            
     struct axis2_xml_schema_element *(AXIS2_CALL *
     get_element_by_qname)(
             axis2_xml_schema_collection_t* collection,
@@ -142,7 +129,7 @@
             axis2_xml_schema_collection_t* collection,
             axis2_env_t **env,
             axis2_qname_t *qtype, 
-            struct axis2_xml_schema_type_receiver *receiver); 
+            void *receiver); 
             
 
     axis2_status_t (AXIS2_CALL *
@@ -166,7 +153,7 @@
             axis2_env_t **env,
             axis2_char_t *prefix, 
             axis2_char_t *namespc_uri);
-
+            
 };
 
 struct axis2_xml_schema_collection
@@ -188,41 +175,25 @@
 #define AXIS2_XML_SCHEMA_COLLECTION_INIT(collection, env) \
 		((collection)->ops->init(collection, env))
 		
-#define AXIS2_XML_SCHEMA_COLLECTION_READ_A_READER_AND_VALIDATION_EVENT_HANDLER( \
-        collection, env, reader, veh ) \
-        ((collection)->ops->read_a_reader_and_validation_event_handler( \
-        collection, env, reader, veh ))
-        
-#define AXIS2_XML_SCHEMA_COLLECTION_READ_A_INPUT_SOURCE_AND_VALIDATION_EVENT_HANDLER(\
-        collection, env, input_source, veh) \
-        ((collection)->ops->read_a_input_source_and_validation_event_handler( \
-        collection, env, input_source, veh))
-        
-#define AXIS2_XML_SCHEMA_COLLECTION_READ_A_SOURCE_AND_VALIDATION_EVENT_HANDLER(\
-        collection, env, source, veh) \
-        ((collection)->ops->read_a_source_and_validation_event_handler(\
-        collection, env, source, veh))
-        
-#define AXIS2_XML_SCHEMA_COLLECTION_READ_A_DOCUMENT_AND_VALIDATION_EVENT_HANDLER( \
-        collection, env, doc, veh ) \
-        ((collection)->ops->read_a_document_and_validation_event_handler( \
-        collection, env, doc, veh))
-        
-#define AXIS2_XML_SCHEMA_COLLECTION_READ_A_DOCUMENT_URI_AND_VALIDATION_EVENT_HANDLER( \
-        collection , env, document, uri , veh) \
-        ((collection)->ops->read_a_document_uri_and_validation_event_handler( \
-        collection , env, document, uri , veh))
-        
-#define AXIS2_XML_SCHEMA_COLLECTION_READ_A_DOCUMENT_URI_AND_VALIDATION_EVENT_HANDLER( \
-        collection , env, document, uri , veh) \
-        ((collection)->ops->read_a_document_uri_and_validation_event_handler( \
-        collection , env, document, uri , veh))
+#define AXIS2_XML_SCHEMA_COLLECTION_READ_WITH_READER(collection, env, reader, veh ) \
+        ((collection)->ops->read_with_reader( \
+        collection, env, reader))
+        
+#define AXIS2_XML_SCHEMA_COLLECTION_READ_DOCUMENT(collection, env, doc) \
+        ((collection)->ops->read_document(collection, env, doc))
+        
+#define AXIS2_XML_SCHEMA_COLLECTION_READ_DOCUMENT_WITH_URI(collection , env, document, uri) \
+        ((collection)->ops->read_document_with_uri( \
+        collection , env, document, uri))
+        
+#define AXIS2_XML_SCHEMA_COLLECTION_READ_ELEMENT(collection, env, uri) \
+        ((collection)->ops->read_element(collection, env, uri))
         
-#define AXIS2_XML_SCHEMA_COLLECTION_READ_A_ELEMENT_AND_URI(collection, env, uri ) \
-        ((collection)->ops->read_a_element_and_uri(collection, env, uri ))
+#define AXIS2_XML_SCHEMA_COLLECTION_READ_ELEMENT_WITH_URI(collection, env, uri ) \
+        ((collection)->ops->read_element_with_uri(collection, env, uri ))
         
-#define AXIS2_XML_SCHEMA_COLLECTION_GET_ELEMENTS_BY_QNAME(collection, env, qname) \
-        ((collection)->ops->get_elements_by_qname(collection, env, qname))
+#define AXIS2_XML_SCHEMA_COLLECTION_GET_ELEMENT_BY_QNAME(collection, env, qname) \
+        ((collection)->ops->get_element_by_qname(collection, env, qname))
         
 #define AXIS2_XML_SCHEMA_COLLECTION_GET_TYPE_BY_QNAME(collection, env, qname) \
         ((collection)->ops->get_type_by_qname(collection, env, qname))
@@ -230,8 +201,16 @@
 #define AXIS2_XML_SCHEMA_COLLECTION_GET_ELEMENT_BY_QNAME(collection, env, qname) \
         ((collection)->ops->get_element_by_qname(collection, env, qname))
         
+#define AXIS2_XML_SCHEMA_COLLECTION_ADD_UNRESOLVED_TYPE(collection, env, qtype, receiver) \
+        ((collection)->ops->add_unresolved_type(collection, env, qtype, receiver))
+        
+#define AXIS2_XML_SCHEMA_COLLECTION_RESOLVE_TYPE(collection, env, type) \
+        ((collection)->ops->resolve_type(collection, env, type))
+        
 #define AXIS2_XML_SCHEMA_COLLECTION_GET_NAMESPACE_FOR_PREFIX(collection, env, prefix) \
         ((collection)->ops->get_namespace_for_prefix(collection, env, prefix))
+        
+        
         
 /** @} */
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_form.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_form.h?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_form.h (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/include/xml_schema/axis2_xml_schema_form.h Wed May 17 03:46:06 2006
@@ -36,9 +36,9 @@
 typedef struct axis2_xml_schema_form axis2_xml_schema_form_t;
 typedef struct axis2_xml_schema_form_ops axis2_xml_schema_form_ops_t;
 
-#define AXIS2_XML_SCHEMA_QUALIFIED "qualified"
-#define AXIS2_XML_SCHEMA_UNQUALIFIED "unqualified"
-#define AXIS2_XML_SCHEMA_NONE "none"
+#define AXIS2_XML_SCHEMA_FORM_QUALIFIED "qualified"
+#define AXIS2_XML_SCHEMA_FORM_UNQUALIFIED "unqualified"
+#define AXIS2_XML_SCHEMA_FORM_NONE "none"
 
 #ifdef __cplusplus
 extern "C"

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema.c Wed May 17 03:46:06 2006
@@ -207,6 +207,15 @@
                             axis2_env_t **env,
                             axis2_xml_schema_type_t *type);
 
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_set_schema_ns_prefix(void *schema,
+                            axis2_env_t **env,
+                            axis2_char_t *ns_prefix);
+                            
+
+/********************** end function prototypes ******************************/
+
+
 AXIS2_DECLARE(axis2_xml_schema_t *)
 axis2_xml_schema_create(axis2_env_t **env,
                                 axis2_char_t *namespc,
@@ -315,7 +324,42 @@
             axis2_xml_schema_set_prefix_to_namespace_map;
     schema_impl->schema.ops->add_type = 
             axis2_xml_schema_add_type;
-   
+            
+    /************ create objs *******************************/            
+            
+    schema_impl->parent = parent;
+    
+    schema_impl->attr_form_default = axis2_xml_schema_form_create(env,
+            AXIS2_XML_SCHEMA_FORM_UNQUALIFIED);       
+    
+    schema_impl->element_form_default = axis2_xml_schema_form_create(env,
+            AXIS2_XML_SCHEMA_FORM_UNQUALIFIED);
+    
+    schema_impl->block_default = axis2_xml_schema_derivation_method_create(env,
+            AXIS2_XML_SCHEMA_CONST_NONE);
+    
+    schema_impl->final_default = axis2_xml_schema_derivation_method_create(env,
+            AXIS2_XML_SCHEMA_CONST_NONE);
+    
+    
+    schema_impl->items = axis2_xml_schema_obj_collection_create(env);
+    
+    schema_impl->includes = axis2_xml_schema_obj_collection_create(env);
+    
+    schema_impl->namespaces_map = axis2_hash_make(env);
+    
+    schema_impl->elements = axis2_xml_schema_obj_table_create(env);
+    
+    schema_impl->attr_groups = axis2_xml_schema_obj_table_create(env);
+    
+    schema_impl->attrs = axis2_xml_schema_obj_table_create(env);
+    
+    schema_impl->groups = axis2_xml_schema_obj_table_create(env);
+    
+    schema_impl->notations = axis2_xml_schema_obj_table_create(env);
+    
+    schema_impl->schema_types = axis2_xml_schema_obj_table_create(env);
+    
     schema_impl->methods = axis2_hash_make(env);
     if(!schema_impl->methods)
     {
@@ -1268,3 +1312,21 @@
     }    
     return AXIS2_SUCCESS;
 }
+
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_set_schema_ns_prefix(void *schema,
+                            axis2_env_t **env,
+                            axis2_char_t *ns_prefix)
+{
+    axis2_xml_schema_impl_t *sch_impl = NULL;
+    AXIS2_PARAM_CHECK((*env)->error, ns_prefix, AXIS2_FAILURE);
+    sch_impl = AXIS2_INTF_TO_IMPL(schema);
+    if(NULL != sch_impl->schema_ns_prefix)
+    {
+        AXIS2_FREE((*env)->allocator, sch_impl->schema_ns_prefix);
+        sch_impl->schema_ns_prefix = NULL;
+    
+    }
+    sch_impl->schema_ns_prefix = AXIS2_STRDUP(ns_prefix, env);
+    return AXIS2_FAILURE;
+}                            
\ No newline at end of file

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_builder.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_builder.c Wed May 17 03:46:06 2006
@@ -45,7 +45,7 @@
 #include <xml_schema/axis2_xml_schema_import.h>
 #include <xml_schema/axis2_xml_schema_app_info.h>
 #include <xml_schema/axis2_xml_schema_documentation.h>
-
+#include <string.h>
 
 
 typedef struct axis2_xml_schema_builder_impl 
@@ -59,9 +59,14 @@
     axis2_xml_schema_t *schema;
     
     axis2_xml_schema_collection_t *collection;
+    
+    int gen_no;
 
 }axis2_xml_schema_builder_impl_t;
 
+#define AXIS2_INTF_TO_IMPL(builder) \
+        ((axis2_xml_schema_builder_impl_t*)builder)
+
 /************************* function prototypes ********************************/
 
 axis2_xml_schema_t* AXIS2_CALL
@@ -328,6 +333,12 @@
         axis2_char_t *schema_location,
         axis2_char_t *base_uri);
         
+static axis2_bool_t 
+value_exist_in_hash(
+        axis2_env_t **env,
+        axis2_hash_t *ht,
+        axis2_char_t *value);        
+        
 /*************** end function prototypes **************************************/
 
 AXIS2_DECLARE(axis2_xml_schema_builder_t *)
@@ -351,6 +362,7 @@
     builder_impl->om_doc = NULL;
     builder_impl->root_node = NULL;
     builder_impl->schema = NULL;
+    builder_impl->gen_no = 0;
     
     builder_impl->schema = axis2_xml_schema_create(env, NULL, sch_collection);
     if(!builder_impl->schema)
@@ -386,7 +398,18 @@
         axis2_xml_schema_builder_t *builder,
         axis2_env_t **env,
         axis2_om_document_t *om_doc,
-        axis2_char_t *uri){}
+        axis2_char_t *uri)
+{
+    axis2_xml_schema_builder_impl_t *builder_impl = NULL;
+    AXIS2_PARAM_CHECK((*env)->error, om_doc, NULL);
+    AXIS2_PARAM_CHECK((*env)->error, uri, NULL);
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    builder_impl->om_doc = om_doc;
+    builder_impl->root_node = AXIS2_OM_DOCUMENT_GET_ROOT_ELEMENT(om_doc, env);            
+    if(!builder_impl->root_node)
+        return NULL;        
+    return handle_xml_schema_element(builder, env, builder_impl->root_node, uri);
+}
         
 axis2_xml_schema_t* AXIS2_CALL
 axis2_xml_schema_builder_build_with_root_node(
@@ -427,14 +450,120 @@
         axis2_xml_schema_builder_t* builder,
         axis2_env_t **env,
         axis2_xml_schema_t *schema,
-        axis2_om_node_t *sch_node){}
+        axis2_om_node_t *sch_node)
+{
+    axis2_xml_schema_builder_impl_t *builder_impl = NULL;
+    axis2_om_node_t* parent_node = NULL;
+    axis2_hash_t *ht_ns = NULL;
+    axis2_hash_index_t *hi_ns = NULL;
+    axis2_om_element_t *om_ele = NULL;
+    
+    axis2_hash_t *ht_sch_ns = NULL;
+    axis2_qname_t *target_ns_qn = NULL;
+    axis2_char_t *contain = NULL;
+    
+    AXIS2_PARAM_CHECK((*env)->error, schema, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, sch_node, AXIS2_FAILURE);
+    if(AXIS2_OM_NODE_GET_NODE_TYPE(sch_node, env) != AXIS2_OM_ELEMENT)
+        return AXIS2_FAILURE;
+    
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    parent_node = AXIS2_OM_NODE_GET_PARENT(sch_node, env);
+    if(NULL != parent_node && 
+        AXIS2_OM_NODE_GET_NODE_TYPE(sch_node, env) == AXIS2_OM_ELEMENT)
+    {
+        set_namespace_attribute(builder, env, schema, parent_node);
+    }
+    
+    om_ele = AXIS2_OM_NODE_GET_DATA_ELEMENT(sch_node, env);
+    if(!om_ele)
+        return AXIS2_FAILURE;            
+    
+    ht_ns = AXIS2_OM_ELEMENT_GET_NAMESPACES(om_ele, env);
+    if(!ht_ns)
+    {   /* no namespaces available */
+        return AXIS2_SUCCESS;
+    }
+    
+    ht_sch_ns = AXIS2_XML_SCHEMA_GET_PREFIX_TO_NAMESPACE_MAP(schema, env);
+    if(!ht_sch_ns)
+        return AXIS2_FAILURE;
+            
+    for(hi_ns = axis2_hash_first(ht_ns, env); hi_ns;
+        hi_ns = axis2_hash_next(env, hi_ns))
+    {
+        void *val = NULL;
+        axis2_hash_this(hi_ns, NULL, NULL, &val);
+        if(NULL != val)
+        {
+            axis2_char_t *uri = NULL;
+            axis2_char_t *prefix = NULL;    
+            uri = AXIS2_OM_NAMESPACE_GET_URI((axis2_om_namespace_t*)val, env);
+            prefix = 
+                AXIS2_OM_NAMESPACE_GET_PREFIX((axis2_om_namespace_t*)val, env);
+            /**  if (map.item(i).getNodeName().startsWith("xmlns:")) {
+                schema.namespaces.put(map.item(i).getLocalName(),
+                        map.item(i).getNodeValue());
+             */
+            if(NULL != prefix)
+            {                              
+                axis2_hash_set(ht_sch_ns, prefix, AXIS2_HASH_KEY_STRING,
+                    uri);
+                if(NULL != uri && AXIS2_STRCMP(uri, AXIS2_XML_SCHEMA_NS) == 0)
+                {
+                    AXIS2_XML_SCHEMA_SET_SCHEMA_NS_PREFIX(schema, env, prefix);
+                }
+            }
+            else
+            {
+                /** default namespace [xmlns=""] */
+                axis2_hash_set(ht_sch_ns, "", AXIS2_HASH_KEY_STRING, uri);
+                
+            }
+             
+        }    
+    }
+    
+    
+    target_ns_qn = axis2_qname_create(env, "targetNamespace", NULL, NULL);
+    contain = AXIS2_OM_ELEMENT_GET_ATTRIBUTE_VALUE(om_ele, env, target_ns_qn);
+    if(NULL != target_ns_qn)
+        AXIS2_QNAME_FREE(target_ns_qn, env);
+
+    if(NULL != contain && (value_exist_in_hash(env, ht_sch_ns, contain)) == AXIS2_FALSE)
+    {
+        put_namespace(builder, env, "", contain);
+/*        axis2_hash_set(ht_sch_ns, "", AXIS2_HASH_KEY_STRING, contain); */
+        if(AXIS2_STRCMP(contain,"") != 0)
+        {
+            AXIS2_XML_SCHEMA_SET_SCHEMA_NS_PREFIX(schema, env, contain);
+        }               
+    }                    
+}    
         
 static axis2_status_t
 put_namespace(  
         axis2_xml_schema_builder_t* builder,
         axis2_env_t **env,
         axis2_char_t *prefix,
-        axis2_char_t *ns){}              
+        axis2_char_t *ns)
+{
+    axis2_xml_schema_builder_impl_t *builder_impl = NULL;
+    axis2_hash_t *ht_sch_ns = NULL;
+    builder_impl = AXIS2_INTF_TO_IMPL(builder);
+    AXIS2_PARAM_CHECK((*env)->error, prefix, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, ns , AXIS2_FAILURE);
+    ht_sch_ns = AXIS2_XML_SCHEMA_GET_PREFIX_TO_NAMESPACE_MAP(builder_impl->schema, env);
+    if(NULL != axis2_hash_get(ht_sch_ns, prefix, AXIS2_HASH_KEY_STRING))
+    {
+        /** key already exist */
+        axis2_char_t *gen_prefix = AXIS2_MALLOC((*env)->allocator, sizeof(10));
+        sprintf(gen_prefix, "gen%d", builder_impl->gen_no++);
+        axis2_hash_set(ht_sch_ns, gen_prefix, AXIS2_HASH_KEY_STRING, ns);            
+    }
+    axis2_hash_set(ht_sch_ns, prefix, AXIS2_HASH_KEY_STRING, ns);
+    return AXIS2_SUCCESS;    
+}              
 
 static axis2_xml_schema_simple_type_t*
 handle_simple_type(        
@@ -644,3 +773,28 @@
         axis2_char_t *target_namespace,
         axis2_char_t *schema_location,
         axis2_char_t *base_uri){}
+
+
+static axis2_bool_t 
+value_exist_in_hash(
+        axis2_env_t **env,
+        axis2_hash_t *ht,
+        axis2_char_t *value)
+{
+    void *val = NULL;
+    axis2_hash_index_t *hi = NULL;
+    if(!value || !ht)
+        return AXIS2_FALSE;
+    for(hi = axis2_hash_first(ht, env); hi;
+        hi = axis2_hash_next(hi, env))
+    {
+        axis2_hash_this(env, NULL, NULL, &val);
+        if(NULL != val )
+        {
+            if(AXIS2_STRCMP(value, val) == 0)
+                return AXIS2_TRUE;
+        }
+    
+    }        
+    return AXIS2_FALSE;    
+}        
\ No newline at end of file

Modified: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.c?rev=407216&r1=407215&r2=407216&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.c (original)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.c Wed May 17 03:46:06 2006
@@ -23,6 +23,7 @@
 #include <xml_schema/axis2_xml_schema_type.h>
 #include <xml_schema/axis2_xml_schema_type_receiver.h>
 #include <xml_schema/axis2_xml_schema_element.h>
+#include <xml_schema/axis2_xml_schema_simple_type.h>
 
 typedef struct axis2_xml_schema_collection_impl 
                 axis2_xml_schema_collection_impl_t;
@@ -34,21 +35,19 @@
 struct axis2_xml_schema_collection_impl
 {
     axis2_xml_schema_collection_t collection;
-    /**
-     */
+
     axis2_hash_t *namespaces;
-    /**
-     * base URI is used as the base for loading the
-     * imports
-     */
+
     axis2_char_t *base_uri;
-    /**
-     * In-scope namespaces for XML processing
-     */
+
     axis2_hash_t *in_scope_namespaces;
     
+    axis2_hash_t *schema_id2_schemas;
+    
     axis2_xml_schema_t *xml_schema;
     
+    axis2_hash_t *schemas;
+    
     axis2_hash_t *unresolved_types;
 };
 
@@ -60,111 +59,103 @@
 
 
 axis2_status_t AXIS2_CALL
-axis2_xml_schema_collection_free(axis2_xml_schema_collection_t* collection,
-                                 axis2_env_t **env);
+axis2_xml_schema_collection_free(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env);
 
 axis2_status_t AXIS2_CALL
-axis2_xml_schema_collection_set_base_uri
-                  (axis2_xml_schema_collection_t* collection,
-                   axis2_env_t **env,
-                   axis2_char_t *base_uri);
+axis2_xml_schema_collection_set_base_uri(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_char_t *base_uri);
                    
 axis2_status_t AXIS2_CALL
-axis2_xml_schema_collection_init(axis2_xml_schema_collection_t* collection,
-                                 axis2_env_t **env);
+axis2_xml_schema_collection_init(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env);
 
 
-struct axis2_xml_schema* AXIS2_CALL
-axis2_xml_schema_collection_read_a_reader_and_validation_event_handler(
-                            axis2_xml_schema_collection_t* collection,
-                            axis2_env_t **env,
-                            void *reader, 
-                            axis2_validation_event_handler_t *veh); 
+axis2_xml_schema_t* AXIS2_CALL
+axis2_xml_schema_collection_read_with_reader(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_xml_reader_t *reader);
                             
-struct axis2_xml_schema* AXIS2_CALL
-axis2_xml_schema_collection_read_a_input_source_and_validation_event_handler(
-                                axis2_xml_schema_collection_t* collection,
-                                axis2_env_t **env,
-                                void *input_source, 
-                                axis2_validation_event_handler_t *veh);
-
-struct axis2_xml_schema *   AXIS2_CALL
-axis2_xml_schema_collection_read_a_source_and_validation_event_handler(
-                                axis2_xml_schema_collection_t* collection,
-                                axis2_env_t **env,
-                                void *source, 
-                                axis2_validation_event_handler_t *veh); 
-
-struct axis2_xml_schema * AXIS2_CALL
-axis2_xml_schema_collection_read_a_document_and_validation_event_handler (
-                                axis2_xml_schema_collection_t* collection,
-                                axis2_env_t **env,
-                                void *document, 
-                                axis2_validation_event_handler_t *veh);
-
-struct axis2_xml_schema * AXIS2_CALL
-axis2_xml_schema_collection_read_a_element
-                    (axis2_xml_schema_collection_t* collection,
-                     axis2_env_t **env,
-                     struct axis2_om_node *node);
-
-struct axis2_xml_schema* AXIS2_CALL
-axis2_xml_schema_collection_read_a_document_uri_and_validation_event_handler
-                         (axis2_xml_schema_collection_t* collection,
-                        axis2_env_t **env,
-                        void *document,
-                        axis2_char_t *uri,
-                        axis2_validation_event_handler_t *veh); 
-
-struct axis2_xml_schema * AXIS2_CALL
-axis2_xml_schema_collection_read_a_element_and_uri
-                           (axis2_xml_schema_collection_t* collection,
-                             axis2_env_t **env,
-                             struct axis2_om_node *node,
-                             axis2_char_t *uri);
-
-struct axis2_xml_schema_element * AXIS2_CALL
-axis2_xml_schema_collection_get_element_by_qname
-                       (axis2_xml_schema_collection_t* collection,
-                        axis2_env_t **env,
-                        axis2_qname_t *qname);
-
-struct axis2_xml_schema_type * AXIS2_CALL
-axis2_xml_schema_collection_get_type_by_qname
-                   (axis2_xml_schema_collection_t* collection,
-                    axis2_env_t **env,
-                    axis2_qname_t *schema_type_qname);
+axis2_xml_schema_t * AXIS2_CALL
+axis2_xml_schema_collection_read_document(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_om_document_t* document);
+
+axis2_xml_schema_t * AXIS2_CALL
+axis2_xml_schema_collection_read_element(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_om_node_t *node);
+
+axis2_xml_schema_t* AXIS2_CALL
+axis2_xml_schema_collection_read_document_with_uri(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_om_document_t *document,
+        axis2_char_t *uri);
+
+axis2_xml_schema_t * AXIS2_CALL
+axis2_xml_schema_collection_read_element_with_uri(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_om_node_t *node,
+        axis2_char_t *uri);
+
+axis2_xml_schema_element_t * AXIS2_CALL
+axis2_xml_schema_collection_get_element_by_qname(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_qname_t *qname);
+
+axis2_xml_schema_type_t * AXIS2_CALL
+axis2_xml_schema_collection_get_type_by_qname(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_qname_t *schema_type_qname);
 
 
 axis2_status_t AXIS2_CALL
-axis2_xml_schema_collection_add_unresolved_type
-                       (axis2_xml_schema_collection_t* collection,
-                        axis2_env_t **env,
-                        axis2_qname_t *qtype, 
-                        struct axis2_xml_schema_type_receiver *receiver); 
+axis2_xml_schema_collection_add_unresolved_type(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_qname_t *qtype, 
+        void *receiver); 
 
 axis2_status_t AXIS2_CALL 
-axis2_xml_schema_collection_resolve_type
-               (axis2_xml_schema_collection_t* collection,
-                axis2_env_t **env,
-                axis2_qname_t *type_qame, 
-                struct axis2_xml_schema_type *type); 
+axis2_xml_schema_collection_resolve_type(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_qname_t *type_qame, 
+        axis2_xml_schema_type_t *type); 
 
 axis2_char_t * AXIS2_CALL
-axis2_xml_schema_collection_get_namespace_for_prefix
-                (axis2_xml_schema_collection_t *collection,
-                 axis2_env_t **env,
-                 axis2_char_t *prefix); 
+axis2_xml_schema_collection_get_namespace_for_prefix(
+        axis2_xml_schema_collection_t *collection,
+        axis2_env_t **env,
+        axis2_char_t *prefix); 
                      
 
 axis2_status_t AXIS2_CALL
-axis2_xml_schema_collection_map_namespace
-                (axis2_xml_schema_collection_t* collection,
-                 axis2_env_t **env,
-                 axis2_char_t *prefix, 
-                 axis2_char_t *namespc_uri);
-                    
-                    
+axis2_xml_schema_collection_map_namespace(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_char_t *prefix, 
+        axis2_char_t *namespc_uri);
+        
+static axis2_status_t 
+add_simple_type(
+        axis2_env_t **env,
+        axis2_xml_schema_t* schema,
+        axis2_xml_schema_simple_type_t *simple_type,
+        axis2_char_t *type_name);
+
+/*************** end function prototypes ****************************/                    
 
 AXIS2_DECLARE(axis2_xml_schema_collection_t *)
 axis2_xml_schema_collection_create(axis2_env_t **env)
@@ -185,6 +176,8 @@
     collection_impl->namespaces = NULL;
     collection_impl->unresolved_types = NULL;
     collection_impl->xml_schema = NULL;
+    collection_impl->schema_id2_schemas = NULL;
+    collection_impl->schemas = NULL;
     
     collection_impl->collection.ops = AXIS2_MALLOC((*env)->allocator, 
                     sizeof(axis2_xml_schema_collection_ops_t)); 
@@ -205,35 +198,36 @@
     collection_impl->collection.ops->init = 
             axis2_xml_schema_collection_init;
             
-    collection_impl->collection.ops->read_a_reader_and_validation_event_handler = 
-            axis2_xml_schema_collection_read_a_reader_and_validation_event_handler;
+    collection_impl->collection.ops->read_with_reader = 
+            axis2_xml_schema_collection_read_with_reader;
             
-    collection_impl->collection.ops->read_a_input_source_and_validation_event_handler = 
-            axis2_xml_schema_collection_read_a_input_source_and_validation_event_handler;
+    collection_impl->collection.ops->read_document = 
+            axis2_xml_schema_collection_read_document;
             
-    collection_impl->collection.ops->read_a_source_and_validation_event_handler = 
-            axis2_xml_schema_collection_read_a_source_and_validation_event_handler;
+    collection_impl->collection.ops->read_element = 
+            axis2_xml_schema_collection_read_element;
             
-    collection_impl->collection.ops->read_a_document_and_validation_event_handler = 
-            axis2_xml_schema_collection_read_a_document_and_validation_event_handler;
-            
-    collection_impl->collection.ops->read_a_element = 
-            axis2_xml_schema_collection_read_a_element;
+    collection_impl->collection.ops->read_document_with_uri = 
+        axis2_xml_schema_collection_read_document_with_uri;
+        
+    collection_impl->collection.ops->read_element_with_uri = 
+            axis2_xml_schema_collection_read_element_with_uri;
             
-    collection_impl->collection.ops->read_a_document_uri_and_validation_event_handler= 
-        axis2_xml_schema_collection_read_a_document_uri_and_validation_event_handler;
-    collection_impl->collection.ops->read_a_element_and_uri = 
-            axis2_xml_schema_collection_read_a_element_and_uri;
     collection_impl->collection.ops->get_element_by_qname = 
             axis2_xml_schema_collection_get_element_by_qname;
+    
     collection_impl->collection.ops->get_type_by_qname = 
             axis2_xml_schema_collection_get_type_by_qname;
+    
     collection_impl->collection.ops->add_unresolved_type = 
             axis2_xml_schema_collection_add_unresolved_type;
+    
     collection_impl->collection.ops->resolve_type = 
             axis2_xml_schema_collection_resolve_type;
+    
     collection_impl->collection.ops->get_namespace_for_prefix = 
             axis2_xml_schema_collection_get_namespace_for_prefix;
+    
     collection_impl->collection.ops->map_namespace = 
             axis2_xml_schema_collection_map_namespace;
 
@@ -268,199 +262,109 @@
  *
  * This needs to be inspected by another pair of eyes
  */
-axis2_status_t AXIS2_CALL 
-axis2_xml_schema_collection_init(axis2_xml_schema_collection_t   *collection,
-                                    axis2_env_t **env) 
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_init(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env)
 {
-    /*
-    Primitive types
-
-    3.2.1 string
-    3.2.2 boolean
-    3.2.3 decimal
-    3.2.4 float
-    3.2.5 double
-    3.2.6 duration
-    3.2.7 dateTime
-    3.2.8 time
-    3.2.9 date
-    3.2.10 gYearMonth
-    3.2.11 gYear
-    3.2.12 gMonthDay
-    3.2.13 gDay
-    3.2.14 gMonth
-    3.2.15 hexBinary
-    3.2.16 base64Binary
-    3.2.17 anyURI
-    3.2.18 QName
-    3.2.19 NOTATION
-    */
-
-
-    /*
-     3.3.1 normalizedString
-    3.3.2 token
-    3.3.3 language
-    3.3.4 NMTOKEN
-    3.3.5 NMTOKENS
-    3.3.6 Name
-    3.3.7 NCName
-    3.3.8 ID
-    3.3.9 IDREF
-    3.3.10 IDREFS
-    3.3.11 ENTITY
-    3.3.12 ENTITIES
-    3.3.13 integer
-    3.3.14 nonPositiveInteger
-    3.3.15 negativeInteger
-    3.3.16 long
-    3.3.17 int
-    3.3.18 short
-    3.3.19 byte
-    3.3.20 nonNegativeInteger
-    3.3.21 unsignedLong
-    3.3.22 unsignedInt
-    3.3.23 unsignedShort
-    3.3.24 unsignedByte
-    3.3.25 positiveInteger
-    */
 
-     /*derived types from decimal */
-
-    /* derived types from string */
     return AXIS2_SUCCESS;
 }
 
-static axis2_status_t add_simple_type(axis2_xml_schema_collection_t  *collection,
-                                        axis2_env_t **env,
-                                        axis2_xml_schema_t *schema,
-                                        axis2_char_t *type_name)
-{
-    return AXIS2_SUCCESS;
-}
 
-axis2_xml_schema_t *AXIS2_CALL
-axis2_xml_schema_collection_read_a_reader_and_validation_event_handler(
-                                            axis2_xml_schema_collection_t  *collection,
-                                            axis2_env_t **env,
-                                            void *reader, 
-                                            axis2_validation_event_handler_t *veh) 
+axis2_xml_schema_t* AXIS2_CALL
+axis2_xml_schema_collection_read_with_reader(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_xml_reader_t *reader)
 {
-    return NULL;
-}
 
-axis2_xml_schema_t *AXIS2_CALL
-axis2_xml_schema_collection_read_a_input_source_and_validation_event_handler(
-                                            axis2_xml_schema_collection_t  *collection,
-                                            axis2_env_t **env,
-                                            void *input_source, 
-                                            axis2_validation_event_handler_t *veh) 
-{
     return NULL;
 }
-
-axis2_xml_schema_t *AXIS2_CALL
-axis2_xml_schema_collection_read_a_source_and_validation_event_handler(
-                                            axis2_xml_schema_collection_t  *collection,
-                                            axis2_env_t **env,
-                                            void  *source, 
-                                            axis2_validation_event_handler_t *veh) 
+                            
+axis2_xml_schema_t * AXIS2_CALL
+axis2_xml_schema_collection_read_document(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_om_document_t* document)
 {
-    return NULL;
-}
 
-axis2_xml_schema_t *AXIS2_CALL
-axis2_xml_schema_collection_read_a_document_and_validation_event_handler(
-                                            axis2_xml_schema_collection_t  *collection,
-                                            axis2_env_t **env,
-                                            void *source, 
-                                            axis2_validation_event_handler_t *veh) 
-{
     return NULL;
 }
 
-axis2_xml_schema_t *AXIS2_CALL
-axis2_xml_schema_collection_read_a_element(
-                                            axis2_xml_schema_collection_t  *collection,
-                                            axis2_env_t **env,
-                                            axis2_om_node_t *node)
+axis2_xml_schema_t * AXIS2_CALL
+axis2_xml_schema_collection_read_element(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_om_node_t *node)
 {
     return NULL;
 }
 
-axis2_xml_schema_t *AXIS2_CALL
-axis2_xml_schema_collection_read_a_document_uri_and_validation_event_handler(
-                                            axis2_xml_schema_collection_t  *collection,
-                                            axis2_env_t **env,
-                                            void *document,
-                                            axis2_char_t *uri,
-                                            axis2_validation_event_handler_t *veh) 
+axis2_xml_schema_t* AXIS2_CALL
+axis2_xml_schema_collection_read_document_with_uri(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_om_document_t *document,
+        axis2_char_t *uri)
 {
     return NULL;
 }
 
-axis2_xml_schema_t *AXIS2_CALL
-axis2_xml_schema_collection_read_a_element_and_uri(
-                                            axis2_xml_schema_collection_t  *collection,
-                                            axis2_env_t **env,
-                                            axis2_om_node_t *node,
-                                            axis2_char_t *uri) 
+axis2_xml_schema_t * AXIS2_CALL
+axis2_xml_schema_collection_read_element_with_uri(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_om_node_t *node,
+        axis2_char_t *uri)
 {
     return NULL;
 }
 
-axis2_xml_schema_element_t *AXIS2_CALL
-axis2_xml_schema_collection_get_element_by_qname(axis2_xml_schema_collection_t  *collection,
-                                                 axis2_env_t **env,
-                                                 axis2_qname_t *qname) 
+axis2_xml_schema_element_t * AXIS2_CALL
+axis2_xml_schema_collection_get_element_by_qname(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_qname_t *qname)
 {
     return NULL;
 }
 
-axis2_xml_schema_type_t *AXIS2_CALL
-axis2_xml_schema_collection_get_type_by_qname(axis2_xml_schema_collection_t  *collection,
-                                             axis2_env_t **env,
-                                             axis2_qname_t *schema_type_qname) 
+axis2_xml_schema_type_t * AXIS2_CALL
+axis2_xml_schema_collection_get_type_by_qname(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_qname_t *schema_type_qname)
 {
     return NULL;
 }
 
 
 axis2_status_t AXIS2_CALL
-axis2_xml_schema_collection_add_unresolved_type(axis2_xml_schema_collection_t  *collection,
-                                                axis2_env_t **env,
-                                                axis2_qname_t *qtype, 
-                                                axis2_xml_schema_type_receiver_t *receiver) 
+axis2_xml_schema_collection_add_unresolved_type(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_qname_t *qtype, 
+        void *receiver)
 {
     return AXIS2_SUCCESS;
-}
+} 
 
-axis2_status_t AXIS2_CALL
-axis2_xml_schema_collection_resolve_type(axis2_xml_schema_collection_t  *collection,
-                                         axis2_env_t **env,
-                                         axis2_qname_t *type_qname, 
-                                          struct axis2_xml_schema_type *type) 
+axis2_status_t AXIS2_CALL 
+axis2_xml_schema_collection_resolve_type(
+        axis2_xml_schema_collection_t* collection,
+        axis2_env_t **env,
+        axis2_qname_t *type_qame, 
+        axis2_xml_schema_type_t *type)
 {
-    axis2_xml_schema_collection_impl_t *collection_impl = NULL;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK((*env)->error, type_qname, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK((*env)->error, type, AXIS2_FAILURE);
-    
-    collection_impl = AXIS2_INTF_TO_IMPL(collection);
-    if(NULL != collection_impl->unresolved_types)
-    {
-        
-    }
-    
-
-
     return AXIS2_SUCCESS;
-}
+} 
 
 axis2_char_t *AXIS2_CALL 
-axis2_xml_schema_collection_get_namespace_for_prefix(axis2_xml_schema_collection_t  *collection,
-                                                    axis2_env_t **env,
-                                                    axis2_char_t *prefix) 
+axis2_xml_schema_collection_get_namespace_for_prefix(
+        axis2_xml_schema_collection_t  *collection,
+        axis2_env_t **env,
+        axis2_char_t *prefix) 
 {
     axis2_xml_schema_collection_impl_t *collection_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
@@ -477,10 +381,11 @@
 }
 
 axis2_status_t AXIS2_CALL
-axis2_xml_schema_collection_map_namespace(axis2_xml_schema_collection_t  *collection,
-                                            axis2_env_t **env,
-                                            axis2_char_t *prefix, 
-                                            axis2_char_t *namespc_uri)
+axis2_xml_schema_collection_map_namespace(
+        axis2_xml_schema_collection_t  *collection,
+        axis2_env_t **env,
+        axis2_char_t *prefix, 
+        axis2_char_t *namespc_uri)
 {
     axis2_xml_schema_collection_impl_t *collection_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
@@ -494,4 +399,17 @@
     return AXIS2_FAILURE;
 }
 
+static axis2_status_t 
+add_simple_type(
+        axis2_env_t **env,
+        axis2_xml_schema_t* schema,
+        axis2_xml_schema_simple_type_t *simple_type,
+        axis2_char_t *type_name)
+{
+    axis2_xml_schema_simple_type_t* type = NULL;
+    type = axis2_xml_schema_simple_type_create(env, schema);
+    AXIS2_XML_SCHEMA_TYPE_SET_NAME(type, env, type_name);
+    AXIS2_XML_SCHEMA_ADD_TYPE(schema, env, type);
+    return AXIS2_SUCCESS;
+}