summaryrefslogtreecommitdiffstats
path: root/axiom/src/om
diff options
context:
space:
mode:
Diffstat (limited to 'axiom/src/om')
-rw-r--r--axiom/src/om/axiom_stax_builder_internal.h14
-rw-r--r--axiom/src/om/om_stax_builder.c35
2 files changed, 47 insertions, 2 deletions
diff --git a/axiom/src/om/axiom_stax_builder_internal.h b/axiom/src/om/axiom_stax_builder_internal.h
index 12fcb53..4294778 100644
--- a/axiom/src/om/axiom_stax_builder_internal.h
+++ b/axiom/src/om/axiom_stax_builder_internal.h
@@ -24,9 +24,8 @@
* @{
*/
-/** @} */
-
#include <axiom_stax_builder.h>
+#include <axiom_soap_builder.h>
#ifdef __cplusplus
extern "C"
@@ -97,6 +96,17 @@ extern "C"
struct axiom_stax_builder *builder,
const axutil_env_t * env);
+ void AXIS2_CALL
+ axiom_stax_builder_set_soap_builder(
+ axiom_stax_builder_t *om_builder,
+ const axutil_env_t *env,
+ axiom_soap_builder_t *soap_builder);
+
+ axiom_node_t *AXIS2_CALL
+ axiom_stax_builder_get_root_node(
+ axiom_stax_builder_t *om_builder,
+ const axutil_env_t * env);
+
#if 0
diff --git a/axiom/src/om/om_stax_builder.c b/axiom/src/om/om_stax_builder.c
index c43fd61..aca1878 100644
--- a/axiom/src/om/om_stax_builder.c
+++ b/axiom/src/om/om_stax_builder.c
@@ -25,6 +25,7 @@
#include <axiom_doctype.h>
#include "axiom_node_internal.h"
#include "axiom_stax_builder_internal.h"
+#include <axiom_soap_builder_internal.h>
#include "axiom_document_internal.h"
struct axiom_stax_builder
@@ -50,6 +51,9 @@ struct axiom_stax_builder
/** Indicate the current element level. */
int element_level;
+ /** reference to the soap builder, to build soap releated elements */
+ axiom_soap_builder_t *soap_builder;
+
axutil_hash_t *declared_namespaces;
};
@@ -104,6 +108,7 @@ axiom_stax_builder_create(
om_builder->current_event = -1;
om_builder->root_node = NULL;
om_builder->element_level = 0;
+ om_builder->soap_builder = NULL;
return om_builder;
}
@@ -742,6 +747,20 @@ axiom_stax_builder_next_with_token(
default:
break;
}
+
+ /* if stax builder is also a soap builder, build soap related elements */
+ if(om_builder->soap_builder &&
+ (token == AXIOM_XML_READER_START_ELEMENT || token == AXIOM_XML_READER_EMPTY_ELEMENT))
+ {
+ AXIS2_ASSERT(om_builder->lastnode != NULL);
+ if(axiom_soap_builder_construct_node(om_builder->soap_builder, env, om_builder->lastnode)
+ != AXIS2_SUCCESS)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error occurred when building soap node");
+ om_builder->done = AXIS2_TRUE;
+ return -1;
+ }
+ }
return token;
}
@@ -813,6 +832,22 @@ axiom_stax_builder_set_element_level(
om_builder->element_level = element_level;
}
+void AXIS2_CALL
+axiom_stax_builder_set_soap_builder(
+ axiom_stax_builder_t *om_builder,
+ const axutil_env_t *env,
+ axiom_soap_builder_t *soap_builder)
+{
+ om_builder->soap_builder = soap_builder;
+}
+
+axiom_node_t *AXIS2_CALL
+axiom_stax_builder_get_root_node(
+ axiom_stax_builder_t *om_builder,
+ const axutil_env_t * env)
+{
+ return om_builder->root_node;
+}
#if 0
static axiom_node_t *
axiom_stax_builder_create_om_doctype(