axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r412387 - in /webservices/axis2/trunk/c/woden/src/util: Makefile.am woden_om_util.c woden_om_util.h
Date Wed, 07 Jun 2006 12:22:46 GMT
Author: damitha
Date: Wed Jun  7 05:22:45 2006
New Revision: 412387

URL: http://svn.apache.org/viewvc?rev=412387&view=rev
Log:
More work on woden_om_util

Added:
    webservices/axis2/trunk/c/woden/src/util/woden_om_util.h
Modified:
    webservices/axis2/trunk/c/woden/src/util/Makefile.am
    webservices/axis2/trunk/c/woden/src/util/woden_om_util.c

Modified: webservices/axis2/trunk/c/woden/src/util/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/util/Makefile.am?rev=412387&r1=412386&r2=412387&view=diff
==============================================================================
--- webservices/axis2/trunk/c/woden/src/util/Makefile.am (original)
+++ webservices/axis2/trunk/c/woden/src/util/Makefile.am Wed Jun  7 05:22:45 2006
@@ -2,9 +2,9 @@
 lib_LTLIBRARIES = libaxis2_woden_util.la
 
 libaxis2_woden_util_la_SOURCES = \
-								 om_util.c \
 								 generic_obj.c \
-								 qname_util.c
+								 qname_util.c \
+								 woden_om_util.c
 
 INCLUDES = -I$(top_builddir)/include \
 			@UTILINC@

Modified: webservices/axis2/trunk/c/woden/src/util/woden_om_util.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/util/woden_om_util.c?rev=412387&r1=412386&r2=412387&view=diff
==============================================================================
--- webservices/axis2/trunk/c/woden/src/util/woden_om_util.c (original)
+++ webservices/axis2/trunk/c/woden/src/util/woden_om_util.c Wed Jun  7 05:22:45 2006
@@ -14,15 +14,15 @@
  * limitations under the License.
  */
  
-#include <woden_om_node.h>
-#include <woden_om_element.h>
+#include <woden_om_util.h>
 #include <axis2_qname.h>
+#include <axis2_om_element.h>
 
 
 AXIS2_EXTERN axis2_qname_t * AXIS2_CALL
 woden_om_util_get_qname(
         const axis2_env_t *env,
-        woden_om_node_t *context_el_node,
+        axis2_om_node_t *context_el_node,
         axis2_char_t *prefixed_value,
         void *desc)
 {
@@ -30,14 +30,19 @@
     axis2_char_t *prefix = "";
     axis2_char_t *localpart = NULL;
     axis2_char_t *namespc_uri_str = NULL;
+    axis2_om_element_t *context_el = NULL;
+    axis2_om_namespace_t *namespc_uri = NULL;
 
     index = axis2_rindex(prefixed_value, ':');
     localpart = index + 1;
     index[0] = '\0';
     prefix = prefixed_value;
 
-    namespc_uri_str = woden_om_util_get_namespace_uri_from_prefix(
-            env, context_el_node, prefix);
+    context_el = AXIS2_OM_NODE_GET_DATA_ELEMENT(context_el_node, env);
+
+    namespc_uri = AXIS2_OM_ELEMENT_FIND_NAMESPACE_URI(context_el,
+            env, prefix, context_el_node);
+    namespc_uri_str = AXIS2_OM_NAMESPACE_GET_URI(namespc_uri, env);
     if(NULL != namespc_uri_str)
     {
         woden_om_util_register_unique_prefix(env, prefix, namespc_uri_str, desc);
@@ -47,7 +52,7 @@
 }        
  
 AXIS2_EXTERN axis2_status_t  AXIS2_CALL
-woden_om_util_get_qname(
+woden_om_util_register_unique_prefix(
         const axis2_env_t *env,
         axis2_char_t *prefix,
         axis2_char_t *namespc_uri_str,
@@ -82,42 +87,3 @@
     return AXIS2_WODEN_DESC_ELEMENT_ADD_NAMESPACE(desc, env, namespc_uri_str);
 }
  
-/**
-* Given a prefix and a node, return the namespace URI that the prefix
-* has been associated with. This method is useful in resolving the
-* namespace URI of attribute values which are being interpreted as
-* QNames. If prefix is null, this method will return the default
-* namespace.
-*
-* @param context the starting node (looks up recursively from here)
-* @param prefix the prefix to find an xmlns:prefix=uri for
-*
-* @return the namespace URI or null if not found
-*/
-AXIS2_EXTERN axis2_qname_t * AXIS2_CALL
-woden_om_util_get_namespace_uri_from_prefix(
-        const axis2_env_t *env,
-        axis2_om_node_t *context_el_node,
-        axis2_char_t *prefix)
-{
-    axis2_om_types_t node_type = AXIS2_OM_INVALID;
-    axis2_om_node_t *temp_node = NULL;
-    axis2_om_element_t *
-
-    node_type = AXIS2_OM_NODE_GET_NODE_TYPE(context_el_node, env);
-    switch(node_type)
-    {
-        case AXIS2_OM_ATTRIBUTE:
-        {
-            temp_node = context_el_node;
-        }
-        case AXIS2_OM_ELEMENT:
-        {
-            temp_node = AXIS2_OM_NODE_GET_PARENT(context_el_node, env);
-        }
-        default:
-        {
-        }
-    }
-}
-

Added: webservices/axis2/trunk/c/woden/src/util/woden_om_util.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/woden/src/util/woden_om_util.h?rev=412387&view=auto
==============================================================================
--- webservices/axis2/trunk/c/woden/src/util/woden_om_util.h (added)
+++ webservices/axis2/trunk/c/woden/src/util/woden_om_util.h Wed Jun  7 05:22:45 2006
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+#ifndef AXIS2_WODEN_OM_UTIL_H
+#define AXIS2_WODEN_OM_UTIL_H
+
+/**
+ * @file axis2_woden_om_util.h
+ * @brief Axis2 Woden OM Util Interface
+ *          This is an abstract superclass for all classes representing different
+ *          types of XML attribute information items.
+ */
+
+#include <axis2_allocator.h>
+#include <axis2_env.h>
+#include <axis2_error.h>
+#include <axis2_string.h>
+#include <axis2_utils.h>
+#include <axis2_hash.h>
+#include <axis2_qname.h>
+#include <woden/axis2_woden.h>
+#include <axis2_om_node.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @defgroup axis2_woden_om_util Woden OM Util
+  * @ingroup axis2_wsdl
+  * @{
+  */
+
+AXIS2_EXTERN axis2_qname_t * AXIS2_CALL
+woden_om_util_get_qname(
+        const axis2_env_t *env,
+        axis2_om_node_t *context_el_node,
+        axis2_char_t *prefixed_value,
+        void *desc);
+ 
+AXIS2_EXTERN axis2_status_t  AXIS2_CALL
+woden_om_util_register_unique_prefix(
+        const axis2_env_t *env,
+        axis2_char_t *prefix,
+        axis2_char_t *namespc_uri_str,
+        void *desc);
+ 
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif
+#endif /* AXIS2_WODEN_OM_UTIL_H */
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message