You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2005/10/04 10:00:52 UTC

svn commit: r293563 - in /webservices/axis2/trunk/c: include/axis2_om_node.h modules/xml/om/src/axis2_om_node.c

Author: samisa
Date: Tue Oct  4 01:00:42 2005
New Revision: 293563

URL: http://svn.apache.org/viewcvs?rev=293563&view=rev
Log:
applied the patch for axis2_om_node.h 

Modified:
    webservices/axis2/trunk/c/include/axis2_om_node.h
    webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c

Modified: webservices/axis2/trunk/c/include/axis2_om_node.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_node.h?rev=293563&r1=293562&r2=293563&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_node.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_node.h Tue Oct  4 01:00:42 2005
@@ -61,6 +61,7 @@
 	struct axis2_om_node_t *prev_sibling;
 	struct axis2_om_node_t *next_sibling;
 	struct axis2_om_node_t *first_child;
+	struct axis2_om_node_t *current_child;
 	struct axis2_om_node_t *last_child;
 	axis2_stax_om_builder_t *builder;
 	axis2_om_types_t element_type;
@@ -118,6 +119,12 @@
  */
 
 void axis2_om_node_set_parent(axis2_om_node_t *node,axis2_om_node_t *parent);
+
+
+
+axis2_om_node_t *axis2_om_node_get_first_child(axis2_om_node_t *parent_node);
+
+axis2_om_node_t *axis2_om_node_get_next_child(axis2_om_node_t *parent_node);
 
 
 #endif // AXIS2_NODE_H

Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c?rev=293563&r1=293562&r2=293563&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c Tue Oct  4 01:00:42 2005
@@ -34,6 +34,7 @@
     node->done = FALSE;
     node->builder = NULL;
     node->data_element = NULL;
+	node->current_child = NULL;
     return node;
 }
 
@@ -174,4 +175,41 @@
 	
 	}
 	node->prev_sibling = node_to_insert;
+}
+
+axis2_om_node_t *axis2_om_node_get_first_child(axis2_om_node_t *parent_node)
+{
+	/**  */
+	if(!parent_node)
+	{
+		return NULL;
+	}
+	if(parent_node->first_child)
+	{
+		parent_node->current_child = parent_node->first_child;
+		return parent_node->first_child;		
+	}
+	return NULL;
+}
+axis2_om_node_t *axis2_om_node_get_next_child(axis2_om_node_t *parent_node)
+{
+	axis2_om_node_t *node=NULL;
+	if(parent_node && !(parent_node->first_child))
+	{
+		fprintf(stderr,"Error ");
+		return NULL;	
+	}
+	
+	if(parent_node && parent_node->first_child  && !(parent_node->current_child))	
+	{
+		fprintf(stderr,"Error first call get_first_child");
+		return NULL;		
+	}
+	if(parent_node->current_child->next_sibling)
+	{
+		node= parent_node->current_child->next_sibling;
+		parent_node->current_child = node;
+		return node;		
+	}
+	return NULL;
 }