axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nand...@apache.org
Subject svn commit: r558935 - in /webservices/axis2/trunk/c/axiom: include/axiom_node.h src/om/om_node.c
Date Tue, 24 Jul 2007 05:28:18 GMT
Author: nandika
Date: Mon Jul 23 22:28:18 2007
New Revision: 558935

URL: http://svn.apache.org/viewvc?view=rev&rev=558935
Log:
convenient function added to axiom node

Modified:
    webservices/axis2/trunk/c/axiom/include/axiom_node.h
    webservices/axis2/trunk/c/axiom/src/om/om_node.c

Modified: webservices/axis2/trunk/c/axiom/include/axiom_node.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/include/axiom_node.h?view=diff&rev=558935&r1=558934&r2=558935
==============================================================================
--- webservices/axis2/trunk/c/axiom/include/axiom_node.h (original)
+++ webservices/axis2/trunk/c/axiom/include/axiom_node.h Mon Jul 23 22:28:18 2007
@@ -273,6 +273,10 @@
         const axutil_env_t *env,
         struct axiom_output *om_output);
 
+    AXIS2_EXTERN axis2_char_t* AXIS2_CALL
+    axiom_node_sub_tree_to_string(axiom_node_t *om_node,
+                         const axutil_env_t *env);
+
     /** @} */
 
 #ifdef __cplusplus

Modified: webservices/axis2/trunk/c/axiom/src/om/om_node.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_node.c?view=diff&rev=558935&r1=558934&r2=558935
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_node.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_node.c Mon Jul 23 22:28:18 2007
@@ -1015,3 +1015,36 @@
     return xml;
 }
 
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axiom_node_sub_tree_to_string(axiom_node_t *om_node,
+    const axutil_env_t *env)
+{
+    int status = AXIS2_SUCCESS;
+    axiom_output_t *om_output = NULL;
+    axiom_xml_writer_t *xml_writer = NULL;
+    axis2_char_t *xml = NULL;
+    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK(env->error, om_node, NULL);
+
+    xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+        AXIS2_XML_PARSER_TYPE_BUFFER);
+    if (!xml_writer)
+    {
+        return NULL;
+    }
+
+    om_output = axiom_output_create(env, xml_writer);
+    if (!om_output)
+    {
+        axiom_xml_writer_free(xml_writer, env);
+        return NULL;
+    }
+    status = axiom_node_serialize_sub_tree(om_node, env, om_output);
+    if (status == AXIS2_SUCCESS)
+    {
+        xml = axutil_strdup(env, (axis2_char_t*)axiom_xml_writer_get_xml(xml_writer, env));
+    }
+    axiom_output_free(om_output, env);
+    return xml;
+}



---------------------------------------------------------------------
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