axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r293524 - in /webservices/axis2/trunk/c/modules/xml: guththila/src/guththila_xml_stream_writer.c om/src/axis2_om_element.c om/src/axis2_om_output.c
Date Tue, 04 Oct 2005 04:41:56 GMT
Author: samisa
Date: Mon Oct  3 21:41:43 2005
New Revision: 293524

URL: http://svn.apache.org/viewcvs?rev=293524&view=rev
Log:
More additions towards serialization

Modified:
    webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c?rev=293524&r1=293523&r2=293524&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_stream_writer.c Mon
Oct  3 21:41:43 2005
@@ -250,11 +250,7 @@
         char** element_data = (char**) apr_array_pop(stream_writer->element_stack);
         if (!element_data )
             return GUTHTHILA_STREAM_WRITER_ERROR_ELEMENT_STACK_EMPTY;
-        if(element_data[0])
-            free( element_data[0]);
-        if(element_data[1])
-            free( element_data[1]);
-        element_data = 0;
+
             //end pop element stack
 
         fputs("</", stream_writer->writer);
@@ -263,9 +259,21 @@
         {
             fputs(element_data[0], stream_writer->writer);
             fputs(":", stream_writer->writer);
+            free( element_data[0]);
         }
-        fputs(element_data[1], stream_writer->writer);
+
+        if(element_data[1] && strlen(element_data[1]) > 0)
+        {
+            fputs(element_data[1], stream_writer->writer);
+            free( element_data[1]);
+        }
+        else
+            return GUTHTHILA_STREAM_WRITER_ERROR_ELEMENT_STACK_EMPTY;
+        
         fputs(">", stream_writer->writer);
+        
+        element_data = 0;
+
         return GUTHTHILA_SUCCESS;
     }
 

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c?rev=293524&r1=293523&r2=293524&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c Mon Oct  3 21:41:43 2005
@@ -454,11 +454,12 @@
 axis2_om_element_serialize_start_part (axis2_om_element_t * element_node,
                                        axis2_om_output_t * om_output)
 {
-    if (element_node->ns && element_node->ns->prefix)
+    // TODO : handle null pointer errors
+    if (element_node->ns && element_node->ns->uri && element_node->ns->prefix)
         axis2_om_output_write (om_output, AXIS2_OM_ELEMENT, 3,
                                element_node->localname, element_node->ns->uri,
                                element_node->ns->prefix);
-    else if (element_node->ns)
+    else if (element_node->ns && element_node->ns->uri)
         axis2_om_output_write (om_output, AXIS2_OM_ELEMENT, 2,
                                element_node->localname,
                                element_node->ns->uri);
@@ -473,5 +474,6 @@
 axis2_om_element_serialize_end_part (axis2_om_element_t * element_node,
                                      axis2_om_output_t * om_output)
 {
-
+    // TODO : handle null pointer errors
+    axis2_om_output_write (om_output, AXIS2_OM_ELEMENT, 0);
 }

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c?rev=293524&r1=293523&r2=293524&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_output.c Mon Oct  3 21:41:43 2005
@@ -59,11 +59,14 @@
             va_end(ap);
             switch (no_of_args)
             {
+                case 0:
+                    guththila_xml_stream_writer_write_end_element( om_output->xml_writer);
                 case 1:
                     guththila_xml_stream_writer_write_start_element( om_output->xml_writer,
args_list[0] );
                     break;
                 case 2:
                     guththila_xml_stream_writer_write_start_element_with_namespace( om_output->xml_writer,
args_list[0], args_list[1] );
+                    break;
                 case 3:
                     guththila_xml_stream_writer_write_start_element_with_namespace_prefix(
om_output->xml_writer, args_list[0], args_list[1], args_list[2] );
                     break;



Mime
View raw message