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 da...@apache.org on 2006/04/17 14:15:52 UTC
svn commit: r394660 [4/6] - in
/webservices/axis2/trunk/c/modules/xml/xml_schema: ./ constants/ utils/
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_app_info.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_app_info.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_app_info.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_app_info.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,262 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_app_info.h>
+
+typedef struct axis2_xml_schema_app_info_impl axis2_xml_schema_app_info_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_app_info_impl
+{
+ axis2_xml_schema_app_info_t app_info;
+ axis2_xml_schema_obj_t *schema_obj;
+ axis2_hash_t *methods;
+ /**
+ * Provides the source of the application information.
+ */
+ axis2_char_t *source;
+ void *markup; /* TODO Replace (void *) with node list */
+};
+
+#define INTF_TO_IMPL(app_info) ((axis2_xml_schema_app_info_impl_t *) app_info)
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_app_info_free(void *app_info,
+ axis2_env_t **env);
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_app_info_get_base_impl(void *app_info,
+ axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_app_info_get_source(void *app_info,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_app_info_set_source(void *app_info,
+ axis2_env_t **env,
+ axis2_char_t *source);
+
+/* TODO replace (void *) mark up with node list */
+void *AXIS2_CALL
+axis2_xml_schema_app_info_get_markup(void *app_info,
+ axis2_env_t **env);
+
+/* TODO replace (void *) mark up with node list */
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_app_info_set_markup(void *app_info,
+ axis2_env_t **env,
+ void *markup);
+
+AXIS2_DECLARE(axis2_xml_schema_app_info_t *)
+axis2_xml_schema_app_info_create(axis2_env_t **env)
+{
+ axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ app_info_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_app_info_impl_t));
+
+ app_info_impl->schema_obj = NULL;
+ app_info_impl->methods = NULL;
+ app_info_impl->source = NULL;
+ app_info_impl->markup = NULL;
+ app_info_impl->app_info.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_app_info_ops_t));
+
+ app_info_impl->app_info.ops->free = axis2_xml_schema_app_info_free;
+ app_info_impl->app_info.ops->get_base_impl =
+ axis2_xml_schema_app_info_get_base_impl;
+ app_info_impl->app_info.ops->get_source =
+ axis2_xml_schema_app_info_get_source;
+ app_info_impl->app_info.ops->set_source =
+ axis2_xml_schema_app_info_set_source;
+ app_info_impl->app_info.ops->get_markup =
+ axis2_xml_schema_app_info_get_markup;
+ app_info_impl->app_info.ops->set_markup =
+ axis2_xml_schema_app_info_set_markup;
+
+ app_info_impl->methods = axis2_hash_make(env);
+ if(!app_info_impl->methods)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(app_info_impl->methods, "free",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_free);
+ axis2_hash_set(app_info_impl->methods, "get_source",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_get_source);
+ axis2_hash_set(app_info_impl->methods, "set_source",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_set_source);
+ axis2_hash_set(app_info_impl->methods, "get_markup",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_get_markup);
+ axis2_hash_set(app_info_impl->methods, "set_markup",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_app_info_set_markup);
+
+ app_info_impl->schema_obj = axis2_xml_schema_obj_create(env);
+ status =
+ axis2_xml_schema_obj_resolve_methods(&(app_info_impl->app_info.base),
+ env, app_info_impl->schema_obj, app_info_impl->methods);
+ return &(app_info_impl->app_info);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_app_info_free(void *app_info,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ app_info_impl = INTF_TO_IMPL(app_info);
+
+ if(app_info_impl->source)
+ {
+ AXIS2_FREE((*env)->allocator, app_info_impl->source);
+ app_info_impl->source = NULL;
+ }
+
+ /* TODO Free markup */
+
+ if(app_info_impl->methods)
+ {
+ axis2_hash_free(app_info_impl->methods, env);
+ app_info_impl->methods = NULL;
+ }
+
+ if(app_info_impl->schema_obj)
+ {
+ AXIS2_XML_SCHEMA_OBJ_FREE(app_info_impl->schema_obj, env);
+ app_info_impl->schema_obj = NULL;
+ }
+
+ if((&(app_info_impl->app_info))->ops)
+ {
+ AXIS2_FREE((*env)->allocator, (&(app_info_impl->app_info))->ops);
+ (&(app_info_impl->app_info))->ops = NULL;
+ }
+
+ if(app_info_impl)
+ {
+ AXIS2_FREE((*env)->allocator, app_info_impl);
+ app_info_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_app_info_get_base_impl(void *app_info,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ app_info_impl = INTF_TO_IMPL(app_info);
+
+ return app_info_impl->schema_obj;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_app_info_resolve_methods(
+ axis2_xml_schema_app_info_t *app_info,
+ axis2_env_t **env,
+ axis2_xml_schema_app_info_t *app_info_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_app_info_impl_t *app_info_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, app_info_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ app_info_impl_l = (axis2_xml_schema_app_info_impl_t *) app_info_impl;
+
+ app_info->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_app_info_ops_t));
+ app_info->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ app_info->ops->get_base_impl =
+ app_info_impl_l->app_info.ops->get_base_impl;
+ app_info->ops->get_source =
+ app_info_impl_l->app_info.ops->get_source;
+ app_info->ops->set_source =
+ app_info_impl_l->app_info.ops->set_source;
+ app_info->ops->get_markup =
+ app_info_impl_l->app_info.ops->get_markup;
+ app_info->ops->set_markup =
+ app_info_impl_l->app_info.ops->set_markup;
+
+ return axis2_xml_schema_schema_obj_resolve_methods(&(app_info->base),
+ env, app_info_impl_l->schema_obj, methods);
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_app_info_get_source(void *app_info,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return INTF_TO_IMPL(app_info)->source;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_app_info_set_source(void *app_info,
+ axis2_env_t **env,
+ axis2_char_t *source)
+{
+ axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, source, AXIS2_FAILURE);
+ app_info_impl = INTF_TO_IMPL(app_info);
+
+ if(app_info_impl->source)
+ {
+ AXIS2_FREE((*env)->allocator, app_info_impl->source);
+ app_info_impl->source = NULL;
+ }
+ app_info_impl->source = AXIS2_STRDUP(source, env);
+ if(!app_info_impl->source)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ return AXIS2_SUCCESS;
+}
+
+/* TODO replace (void *) mark up with node list */
+void *AXIS2_CALL
+axis2_xml_schema_app_info_get_markup(void *app_info,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, NULL);
+ return INTF_TO_IMPL(app_info)->markup;
+}
+
+/* TODO replace (void *) mark up with node list */
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_app_info_set_markup(void *app_info,
+ axis2_env_t **env,
+ void *markup)
+{
+ axis2_xml_schema_app_info_impl_t *app_info_impl = NULL;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, markup, AXIS2_FAILURE);
+ app_info_impl = INTF_TO_IMPL(app_info);
+
+ app_info_impl->markup = markup;
+ return AXIS2_SUCCESS;
+}
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_choice.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_choice.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_choice.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_choice.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_choice.h>
+#include <axis2_xml_schema_group_base.h>
+
+typedef struct axis2_xml_schema_choice_impl axis2_xml_schema_choice_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_choice_impl
+{
+ axis2_xml_schema_choice_t choice;
+ axis2_xml_schema_group_base_t *base;
+ axis2_hash_t *methods;
+ axis2_xml_schema_obj_collection_t *items;
+};
+
+#define INTF_TO_IMPL(choice) ((axis2_xml_schema_choice_impl_t *) choice)
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_choice_free(void *choice,
+ axis2_env_t **env);
+
+axis2_xml_schema_group_base_t *AXIS2_CALL
+axis2_xml_schema_choice_get_base_impl(void *choice,
+ axis2_env_t **env);
+
+axis2_xml_schema_obj_collection_t *AXIS2_CALL
+axis2_xml_schema_choice_get_items(void *choice,
+ axis2_env_t **env);
+
+
+AXIS2_DECLARE(axis2_xml_schema_choice_t *)
+axis2_xml_schema_choice_create(axis2_env_t **env)
+{
+ axis2_xml_schema_choice_impl_t *choice_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ choice_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_choice_impl_t));
+
+ choice_impl->base = NULL;
+ choice_impl->methods = NULL;
+ choice_impl->items = NULL;
+ choice_impl->choice.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_choice_ops_t));
+
+ choice_impl->choice.ops->free = axis2_xml_schema_choice_free;
+ choice_impl->choice.ops->get_base_impl =
+ axis2_xml_schema_choice_get_base_impl;
+ choice_impl->choice.ops->get_items =
+ axis2_xml_schema_choice_get_items;
+
+ choice_impl->methods = axis2_hash_make(env);
+ if(!choice_impl->methods)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(choice_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_choice_free);
+ axis2_hash_set(choice_impl->methods, "get_items",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_choice_get_items);
+
+ choice_impl->base = axis2_xml_schema_group_base_create(env);
+ status = axis2_xml_schema_group_base_resolve_methods(
+ &(choice_impl->choice.base), env, choice_impl->base,
+ choice_impl->methods);
+
+ return &(choice_impl->choice);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_choice_free(void *choice,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_choice_impl_t *choice_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ choice_impl = INTF_TO_IMPL(choice);
+
+ if(choice_impl->items)
+ {
+ AXIS2_XML_SCHEMA_OBJ_COLLECTION_FREE(choice_impl->items, env);
+ choice_impl->items = NULL;
+ }
+
+ if(choice_impl->methods)
+ {
+ axis2_hash_free(choice_impl->methods, env);
+ choice_impl->methods = NULL;
+ }
+
+ if(choice_impl->base)
+ {
+ AXIS2_XML_SCHEMA_GROUP_BASE_FREE(choice_impl->base, env);
+ choice_impl->base = NULL;
+ }
+
+ if((&(choice_impl->choice))->ops)
+ {
+ AXIS2_FREE((*env)->allocator, (&(choice_impl->choice))->ops);
+ (&(choice_impl->choice))->ops = NULL;
+ }
+
+ if(choice_impl)
+ {
+ AXIS2_FREE((*env)->allocator, choice_impl);
+ choice_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_group_base_t *AXIS2_CALL
+axis2_xml_schema_choice_get_base_impl(void *choice,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_choice_impl_t *choice_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ choice_impl = INTF_TO_IMPL(choice);
+
+ return choice_impl->base;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_choice_resolve_methods(
+ axis2_xml_schema_choice_t *choice,
+ axis2_env_t **env,
+ axis2_xml_schema_choice_t *choice_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_choice_impl_t *choice_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, choice_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ choice_impl_l = (axis2_xml_schema_choice_impl_t *) choice_impl;
+
+ choice->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_choice_ops_t));
+ choice->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ choice->ops->get_base_impl =
+ choice_impl_l->choice.ops->get_base_impl;
+ choice->ops->get_items =
+ choice_impl_l->choice.ops->get_items;
+
+ return axis2_xml_schema_group_base_resolve_methods(&(choice->base),
+ env, choice_impl_l->base, methods);
+}
+
+axis2_xml_schema_obj_collection_t *AXIS2_CALL
+axis2_xml_schema_choice_get_items(void *choice,
+ axis2_env_t **env)
+{
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ return INTF_TO_IMPL(choice)->items;
+}
+
Added: 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=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,516 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_collection.h>
+#include <axis2_xml_schema.h>
+#include <axis2_validation_event_handler.h>
+#include <axis2_hash.h>
+
+typedef struct axis2_xml_schema_collection_impl axis2_xml_schema_collection_impl_t;
+
+/**
+ * @brief Xml Schema Obj Struct Impl
+ * Axis2 Xml Schema Obj
+ */
+struct axis2_xml_schema_collection_impl
+{
+ axis2_xml_schema_collection_t collection;
+ /**
+ * Namespaces we know about. Each one has an equivalent XmlSchema.
+ */
+ axis2_hash_t *namespcs;
+ /**
+ * 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_namespcs;
+ axis2_xml_schema_t *xml_schema;
+ axis2_hash_t *unresolved_types;
+};
+
+#define INTF_TO_IMPL(collection) ((axis2_xml_schema_collection_impl_t *) collection)
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_free(void *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
+axis2_xml_schema_collection_set_base_uri(void *collection,
+ axis2_env_t **env,
+ axis2_char_t *base_uri);
+
+/**
+ * This section should comply to the XMLSchema specification
+ * @see http://www.w3.org/TR/2004/PER-xmlschema-2-20040318/datatypes.html#built-in-datatypes
+ *
+ * This needs to be inspected by another pair of eyes
+ */
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_init(void *collection,
+ axis2_env_t **env);
+
+static axis2_status_t add_simple_type(void *collection,
+ axis2_env_t **env,
+ axis2_xml_schema_t *schema,
+ axis2_char_t *type_name);
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_xml_schema_collection_read_a_reader_and_validation_event_handler(
+ void *collection,
+ axis2_env_t **env,
+ void *reader,
+ axis2_validation_event_handler_t *veh);
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_xml_schema_collection_read_a_input_source_and_validation_event_handler(
+ void *collection,
+ axis2_env_t **env,
+ void *input_source,
+ axis2_validation_event_handler_t *veh);
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_xml_schema_collection_read_a_source_and_validation_event_handler(
+ void *collection,
+ axis2_env_t **env,
+ void *source,
+ axis2_validation_event_handler_t *veh);
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_xml_schema_collection_read_a_document_and_validation_event_handler(
+ void *collection,
+ axis2_env_t **env,
+ void *source,
+ axis2_validation_event_handler_t *veh)
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_xml_schema_collection_read_a_element(
+ void *collection,
+ axis2_env_t **env,
+ axis2_om_element_t *element,
+ axis2_om_node_t *node);
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_xml_schema_collection_read_a_document_and_uri_and_validation_event_handler(
+ void *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_a_element_and_uri(
+ void *collection,
+ axis2_env_t **env,
+ axis2_om_element_t *element,
+ axis2_om_node_t *node,
+ axis2_char_t *uri);
+
+axis2_xml_schema_element_t AXIS2_CALL
+axis2_xml_schema_collection_get_element_by_qname(void *collection,
+ axis2_env_t **env,
+ axis2_qname_t *qname);
+
+axis2_xml_schema_type_t *AXIS2_CALL
+axis2_xml_schema_collection_get_type_by_qame(void *collection,
+ axis2_env_t **env,
+ axis2_qname_t *schema_type_qname);
+
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_add_unresolved_type(void *collection,
+ axis2_env_t **env,
+ axis2_qname_t *qtype,
+ axis2_xml_schema_type_receiver_t *receiver);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_resolve_type(void *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_namespc_for_prefix(void *collection,
+ axis2_env_t **env,
+ axis2_chat_t *prefix);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_map_namespace(void *collection,
+ axis2_env_t **env,
+ axis2_char_t *prefix,
+ axis2_char_t *namespc_uri);
+
+
+AXIS2_DECLARE(axis2_xml_schema_collection_t *)
+axis2_xml_schema_collection_create(axis2_env_t **env)
+{
+ axis2_xml_schema_collection_impl_t *collection_impl = NULL;
+
+ collection_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_collection_impl_t));
+
+ collection_impl->objs = NULL;
+
+ collection_impl->collection.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_collection_ops_t));
+
+ axis2_xml_schema_collection_init();
+
+ collection_impl->collection.ops->free =
+ axis2_xml_schema_collection_free;
+ collection_impl->collection.ops->set_base_uri =
+ axis2_xml_schema_collection_set_base_uri;
+ collection_impl->collection.ops->init =
+ axis2_xml_schema_collection_init;
+ collection_impl->collection.ops->add_simple_type =
+ axis2_xml_schema_collection_add_simple_type;
+ 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_a_input_source_and_validation_event_handler =
+ axis2_xml_schema_collection_read_a_input_source_and_validation_event_handler;
+ 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_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->ed_a_document_and_uri_and_validation_event_handler=
+ axis2_xml_schema_collection_read_a_document_and_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;
+
+ return &(collection_impl->collection);
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_free(void *collection,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_collection_impl_t *collection_impl = NULL;
+
+ collection_impl = INTF_TO_IMPL(collection);
+
+ if(collection_impl->objs)
+ {
+ AXIS2_ARRAY_LIST_FREE(collection_impl->objs, env);
+ collection_impl->objs = NULL;
+ }
+
+ if((&(collection_impl->collection))->ops)
+ {
+ free((&(collection_impl->collection))->ops);
+ (&(collection_impl->collection))->ops = NULL;
+ }
+
+ if(collection_impl)
+ {
+ free(collection_impl);
+ collection_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_collection_resolve_methods(
+ axis2_xml_schema_collection_t *collection,
+ axis2_env_t **env,
+ axis2_xml_schema_collection_t *collection_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_collection_impl_t *collection_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, collection_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ collection_impl_l = (axis2_xml_schema_collection_impl_t *) collection_impl;
+
+ collection->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_collection_ops_t));
+ collection->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ collection->ops->set_base_uri =
+ collection_impl_l->collection.ops->set_base_uri;
+ collection->ops->init =
+ collection_impl_l->collection.ops->init;
+ collection->ops->add_simple_type =
+ collection_impl_l->collection.ops->add_simple_type;
+ collection->ops->read_a_reader_and_validation_event_handler =
+ collection_impl_l->collection.ops->read_a_reader_and_validation_event_handler;
+ collection->ops->read_a_input_source_and_validation_event_handler =
+ collection_impl_l->collection.ops->read_a_input_source_and_validation_event_handler;
+ collection->ops->read_a_source_and_validation_event_handler =
+ collection_impl_l->collection.ops->read_a_source_and_validation_event_handler;
+ collection->ops->read_a_document_and_validation_event_handler =
+ collection_impl_l->collection.ops->read_a_document_and_validation_event_handler;
+ collection->ops->read_a_element =
+ collection_impl_l->collection.ops->read_a_element;
+ collection->ops->read_a_document_and_uri_and_validation_event_handler =
+ collection_impl_l->collection.ops->read_a_document_and_uri_and_validation_event_handler;
+ collection->ops->read_a_element_and_uri =
+ collection_impl_l->collection.ops->read_a_element_and_uri;
+ collection->ops->get_element_by_qname =
+ collection_impl_l->collection.ops->get_element_by_qname;
+ collection->ops->get_type_by_qname =
+ collection_impl_l->collection.ops->get_type_by_qname;
+ collection->ops->add_unresolved_type =
+ collection_impl_l->collection.ops->add_unresolved_type;
+ collection->ops->resolve_type =
+ collection_impl_l->collection.ops->resolve_type;
+ collection->ops->get_namespace_for_prefix =
+ collection_impl_l->collection.ops->get_namespace_for_prefix;
+ collection->ops->map_namespace =
+ collection_impl_l->collection.ops->map_namespace;
+ return AXIS2_SUCCESS;
+
+}
+
+/**
+ * Set the base URI. This is used when schemas need to be
+ * loaded from relative locations
+ * @param base_uri
+ */
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_set_base_uri(void *collection,
+ axis2_env_t **env,
+ axis2_char_t *base_uri)
+{
+ return AXIS2_SUCCESS;
+}
+
+/**
+ * This section should comply to the XMLSchema specification
+ * @see http://www.w3.org/TR/2004/PER-xmlschema-2-20040318/datatypes.html#built-in-datatypes
+ *
+ * This needs to be inspected by another pair of eyes
+ */
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_init(void *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(void *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(
+ void *collection,
+ axis2_env_t **env,
+ void *reader,
+ axis2_validation_event_handler_t *veh)
+{
+ return NULL;
+}
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_xml_schema_collection_read_a_input_source_and_validation_event_handler(
+ void *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(
+ void *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_document_and_validation_event_handler(
+ void *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(
+ void *collection,
+ axis2_env_t **env,
+ axis2_om_element_t *element,
+ axis2_om_node_t *node)
+{
+ return NULL;
+}
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_xml_schema_collection_read_a_document_and_uri_and_validation_event_handler(
+ void *collection,
+ axis2_env_t **env,
+ void *document,
+ axis2_char_t *uri,
+ axis2_validation_event_handler_t *veh)
+{
+ return NULL;
+}
+
+axis2_xml_schema_t *AXIS2_CALL
+axis2_xml_schema_collection_read_a_element_and_uri(
+ void *collection,
+ axis2_env_t **env,
+ axis2_om_element_t *element,
+ 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(void *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_qame(void *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(void *collection,
+ axis2_env_t **env,
+ axis2_qname_t *qtype,
+ axis2_xml_schema_type_receiver_t *receiver)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_resolve_type(void *collection,
+ axis2_env_t **env,
+ axis2_qname_t *type_qame,
+ axis2_xml_schema_type_t *type)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_collection_get_namespc_for_prefix(void *collection,
+ axis2_env_t **env,
+ axis2_chat_t *prefix)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_collection_map_namespace(void *collection,
+ axis2_env_t **env,
+ axis2_char_t *prefix,
+ axis2_char_t *namespc_uri)
+{
+ return AXIS2_SUCCESS;
+}
+
+
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.loT
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.loT?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.loT (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_collection.loT Mon Apr 17 05:15:47 2006
@@ -0,0 +1,7 @@
+# xml_schema_collection.lo - a libtool object file
+# Generated by ltmain.sh - GNU libtool 1.5.6 (1.1220.2.95 2004/04/11 05:50:42) Debian: 224 $
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_processing.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_processing.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_processing.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_content_processing.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_content_processing.h>
+
+typedef struct axis2_xml_schema_content_processing_impl
+ axis2_xml_schema_content_processing_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_content_processing_impl
+{
+ axis2_xml_schema_content_processing_t content_processing;
+ axis2_xml_schema_enum_t *schema_enum;
+ axis2_hash_t *methods;
+ axis2_array_list_t *members;
+};
+
+#define INTF_TO_IMPL(content_processing) \
+ ((axis2_xml_schema_content_processing_impl_t *) content_processing)
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_content_processing_free(void *content_processing,
+ axis2_env_t **env);
+
+axis2_xml_schema_enum_t *AXIS2_CALL
+axis2_xml_schema_content_processing_get_base_impl(void *content_processing,
+ axis2_env_t **env);
+
+axis2_array_list_t *
+axis2_xml_schema_content_processing_get_values(void *content_processing,
+ axis2_env_t **env);
+
+
+AXIS2_DECLARE(axis2_xml_schema_content_processing_t *)
+axis2_xml_schema_content_processing_create(axis2_env_t **env,
+ axis2_char_t *value)
+{
+ axis2_xml_schema_content_processing_impl_t *content_processing_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ content_processing_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_content_processing_impl_t));
+
+ content_processing_impl->schema_enum = NULL;
+ content_processing_impl->methods = NULL;
+ content_processing_impl->members = NULL;
+ content_processing_impl->content_processing.ops =
+ AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_content_processing_ops_t));
+
+ content_processing_impl->content_processing.ops->free =
+ axis2_xml_schema_content_processing_free;
+ content_processing_impl->content_processing.ops->get_base_impl =
+ axis2_xml_schema_content_processing_get_base_impl;
+ content_processing_impl->content_processing.ops->get_values =
+ axis2_xml_schema_content_processing_get_values;
+
+ if(!content_processing_impl->members)
+ {
+ content_processing_impl->members = axis2_array_list_create(env, 0);
+ if(!content_processing_impl->members)
+ return NULL;
+ AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env, "Lax");
+ AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env, "None");
+ AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env, "Skip");
+ AXIS2_ARRAY_LIST_ADD(content_processing_impl->members, env, "Strict");
+ }
+
+ content_processing_impl->methods = axis2_hash_make(env);
+ if(!content_processing_impl->methods)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(content_processing_impl->methods, "free",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_content_processing_free);
+ axis2_hash_set(content_processing_impl->methods, "get_values",
+ AXIS2_HASH_KEY_STRING, axis2_xml_schema_content_processing_get_values);
+
+ content_processing_impl->schema_enum = axis2_xml_schema_enum_create(env, NULL);
+ status = axis2_xml_schema_enum_resolve_methods(
+ &(content_processing_impl->content_processing.base), env,
+ content_processing_impl->schema_enum,
+ content_processing_impl->methods);
+
+ return &(content_processing_impl->content_processing);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_content_processing_free(void *content_processing,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_content_processing_impl_t *content_processing_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ content_processing_impl = INTF_TO_IMPL(content_processing);
+
+ if(content_processing_impl->members)
+ {
+ AXIS2_ARRAY_LIST_FREE(content_processing_impl->members, env);
+ content_processing_impl->members = NULL;
+ }
+
+ if(content_processing_impl->methods)
+ {
+ axis2_hash_free(content_processing_impl->methods, env);
+ content_processing_impl->methods = NULL;
+ }
+ if(content_processing_impl->schema_enum)
+ {
+ AXIS2_XML_SCHEMA_ENUM_FREE(content_processing_impl->schema_enum, env);
+ content_processing_impl->schema_enum = NULL;
+ }
+
+ if((&(content_processing_impl->content_processing))->ops)
+ {
+ AXIS2_FREE((*env)->allocator, (&(content_processing_impl->
+ content_processing))->ops);
+ (&(content_processing_impl->content_processing))->ops = NULL;
+ }
+
+ if(content_processing_impl)
+ {
+ AXIS2_FREE((*env)->allocator, content_processing_impl);
+ content_processing_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_enum_t *AXIS2_CALL
+axis2_xml_schema_content_processing_get_base_impl(void *content_processing,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_content_processing_impl_t *content_processing_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ content_processing_impl = INTF_TO_IMPL(content_processing);
+
+ return content_processing_impl->schema_enum;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_content_processing_resolve_methods(
+ axis2_xml_schema_content_processing_t *content_processing,
+ axis2_env_t **env,
+ axis2_xml_schema_content_processing_t *content_processing_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_content_processing_impl_t *content_processing_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, content_processing_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ content_processing_impl_l = (axis2_xml_schema_content_processing_impl_t *)
+ content_processing_impl;
+
+ content_processing->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_content_processing_ops_t));
+ content_processing->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ content_processing->ops->get_base_impl =
+ content_processing_impl_l->content_processing.ops->get_base_impl;
+ content_processing->ops->get_values =
+ content_processing_impl_l->content_processing.ops->get_values;
+
+ return axis2_xml_schema_enum_resolve_methods(
+ &(content_processing->base),
+ env, content_processing_impl_l->schema_enum, methods);
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_xml_schema_content_processing_get_values(void *content_processing,
+ axis2_env_t **env)
+{
+ return INTF_TO_IMPL(content_processing)->members;
+}
+
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_data_type.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_data_type.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_data_type.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_data_type.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,156 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_data_type.h>
+#include <axis2_xml_tokenized_type.h>
+#include <axis2_hash.h>
+
+typedef struct axis2_xml_schema_data_type_impl axis2_xml_schema_data_type_impl_t;
+
+/**
+ * @brief Xml Schema Data Type Struct Impl
+ * Axis2 Xml Schema Data Type
+ */
+struct axis2_xml_schema_data_type_impl
+{
+ axis2_xml_schema_data_type_t data_type;
+};
+
+#define INTF_TO_IMPL(data_type) ((axis2_xml_schema_data_type_impl_t *) data_type)
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_data_type_free(void *data_type,
+ axis2_env_t **env);
+
+void * AXIS2_CALL
+axis2_xml_schema_data_type_parse_value(void *data_type,
+ axis2_env_t **env,
+ void *input);
+
+void *AXIS2_CALL
+axis2_xml_schema_data_type_value_type(void *data_type,
+ axis2_env_t **env);
+
+axis2_xml_tokenized_type_t *AXIS2_CALL
+axis2_xml_schema_data_type_tokenized_type(void *data_type,
+ axis2_env_t **env);
+
+AXIS2_DECLARE(axis2_xml_schema_data_type_t *)
+axis2_xml_schema_data_type_create(axis2_env_t **env)
+{
+ axis2_xml_schema_data_type_impl_t *data_type_impl = NULL;
+
+ data_type_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_data_type_impl_t));
+
+ data_type_impl->data_type.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_data_type_ops_t));
+
+
+ data_type_impl->data_type.ops->free = axis2_xml_schema_data_type_free;
+ data_type_impl->data_type.ops->parse_value = axis2_xml_schema_data_type_parse_value;
+ data_type_impl->data_type.ops->value_type = axis2_xml_schema_data_type_value_type;
+ data_type_impl->data_type.ops->tokenized_type = axis2_xml_schema_data_type_tokenized_type;
+
+ return &(data_type_impl->data_type);
+}
+
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_data_type_free(void *data_type,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_data_type_impl_t *data_type_impl = NULL;
+
+ data_type_impl = INTF_TO_IMPL(data_type);
+
+ if((&(data_type_impl->data_type))->ops)
+ {
+ free((&(data_type_impl->data_type))->ops);
+ (&(data_type_impl->data_type))->ops = NULL;
+ }
+
+ if(data_type_impl)
+ {
+ free(data_type_impl);
+ data_type_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_data_type_resolve_methods(
+ axis2_xml_schema_data_type_t *data_type,
+ axis2_env_t **env,
+ axis2_xml_schema_data_type_t *data_type_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_data_type_impl_t *data_type_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, data_type_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ data_type_impl_l = (axis2_xml_schema_data_type_impl_t *) data_type_impl;
+
+ data_type->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_data_type_ops_t));
+ data_type->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ data_type->ops->parse_value = axis2_hash_get(methods, "parse_value",
+ AXIS2_HASH_KEY_STRING);
+ data_type->ops->value_type = axis2_hash_get(methods, "value_type",
+ AXIS2_HASH_KEY_STRING);
+ data_type->ops->tokenized_type = axis2_hash_get(methods, "tokenized_type",
+ AXIS2_HASH_KEY_STRING);
+ return AXIS2_SUCCESS;
+
+}
+void * AXIS2_CALL
+axis2_xml_schema_data_type_parse_value(void *data_type,
+ axis2_env_t **env,
+ void *input)
+{
+ axis2_xml_schema_data_type_impl_t *data_type_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ data_type_impl = INTF_TO_IMPL(data_type);
+ return NULL;
+}
+
+void *AXIS2_CALL
+axis2_xml_schema_data_type_value_type(void *data_type,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_data_type_impl_t *data_type_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ data_type_impl = INTF_TO_IMPL(data_type);
+
+ return NULL;
+}
+
+axis2_xml_tokenized_type_t *AXIS2_CALL
+axis2_xml_schema_data_type_tokenized_type(void *data_type,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_data_type_impl_t *data_type_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ data_type_impl = INTF_TO_IMPL(data_type);
+ return NULL;
+}
+
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_derivation_method.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_derivation_method.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_derivation_method.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_derivation_method.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,190 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_derivation_method.h>
+
+typedef struct axis2_xml_schema_derivation_method_impl axis2_xml_schema_derivation_method_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_derivation_method_impl
+{
+ axis2_xml_schema_derivation_method_t derivation_method;
+ axis2_xml_schema_enum_t *schema_enum;
+ axis2_hash_t *methods;
+ axis2_array_list_t *members;
+};
+
+#define INTF_TO_IMPL(derivation_method) ((axis2_xml_schema_derivation_method_impl_t *) derivation_method)
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_derivation_method_free(void *derivation_method,
+ axis2_env_t **env);
+
+axis2_xml_schema_enum_t *AXIS2_CALL
+axis2_xml_schema_derivation_method_get_base_impl(void *derivation_method,
+ axis2_env_t **env);
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_derivation_method_resolve_methods(
+ axis2_xml_schema_derivation_method_t *derivation_method,
+ axis2_env_t **env,
+ axis2_xml_schema_derivation_method_t *derivation_method_impl,
+ axis2_hash_t *methods);
+
+axis2_array_list_t *
+axis2_xml_schema_derivation_method_get_values(void *derivation_method,
+ axis2_env_t **env);
+
+
+AXIS2_DECLARE(axis2_xml_schema_derivation_method_t *)
+axis2_xml_schema_derivation_method_create(axis2_env_t **env,
+ axis2_char_t *value)
+{
+ axis2_xml_schema_derivation_method_impl_t *derivation_method_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ derivation_method_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_derivation_method_impl_t));
+
+ derivation_method_impl->schema_enum = NULL;
+ derivation_method_impl->methods = NULL;
+ derivation_method_impl->members = NULL;
+ derivation_method_impl->derivation_method.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_derivation_method_ops_t));
+
+ derivation_method_impl->derivation_method.ops->free = axis2_xml_schema_derivation_method_free;
+ derivation_method_impl->derivation_method.ops->get_base_impl = axis2_xml_schema_derivation_method_get_base_impl;
+ derivation_method_impl->derivation_method.ops->get_values =
+ axis2_xml_schema_derivation_method_get_values;
+
+ if(!derivation_method_impl->members)
+ {
+ derivation_method_impl->members = axis2_array_list_create(env, 0);
+ if(!derivation_method_impl->members)
+ return NULL;
+ AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env, "All");
+ AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env, "Empty");
+ AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env, "Extension");
+ AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env, "List");
+ AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env, "None");
+ AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env, "Restriction");
+ AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env, "Substitution");
+ AXIS2_ARRAY_LIST_ADD(derivation_method_impl->members, env, "Union");
+ }
+ derivation_method_impl->methods = axis2_hash_make(env);
+ if(!derivation_method_impl->methods)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(derivation_method_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_derivation_method_free);
+ axis2_hash_set(derivation_method_impl->methods, "get_values", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_derivation_method_get_values);
+
+ derivation_method_impl->schema_enum = axis2_xml_schema_enum_create(env, value);
+ status = axis2_xml_schema_enum_resolve_methods(
+ &(derivation_method_impl->derivation_method.base), env, derivation_method_impl->schema_enum,
+ derivation_method_impl->methods);
+
+ return &(derivation_method_impl->derivation_method);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_derivation_method_free(void *derivation_method,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_derivation_method_impl_t *derivation_method_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ derivation_method_impl = INTF_TO_IMPL(derivation_method);
+
+ if(derivation_method_impl->members)
+ {
+ AXIS2_ARRAY_LIST_FREE(derivation_method_impl->members, env);
+ derivation_method_impl->members = NULL;
+ }
+
+ if(derivation_method_impl->schema_enum)
+ {
+ AXIS2_XML_SCHEMA_ENUM_FREE(derivation_method_impl->schema_enum, env);
+ derivation_method_impl->schema_enum = NULL;
+ }
+
+ if((&(derivation_method_impl->derivation_method))->ops)
+ {
+ AXIS2_FREE((*env)->allocator, (&(derivation_method_impl->derivation_method))->ops);
+ (&(derivation_method_impl->derivation_method))->ops = NULL;
+ }
+
+ if(derivation_method_impl)
+ {
+ AXIS2_FREE((*env)->allocator, derivation_method_impl);
+ derivation_method_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_enum_t *AXIS2_CALL
+axis2_xml_schema_derivation_method_get_base_impl(void *derivation_method,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_derivation_method_impl_t *derivation_method_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ derivation_method_impl = INTF_TO_IMPL(derivation_method);
+
+ return derivation_method_impl->schema_enum;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_derivation_method_resolve_methods(
+ axis2_xml_schema_derivation_method_t *derivation_method,
+ axis2_env_t **env,
+ axis2_xml_schema_derivation_method_t *derivation_method_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_derivation_method_impl_t *derivation_method_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, derivation_method_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ derivation_method_impl_l = (axis2_xml_schema_derivation_method_impl_t *) derivation_method_impl;
+
+ derivation_method->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_derivation_method_ops_t));
+ derivation_method->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ derivation_method->ops->get_base_impl =
+ derivation_method_impl_l->derivation_method.ops->get_base_impl;
+ derivation_method->ops->get_values =
+ derivation_method_impl_l->derivation_method.ops->get_values;
+
+ return axis2_xml_schema_enum_resolve_methods(&(derivation_method->base),
+ env, derivation_method_impl_l->schema_enum, methods);
+}
+
+axis2_array_list_t *AXIS2_CALL
+axis2_xml_schema_derivation_method_get_values(void *derivation_method,
+ axis2_env_t **env)
+{
+ return INTF_TO_IMPL(derivation_method)->members;
+}
+
Added: webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_element.c?rev=394660&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_element.c (added)
+++ webservices/axis2/trunk/c/modules/xml/xml_schema/xml_schema_element.c Mon Apr 17 05:15:47 2006
@@ -0,0 +1,614 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <axis2_xml_schema_element.h>
+#include <axis2_xml_schema_annotation.h>
+
+typedef struct axis2_xml_schema_element_impl axis2_xml_schema_element_impl_t;
+
+/**
+ * @brief Other Extension Struct Impl
+ * Axis2 Other Extension
+ */
+struct axis2_xml_schema_element_impl
+{
+ axis2_xml_schema_element_t element;
+ axis2_xml_schema_type_reciever_t *type_recv;
+ axis2_xml_particle_t *particle;
+ axis2_hash_t *methods;
+ /**
+ * Attribute used to block a type derivation.
+ */
+ axis2_xml_schema_derivation_method_t *block;
+
+ /**
+ * The value after an element has been compiled to post-schema infoset.
+ * This value is either from the type itself or, if not defined on the
+ * type, taken from the schema element.
+ */
+ axis2_xml_schema_derivation_method_t *block_resolved;
+ axis2_xml_schema_obj_collection_t *constraints;
+
+ /**
+ * Provides the default value of the element if its content
+ * is a simple type or the element's content is textOnly.
+ */
+ axis2_char_t *default_value;
+ axis2_char_t *fixed_value;
+
+ /**
+ * Returns the correct common runtime library
+ * object based upon the Schema Type for the element.
+ */
+ void *element_type;
+
+ axis2_xml_schema_derivation_method_t *final_derivation;
+ axis2_xml_schema_derivation_method_t *final_derivation_resolved;
+
+ /**
+ * The default value is the value of the Element Form Default attribute for
+ * the schema element containing the attribute. The default is Unqualified.
+ */
+ axis2_xml_schema_form_t *form;
+ axis2_bool_t is_abstract;
+ axis2_bool_t is_nillable;
+ axis2_char_t *name;
+ axis2_qname_t *qualified_qname;
+ axis2_qname_t *ref_qname;
+
+ /**
+ * Returns the type of the element.
+ * This can either be a complex type or a simple type.
+ */
+ axis2_xml_schema_type_t *schema_type;
+
+ /**
+ * QName of a built-in data type defined in this schema or another
+ * schema indicated by the specified namespace.
+ */
+ axis2_qname_t *schema_type_qname;
+
+ /**
+ * QName of an element that can be a substitute for this element.
+ */
+ axis2_qname_t *substitution_group;
+
+};
+
+#define INTF_TO_IMPL(element) ((axis2_xml_schema_element_impl_t *) element)
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_free(void *element,
+ axis2_env_t **env);
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_element_get_base_impl(void *element,
+ axis2_env_t **env);
+
+/**
+ * Returns a collection of constraints on the element.
+ */
+axis2_xml_schema_obj_collection_t *AXIS2_CALL
+axis2_xml_schema_element_get_constraints(void *element,
+ axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_element_get_default_value(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_default_value(void *element,
+ axis2_env_t **env,
+ axis2_char_t *default_value);
+
+axis2_xml_schema_derivation_method_t *AXIS2_CALL
+axis2_xml_schema_element_get_block(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_block(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_derivation_method_t * block);
+
+axis2_xml_schema_derivation_method_t *AXIS2_CALL
+axis2_xml_schema_element_get_final(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_final(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_derivation_method_t *final_derivation);
+
+axis2_xml_schema_derivation_method_t *AXIS2_CALL
+axis2_xml_schema_element_get_block_resolved(void *element,
+ axis2_env_t **env);
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_element_get_fixed_value(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_fixed_value(void *element,
+ axis2_env_t **env,
+ axis2_char_t *fixed_value);
+void *AXIS2_CALL
+axis2_xml_schema_element_get_element_type(void *element,
+ axis2_env_t **env);
+
+axis2_xml_schema_form_t *AXIS2_CALL
+axis2_xml_schema_element_get_form(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_form(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_form_t *form);
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_element_is_abstract(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_abstract(void *element,
+ axis2_env_t **env,
+ axis2_bool_t is_abstract);
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_element_is_nillable(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_nillable(void *element,
+ axis2_env_t **env,
+ axis2_bool_t is_nillable);
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_element_get_name(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_name(void *element,
+ axis2_env_t **env,
+ axis2_char_t *name);
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_element_get_ref_qname(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_ref_qname(void *element,
+ axis2_env_t **env,
+ axis2_qname_t *ref_qname);
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_element_get_qname(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_qname(void *element,
+ axis2_env_t **env,
+ axis2_qname_t *qualified_name);
+
+axis2_xml_schema_type_t *AXIS2_CALL
+axis2_xml_schema_element_get_schema_type(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_schema_type(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_type_t *schema_type);
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_element_get_schema_type_qname(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_schema_type_name(void *element,
+ axis2_env_t **env,
+ axis2_qname_t *schema_type_qname);
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_element_get_substitution_group(void *element,
+ axis2_env_t **env);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_substitution_group(void *element,
+ axis2_env_t **env,
+ axis2_qname_t *substitution_group);
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_element_to_string(void *element,
+ axis2_env_t **env,
+ axis2_char_t *prefix,
+ int tab);
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_type(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_type_t *type);
+
+AXIS2_DECLARE(axis2_xml_schema_element_t *)
+axis2_xml_schema_element_create(axis2_env_t **env)
+{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+ axis2_status_t status = AXIS2_FAILURE;
+
+ element_impl = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_element_impl_t));
+
+ element_impl->schema_obj = NULL;
+ element_impl->methods = NULL;
+ element_impl->id = NULL;
+ element_impl->annotation = NULL;
+ element_impl->unhandled_attrs = NULL;
+
+ element_impl->element.ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_element_ops_t));
+
+ element_impl->element.ops->free = axis2_xml_schema_element_free;
+ element_impl->element.ops->get_base_impl =
+ axis2_xml_schema_element_get_base_impl;
+ element_impl->element.ops-> =
+ axis2_xml_schema_element_;
+
+ element_impl->methods = axis2_hash_make(env);
+ if(!element_impl->methods)
+ {
+ AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+ axis2_hash_set(element_impl->methods, "free", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_element_free);
+ axis2_hash_set(element_impl->methods, "", AXIS2_HASH_KEY_STRING,
+ axis2_xml_schema_element_);
+
+ element_impl->schema_obj = axis2_xml_schema_obj_create(env);
+ status = axis2_xml_schema_obj_resolve_methods(
+ &(element_impl->element.base), env, element_impl->schema_obj,
+ element_impl->methods);
+
+ return &(element_impl->element);
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_free(void *element,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ element_impl = INTF_TO_IMPL(element);
+
+ if(element_impl->id)
+ {
+ AXIS2_FREE((*env)->allocator, element_impl->id);
+ element_impl->id = NULL;
+ }
+
+ if(element_impl->annotation)
+ {
+ AXIS2_XML_SCHEMA_ANNOTATION_FREE(element_impl->annotation, env);
+ element_impl->annotation = NULL;
+ }
+
+ if(element_impl->unhandled_attrs)
+ {
+ AXIS2_ARRAY_LIST_FREE(element_impl->unhandled_attrs, env);
+ element_impl->unhandled_attrs = NULL;
+ }
+
+ if(element_impl->methods)
+ {
+ axis2_hash_free(element_impl->methods, env);
+ element_impl->methods = NULL;
+ }
+
+ if(element_impl->schema_obj)
+ {
+ AXIS2_XML_SCHEMA_OBJ_FREE(element_impl->schema_obj, env);
+ element_impl->schema_obj = NULL;
+ }
+
+ if((&(element_impl->element))->ops)
+ {
+ AXIS2_FREE((*env)->allocator, (&(element_impl->element))->ops);
+ (&(element_impl->element))->ops = NULL;
+ }
+
+ if(element_impl)
+ {
+ AXIS2_FREE((*env)->allocator, element_impl);
+ element_impl = NULL;
+ }
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_obj_t *AXIS2_CALL
+axis2_xml_schema_element_get_base_impl(void *element,
+ axis2_env_t **env)
+{
+ axis2_xml_schema_element_impl_t *element_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, NULL);
+ element_impl = INTF_TO_IMPL(element);
+
+ return element_impl->schema_obj;
+}
+
+AXIS2_DECLARE(axis2_status_t)
+axis2_xml_schema_element_resolve_methods(
+ axis2_xml_schema_element_t *element,
+ axis2_env_t **env,
+ axis2_xml_schema_element_t *element_impl,
+ axis2_hash_t *methods)
+{
+ axis2_xml_schema_element_impl_t *element_impl_l = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, element_impl, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK((*env)->error, methods, AXIS2_FAILURE);
+
+ element_impl_l = (axis2_xml_schema_element_impl_t *) element_impl;
+
+ element->ops = AXIS2_MALLOC((*env)->allocator,
+ sizeof(axis2_xml_schema_element_ops_t));
+ element->ops->free = axis2_hash_get(methods, "free",
+ AXIS2_HASH_KEY_STRING);
+ element->ops->get_base_impl =
+ element_impl_l->element.ops->get_base_impl;
+ element->ops-> =
+ element_impl_l->element.ops->;
+
+ return axis2_xml_schema_schema_type_receiver_resolve_methods(&(element->base),
+ env, element_impl_l->type_recv, methods);
+}
+
+
+/**
+ * Returns a collection of constraints on the element.
+ */
+axis2_xml_schema_obj_collection_t *AXIS2_CALL
+axis2_xml_schema_element_get_constraints(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_element_get_default_value(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_default_value(void *element,
+ axis2_env_t **env,
+ axis2_char_t *default_value)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_derivation_method_t *AXIS2_CALL
+axis2_xml_schema_element_get_block(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_block(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_derivation_method_t * block)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_derivation_method_t *AXIS2_CALL
+axis2_xml_schema_element_get_final(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_final(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_derivation_method_t *final_derivation)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_derivation_method_t *AXIS2_CALL
+axis2_xml_schema_element_get_block_resolved(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_element_get_fixed_value(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_fixed_value(void *element,
+ axis2_env_t **env,
+ axis2_char_t *fixed_value)
+{
+ return AXIS2_SUCCESS;
+}
+
+void *AXIS2_CALL
+axis2_xml_schema_element_get_element_type(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_xml_schema_form_t *AXIS2_CALL
+axis2_xml_schema_element_get_form(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_form(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_form_t *form)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_element_is_abstract(void *element,
+ axis2_env_t **env)
+{
+ return AXIS2_TRUE;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_abstract(void *element,
+ axis2_env_t **env,
+ axis2_bool_t is_abstract)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_xml_schema_element_is_nillable(void *element,
+ axis2_env_t **env)
+{
+ return AXIS2_TRUE;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_nillable(void *element,
+ axis2_env_t **env,
+ axis2_bool_t is_nillable)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_element_get_name(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_name(void *element,
+ axis2_env_t **env,
+ axis2_char_t *name)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_element_get_ref_qname(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_ref_qname(void *element,
+ axis2_env_t **env,
+ axis2_qname_t *ref_qname)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_element_get_qname(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_qname(void *element,
+ axis2_env_t **env,
+ axis2_qname_t *qualified_name)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_xml_schema_type_t *AXIS2_CALL
+axis2_xml_schema_element_get_schema_type(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_schema_type(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_type_t *schema_type)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_element_get_schema_type_qname(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_schema_type_name(void *element,
+ axis2_env_t **env,
+ axis2_qname_t *schema_type_qname)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_qname_t *AXIS2_CALL
+axis2_xml_schema_element_get_substitution_group(void *element,
+ axis2_env_t **env)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_substitution_group(void *element,
+ axis2_env_t **env,
+ axis2_qname_t *substitution_group)
+{
+ return AXIS2_SUCCESS;
+}
+
+axis2_char_t *AXIS2_CALL
+axis2_xml_schema_element_to_string(void *element,
+ axis2_env_t **env,
+ axis2_char_t *prefix,
+ int tab)
+{
+ return NULL;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_xml_schema_element_set_type(void *element,
+ axis2_env_t **env,
+ axis2_xml_schema_type_t *type)
+{
+ return AXIS2_SUCCESS;
+}