You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ka...@apache.org on 2007/12/04 10:45:31 UTC

svn commit: r600854 - in /webservices/axis2/trunk/c/axiom: include/axiom_node.h src/om/om_node.c src/om/om_output.c src/om/om_text.c

Author: kaushalye
Date: Tue Dec  4 01:45:31 2007
New Revision: 600854

URL: http://svn.apache.org/viewvc?rev=600854&view=rev
Log:
Fixing JIRA : https://issues.apache.org/jira/browse/AXIS2C-802


Modified:
    webservices/axis2/trunk/c/axiom/include/axiom_node.h
    webservices/axis2/trunk/c/axiom/src/om/om_node.c
    webservices/axis2/trunk/c/axiom/src/om/om_output.c
    webservices/axis2/trunk/c/axiom/src/om/om_text.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?rev=600854&r1=600853&r2=600854&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/include/axiom_node.h (original)
+++ webservices/axis2/trunk/c/axiom/include/axiom_node.h Tue Dec  4 01:45:31 2007
@@ -315,6 +315,14 @@
         axiom_node_t * om_node,
         const axutil_env_t * env);
 
+    /**
+     * Convert the node to string, treating the binary contents, if any, 
+     * as non-optimized content.
+     */
+    AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+    axiom_node_to_string_non_optimized(
+        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?rev=600854&r1=600853&r2=600854&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_node.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_node.c Tue Dec  4 01:45:31 2007
@@ -1168,3 +1168,42 @@
     axiom_output_free(om_output, env);
     return xml;
 }
+
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+axiom_node_to_string_non_optimized(
+    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;
+    }
+    /*This is where we set the output to be non-optimized*/
+    axiom_output_set_do_optimize(om_output, env, AXIS2_FALSE);
+    status = axiom_node_serialize(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;
+}

Modified: webservices/axis2/trunk/c/axiom/src/om/om_output.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_output.c?rev=600854&r1=600853&r2=600854&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_output.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_output.c Tue Dec  4 01:45:31 2007
@@ -87,7 +87,7 @@
 
     om_output->xml_writer = NULL;
     om_output->xml_writer = xml_writer;
-    om_output->do_optimize = AXIS2_FALSE;
+    om_output->do_optimize = AXIS2_TRUE;
     om_output->mime_boundary = NULL;
     om_output->root_content_id = NULL;
     om_output->next_content_id = NULL;

Modified: webservices/axis2/trunk/c/axiom/src/om/om_text.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_text.c?rev=600854&r1=600853&r2=600854&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_text.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_text.c Tue Dec  4 01:45:31 2007
@@ -196,7 +196,7 @@
     else
     {
         om_output_xml_writer = axiom_output_get_xml_writer(om_output, env);
-        if (om_text->optimize)
+        if (axiom_output_is_optimized(om_output, env) && om_text->optimize)
         {
             if (!(axiom_text_get_content_id(om_text, env)))
             {



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