Author: shankar
Date: Tue Apr 6 10:43:11 2010
New Revision: 931079
URL: http://svn.apache.org/viewvc?rev=931079&view=rev
Log:
Adding axiom_document_build_next method
Modified:
axis/axis2/c/core/trunk/axiom/include/axiom_document.h
axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h
axis/axis2/c/core/trunk/axiom/src/om/om_document.c
Modified: axis/axis2/c/core/trunk/axiom/include/axiom_document.h
URL:
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/include/axiom_document.h?rev=931079&r1=931078&r2=931079&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/include/axiom_document.h (original)
+++ axis/axis2/c/core/trunk/axiom/include/axiom_document.h Tue Apr 6 10:43:11
2010
@@ -70,6 +70,16 @@ extern "C"
axiom_document_t *document,
const axutil_env_t * env);
+ /** Builds the next node if the builder is not finished with input xml
stream
+ * @param document document whose next node is to be built. cannot be NULL
+ * @param env Environment. MUST NOT be NULL.
+ * @return pointer to the next node. NULL on error.
+ */
+ AXIS2_EXTERN axiom_node_t *AXIS2_CALL
+ axiom_document_build_next(
+ struct axiom_document *document,
+ const axutil_env_t * env);
+
/** @} */
#ifdef __cplusplus
Modified: axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h
URL:
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h?rev=931079&r1=931078&r2=931079&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h (original)
+++ axis/axis2/c/core/trunk/axiom/src/om/axiom_document_internal.h Tue Apr 6
10:43:11 2010
@@ -60,16 +60,6 @@ extern "C"
struct axiom_document *document,
const axutil_env_t * env);
- /** Builds the next node if the builder is not finished with input xml
stream
- * @param document document whose next node is to be built. cannot be NULL
- * @param env Environment. MUST NOT be NULL.
- * @return pointer to the next node. NULL on error.
- */
- axiom_node_t *AXIS2_CALL
- axiom_document_build_next(
- struct axiom_document *document,
- const axutil_env_t * env);
-
/**
* set the root element of the document. IF a root node is already
exist,it is freed
* before setting to root element
@@ -119,6 +109,8 @@ extern "C"
struct axiom_document *document,
const axutil_env_t * env,
axiom_output_t * om_output);
+
+
#endif
#ifdef __cplusplus
Modified: axis/axis2/c/core/trunk/axiom/src/om/om_document.c
URL:
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/axiom/src/om/om_document.c?rev=931079&r1=931078&r2=931079&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/axiom/src/om/om_document.c (original)
+++ axis/axis2/c/core/trunk/axiom/src/om/om_document.c Tue Apr 6 10:43:11 2010
@@ -130,6 +130,33 @@ axiom_document_build_all(
return document->root_element;
}
+AXIS2_EXTERN axiom_node_t *AXIS2_CALL
+axiom_document_build_next(
+ axiom_document_t * document,
+ const axutil_env_t * env)
+{
+ axiom_node_t *return_node = NULL;
+ axiom_node_t *last_node =
axiom_stax_builder_get_lastnode(document->builder, env);
+ while(document->root_element &&
!axiom_node_is_complete(document->root_element, env))
+ {
+ int token = axiom_stax_builder_next_with_token(document->builder, env);
+ if(token == -1)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed to create next
node");
+ return_node = NULL;
+ break;
+ }
+ return_node = axiom_stax_builder_get_lastnode(document->builder, env);
+ if(last_node != return_node)
+ {
+ /* this is a new node created */
+ break;
+ }
+ }
+
+ return return_node;
+}
+
#if 0
AXIS2_EXTERN axiom_stax_builder_t *AXIS2_CALL
axiom_document_get_builder(