axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r326859 - in /webservices/axis2/trunk/c/modules/xml: guththila/src/guththila_xml_pull_parser.c guththila/src/guththila_xml_pull_parser.h om/src/axis2_om_stax_builder.c
Date Thu, 20 Oct 2005 08:19:22 GMT
Author: samisa
Date: Thu Oct 20 01:19:10 2005
New Revision: 326859

URL: http://svn.apache.org/viewcvs?rev=326859&view=rev
Log:
added space event

Modified:
    webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c
    webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.h
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c?rev=326859&r1=326858&r2=326859&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.c Thu Oct
20 01:19:10 2005
@@ -19,6 +19,13 @@
 
 #include "guththila_xml_pull_parser.h"
 
+static int
+guththila_is_space (int c)
+{
+  return (0x20 == c || 0x9 == c || 0xD == c || 0xA == c);
+}
+
+
 guththila_xml_pull_parser_t *
 guththila_xml_pull_parser_create (guththila_reader_t * r)
 {
@@ -519,12 +526,17 @@
 {
   int c;
   int ref = 0;
+  int all_spaces = 1;
+  int last_event = guththila_event;
   guththila_event = GUTHTHILA_CHARACTER;
   guththila_xml_pull_parser_open_token (parser);
   do
     {
       c = guththila_xml_pull_parser_next_char(parser, -1);
 
+	  if (c != '<')
+		  all_spaces = (all_spaces && guththila_is_space(c));
+		
       if (c == '&')
 	ref = 1;
 
@@ -535,6 +547,9 @@
 	}
     }
   while (c != '<');
+
+  if (all_spaces)
+	  guththila_event = GUTHTHILA_SPACE;
   guththila_xml_pull_parser_close_token (parser, _char_data, ref);
   return c;
 }

Modified: webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.h?rev=326859&r1=326858&r2=326859&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.h (original)
+++ webservices/axis2/trunk/c/modules/xml/guththila/src/guththila_xml_pull_parser.h Thu Oct
20 01:19:10 2005
@@ -55,6 +55,7 @@
   GUTHTHILA_START_DOCUMENT = 0,
   GUTHTHILA_START_ELEMENT,
   GUTHTHILA_END_ELEMENT,
+  GUTHTHILA_SPACE,
   GUTHTHILA_EMPTY_ELEMENT,
   GUTHTHILA_CHARACTER,
   GUTHTHILA_ENTITY_REFERANCE,

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c?rev=326859&r1=326858&r2=326859&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_stax_builder.c Thu Oct 20 01:19:10
2005
@@ -473,6 +473,9 @@
 		case GUTHTHILA_END_ELEMENT:
 			  axis2_om_stax_builder_end_element(environment, builder);
 			break;
+		case GUTHTHILA_SPACE:
+			/* Do nothing*/
+			break;
 		case GUTHTHILA_CHARACTER:
 			node = axis2_om_stax_builder_create_om_text(environment, builder);
 			break;



Mime
View raw message