You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2005/10/04 07:19:18 UTC
svn commit: r293528 - in /webservices/axis2/trunk/c: include/
modules/test/om/src/ modules/xml/om/ modules/xml/om/src/ modules/xml/om/test/
Author: samisa
Date: Mon Oct 3 22:18:50 2005
New Revision: 293528
URL: http://svn.apache.org/viewcvs?rev=293528&view=rev
Log:
axis2_node.h was changed to axis2_om_node.h
Modified:
webservices/axis2/trunk/c/include/axis2_om_comment.h
webservices/axis2/trunk/c/include/axis2_om_doctype.h
webservices/axis2/trunk/c/include/axis2_om_document.h
webservices/axis2/trunk/c/include/axis2_om_element.h
webservices/axis2/trunk/c/include/axis2_om_node.h
webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h
webservices/axis2/trunk/c/include/axis2_om_text.h
webservices/axis2/trunk/c/include/axis2_stax_ombuilder.h
webservices/axis2/trunk/c/modules/test/om/src/test_om.c
webservices/axis2/trunk/c/modules/xml/om/project.properties
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_doctype.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_element.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_node.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_processing_instruction.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_text.c
webservices/axis2/trunk/c/modules/xml/om/src/axis2_stax_ombuilder.c
webservices/axis2/trunk/c/modules/xml/om/test/om_test.c
Modified: webservices/axis2/trunk/c/include/axis2_om_comment.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_comment.h?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_comment.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_comment.h Mon Oct 3 22:18:50 2005
@@ -31,12 +31,15 @@
/**
* Create a comment struct and stores in in a node struct and returns a pointer
- * to the axis2_node_t struct
+ * to the axis2_om_comment_t struct
* the data_element field of node struct points to the acctual axis2_comment struct
* The element type of axis2_node_t struct will be of type AXIS2_OM_COMMENT
+ * @param value value of the comment
+ * @param comment_node This is an out parameter, stores the acctual om_comment in
+ * this node struct pointer
* @return pointer to a node_t struct containing the comment struct
*/
-axis2_node_t *axis2_om_comment_create(const char *value);
+axis2_om_comment_t *axis2_om_comment_create(const char *value,axis2_om_node_t *comment_node);
/**
* free a axis2_comment struct
@@ -51,7 +54,7 @@
* @param comment_node pointer to comment node
*/
-char *axis2_om_comment_get_value(axis2_node_t *comment_node);
+char *axis2_om_comment_get_value(axis2_om_node_t *comment_node);
/**
* to set the value of a existing comment node
@@ -59,7 +62,7 @@
*/
-void axis2_om_comment_set_value(axis2_node_t *comment_node,const char *value);
+void axis2_om_comment_set_value(axis2_om_node_t *comment_node,const char *value);
#endif // AXIS2_OM_COMMENT_H
Modified: webservices/axis2/trunk/c/include/axis2_om_doctype.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_doctype.h?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_doctype.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_doctype.h Mon Oct 3 22:18:50 2005
@@ -31,40 +31,45 @@
/**
* Create a doctype struct and stores in in a node struct and returns a pointer
- * to the axis2_node_t struct
+ * to the axis2_axis2_om_doctype_t struct
* the data_element field of node struct points to the acctual axis2_doctype_t struct
* The element type of axis2_node_t struct will be of type AXIS2_OM_DOCTYPE
- * @return pointer to a axis2_node_t struct containing the doctype struct
+ * param doctype The out paremeter that must be passed
+ * return pointer to a axis2_node_t struct containing the doctype struct
*/
-axis2_node_t *axis2_om_doctype_create(axis2_node_t *parent,const char *value);
+
+
+axis2_om_doctype_t *axis2_om_doctype_create(axis2_om_node_t *parent,const char *value,axis2_om_node_t *doctype_node);
+
/**
* create an axis2_om_doctype_t struct with parent
* value field will be set to null
- * @return poniter to a axis2_node_t
+ * return poniter to a axis2_node_t
*/
-axis2_node_t *axis2_om_doctype_create_empty_doctype(axis2_node_t *parent);
+axis2_om_doctype_t *axis2_om_doctype_create_empty_doctype(axis2_om_node_t *parent,axis2_om_node_t *doctype_node);
/**
* free the axis2_om_doctype_t struct
- * @param om_doc pointer to axis2_om_doctype_t struct
+ * param om_doc pointer to axis2_om_doctype_t struct
*/
void axis2_om_doctype_free(axis2_om_doctype_t *om_doc);
/**
* accessor function to get value of doctype
- * @param om_doc pointer to axis2_om_doctype_t struct
+ * param om_doc pointer to axis2_om_doctype_t struct
*/
-char *om_doctype_get_value(axis2_node_t *doctype_node);
+char *om_doctype_get_value(axis2_om_node_t *doctype_node);
/**
* mutator function to get value of doctype
- * @param om_doc pointer to axis2_om_doctype_t struct
- * @param value value to be set in om_doctype
+ * param om_doc pointer to axis2_om_doctype_t struct
+ * param value value to be set in om_doctype
*/
-void om_doctype_set_value(axis2_node_t *doctype_node,const char *value);
+
+void om_doctype_set_value(axis2_om_node_t *doctype_node,const char *value);
#endif // AXIS2_OM_DOCTYPE_H
Modified: webservices/axis2/trunk/c/include/axis2_om_document.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_document.h?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_document.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_document.h Mon Oct 3 22:18:50 2005
@@ -34,9 +34,9 @@
typedef struct axis2_om_document_t
{
- axis2_node_t *root_element;
- axis2_node_t *first_child;
- axis2_node_t *last_child;
+ axis2_om_node_t *root_element;
+ axis2_om_node_t *first_child;
+ axis2_om_node_t *last_child;
int done;
axis2_stax_om_builder_t *builder;
char *char_set_encoding;
@@ -52,7 +52,7 @@
* @param builder pointer to xml builder
*/
-axis2_om_document_t *axis2_om_document_create(axis2_node_t *root_ele,axis2_stax_om_builder_t *builder);
+axis2_om_document_t *axis2_om_document_create(axis2_om_node_t *root_ele,axis2_stax_om_builder_t *builder);
/**
* Free axis2_om_document_t struct
@@ -73,7 +73,7 @@
/**
* adds the child node as a child to the back of the list
*/
-void axis2_om_document_add_child(axis2_om_document_t *document,axis2_node_t *child);
+void axis2_om_document_add_child(axis2_om_document_t *document,axis2_om_node_t *child);
/**
* This cause the parser to proceed
@@ -82,7 +82,7 @@
*/
-axis2_node_t *axis2_om_document_get_first_child(axis2_om_document_t *document);
+axis2_om_node_t *axis2_om_document_get_first_child(axis2_om_document_t *document);
/**
* set the CHAR SET ENCODING of this document
Modified: webservices/axis2/trunk/c/include/axis2_om_element.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_element.h?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_element.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_element.h Mon Oct 3 22:18:50 2005
@@ -40,23 +40,25 @@
*@param localname can't be null
*@param ns namespace can be null
*@param parent can be null
-*@return Returns axis2_node_t pointer If there isn't enough memory null is returned
+*@return Returns axis2_om_element_t pointer If there isn't enough memory null is returned
*/
-axis2_node_t *axis2_om_element_create(const char *localname,axis2_om_namespace_t *ns
- ,axis2_node_t *parent);
+axis2_om_element_t *axis2_om_element_create(axis2_om_node_t *parent,
+ const char *localname,axis2_om_namespace_t *ns,
+ axis2_om_node_t *node);
/**
* create an om element using a qname
* @param qname
* @param parent
- * @return axis2_node_t pointer or NULL if there isn't enough memory
+ * @return axis2_om_element_t pointer or NULL if there isn't enough memory
*/
-axis2_node_t *axis2_om_element_create_with_qname(axis2_qname_t *qname,axis2_node_t *parent);
+axis2_om_element_t *axis2_om_element_create_with_qname(axis2_om_node_t *parent,axis2_qname_t *qname
+ ,axis2_om_node_t *node);
-axis2_node_t *axis2_om_element_create_with_builder(const char *localname
- ,axis2_om_namespace_t *ns,axis2_node_t *parent,axis2_stax_om_builder_t *builder);
+axis2_om_element_t *axis2_om_element_create_with_builder(axis2_om_node_t *parent,
+ const char *localname,axis2_om_namespace_t *ns,axis2_stax_om_builder_t *builder,axis2_om_node_t *node);
/*
@@ -65,43 +67,43 @@
*/
axis2_om_namespace_t *axis2_om_element_find_namespace(
- axis2_node_t *element_node, const char *uri,const char *prefix);
+ axis2_om_node_t *element_node, const char *uri,const char *prefix);
/*
declare a namespace in current element (in the scope of this element )
*/
-axis2_om_namespace_t *axis2_om_element_declare_namespace(axis2_node_t *element_node,axis2_om_namespace_t *ns);
+axis2_om_namespace_t *axis2_om_element_declare_namespace(axis2_om_node_t *element_node,axis2_om_namespace_t *ns);
/**
* find namespaces in the scope of current element
*/
-axis2_om_namespace_t *axis2_om_element_find_declared_namespace(axis2_node_t *element_node,const char *uri,const char *prefix);
+axis2_om_namespace_t *axis2_om_element_find_declared_namespace(axis2_om_node_t *element_node,const char *uri,const char *prefix);
/**
* add an attribute to current element
*/
-axis2_om_attribute_t *axis2_om_element_add_attribute(axis2_node_t *element_node,axis2_om_attribute_t *attribute);
+axis2_om_attribute_t *axis2_om_element_add_attribute(axis2_om_node_t *element_node,axis2_om_attribute_t *attribute);
/**
* return the requested attribute
*/
-axis2_om_attribute_t *axis2_om_element_get_attribute(axis2_node_t *element_node,axis2_qname_t *qname);
+axis2_om_attribute_t *axis2_om_element_get_attribute(axis2_om_node_t *element_node,axis2_qname_t *qname);
/**
* add an attribute
*/
axis2_om_attribute_t *axis2_om_element_add_attribute_with_namespace(
- axis2_node_t* element_node,const char *attribute_name,const char *value,axis2_om_namespace_t *ns);
+ axis2_om_node_t* element_node,const char *attribute_name,const char *value,axis2_om_namespace_t *ns);
/**
*
*/
-static axis2_om_namespace_t *axis2_om_element_handle_namespace_with_qname(axis2_node_t *element_node,axis2_qname_t *qname);
+static axis2_om_namespace_t *axis2_om_element_handle_namespace_with_qname(axis2_om_node_t *element_node,axis2_qname_t *qname);
/*
void om_element_remove_attribute(om_element_t *element,om_attribute_t *attribute);
*/
@@ -110,12 +112,12 @@
* set the namespace of this element
*/
-void axis2_om_element_set_namespace(axis2_node_t *element_node,axis2_om_namespace_t *ns);
+void axis2_om_element_set_namespace(axis2_om_node_t *element_node,axis2_om_namespace_t *ns);
/**
* declare a namespace in the scope of this element
*/
-axis2_om_namespace_t *axis2_om_element_declare_namespace_with_ns_uri_prefix(axis2_node_t *element_node,const char* uri,const char *prefix);
+axis2_om_namespace_t *axis2_om_element_declare_namespace_with_ns_uri_prefix(axis2_om_node_t *element_node,const char* uri,const char *prefix);
/**
* Free Om element
*
@@ -127,12 +129,12 @@
* set localname
*/
-void axis2_om_element_set_localname(axis2_node_t *element_node,const char *localname);
+void axis2_om_element_set_localname(axis2_om_node_t *element_node,const char *localname);
/**
* get Localname
*/
-char *axis2_om_element_get_localname(axis2_node_t *element_node);
+char *axis2_om_element_get_localname(axis2_om_node_t *element_node);
int axis2_om_element_serialize_start_part(axis2_om_element_t *element_node, axis2_om_output_t* om_output);
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=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_node.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_node.h Mon Oct 3 22:18:50 2005
@@ -56,30 +56,30 @@
* first child and last child for constructing and navigating the tree
*
*/
-typedef struct axis2_node_t {
- struct axis2_node_t *parent;
- struct axis2_node_t *prev_sibling;
- struct axis2_node_t *next_sibling;
- struct axis2_node_t *first_child;
- struct axis2_node_t *last_child;
+typedef struct axis2_om_node_t {
+ struct axis2_om_node_t *parent;
+ 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 *last_child;
axis2_stax_om_builder_t *builder;
axis2_om_types_t element_type;
boolean_t done;
void* data_element;
-} axis2_node_t;
+} axis2_om_node_t;
/**
* Create a node struct.
* @return a node or NULL if there isn't enough memory
*/
-axis2_node_t *axis2_node_create();
+axis2_om_node_t *axis2_node_create();
/**
* destroy the node .
* @param node to free
*/
-void axis2_node_free(axis2_node_t *node);
+void axis2_node_free(axis2_om_node_t *node);
/**
* adds a child node to this node .
@@ -88,7 +88,7 @@
*/
-void axis2_node_add_child(axis2_node_t *parent,axis2_node_t *child);
+void axis2_node_add_child(axis2_om_node_t *parent,axis2_om_node_t *child);
/**
* detach a node from the tree and resets the links
@@ -96,7 +96,7 @@
*
*/
-axis2_node_t *axis2_node_detach(axis2_node_t *node_to_detach);
+axis2_om_node_t *axis2_node_detach(axis2_om_node_t *node_to_detach);
/**
* inserts a sibling node after the current node
@@ -104,12 +104,12 @@
* @param node_to_insert the node that will be inserted
*/
-void axis2_node_insert_sibling_after(axis2_node_t *current_nodee,axis2_node_t *node_to_insert);
+void axis2_node_insert_sibling_after(axis2_om_node_t *current_nodee,axis2_om_node_t *node_to_insert);
-void axis2_node_insert_sibling_before(axis2_node_t *current_ele,axis2_node_t *nodeto_insert);
+void axis2_node_insert_sibling_before(axis2_om_node_t *current_ele,axis2_om_node_t *nodeto_insert);
-//int axis2_node_build(axis2_node_t *node);
+//int axis2_node_build(axis2_om_node_t *node);
/**
* set a parent node to a given node
@@ -117,7 +117,7 @@
* @param parent the node that will be set as parent
*/
-void axis2_node_set_parent(axis2_node_t *node,axis2_node_t *parent);
+void axis2_node_set_parent(axis2_om_node_t *node,axis2_om_node_t *parent);
#endif // AXIS2_NODE_H
Modified: webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_processing_instruction.h Mon Oct 3 22:18:50 2005
@@ -34,14 +34,13 @@
* @return a pointer to axis2_node_t struct containing PI
*/
-axis2_node_t *axis2_om_processing_instruction_create(axis2_node_t *parent
- ,const char *target,const char *value);
+axis2_om_processing_instruction_t *axis2_om_processing_instruction_create(axis2_om_node_t *parent,const char *target,const char *value,axis2_om_node_t *node);
/**
* creates empty axis2_om_processing_instruction and
* @return a pointer to axis2_node_t struct containing PI
*/
-axis2_node_t *axis2_create_om_processing_instruction_create_empty(axis2_node_t *parent);
+axis2_om_processing_instruction_t *axis2_om_processing_instruction_create_empty(axis2_om_node_t *parent,axis2_om_node_t *node);
Modified: webservices/axis2/trunk/c/include/axis2_om_text.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_text.h?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_text.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_text.h Mon Oct 3 22:18:50 2005
@@ -41,14 +41,15 @@
/**
* Create a text struct and stores in in a node struct and returns a pointer
- * to the axis2_node_t struct
+ * to the axis2_om_text_t struct
* the data_element field of node struct points to the acctual axis2_text_t struct
* The element type of axis2_node_t struct will be of type AXIS2_OM_TEXT
* @param parent This can be null The parent element should be of type AXIS2_OM_ELEMENT
- * @return pointer to a axis2_node_t struct containing the text struct
+ * @return pointer to a axis2_om_text_t struct
*/
-axis2_node_t *axis2_om_text_create(axis2_node_t *parent,const char *value);
+axis2_om_text_t *axis2_om_text_create(axis2_om_node_t *parent,const char *value
+ ,axis2_om_node_t *node);
/**
Modified: webservices/axis2/trunk/c/include/axis2_stax_ombuilder.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_stax_ombuilder.h?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_stax_ombuilder.h (original)
+++ webservices/axis2/trunk/c/include/axis2_stax_ombuilder.h Mon Oct 3 22:18:50 2005
@@ -34,11 +34,11 @@
struct axis2_stax_om_builder_s
{
XML_PullParser *parser;
- axis2_node_t *lastnode;
+ axis2_om_node_t *lastnode;
axis2_om_document_t *document;
- boolean_t done;
- boolean_t parser_accessed;
- boolean_t cache;
+ int done;
+ int parser_accessed;
+ int cache;
};
/**
@@ -56,7 +56,7 @@
* isn't enough memory
*/
-axis2_node_t *axis2_stax_om_builder_create_om_element(
+axis2_om_node_t *axis2_stax_om_builder_create_om_element(
axis2_stax_om_builder_t *builder);
/**
@@ -66,21 +66,21 @@
*/
-axis2_node_t *axis2_stax_om_builder_create_om_comment(
+axis2_om_node_t *axis2_stax_om_builder_create_om_comment(
axis2_stax_om_builder_t *builder);
/**
* create an om doctype
*
*/
-axis2_node_t *axis2_stax_om_builder_create_om_doctype(
+axis2_om_node_t *axis2_stax_om_builder_create_om_doctype(
axis2_stax_om_builder_t *builder_t);
/**
* create om_processing_instruction
*/
-axis2_node_t *axis2_stax_om_builder_create_om_processing_instruction(
+axis2_om_node_t *axis2_stax_om_builder_create_om_processing_instruction(
axis2_stax_om_builder_t *builder);
/**
@@ -98,28 +98,37 @@
*
*/
-void axis2_stax_om_builder_process_attributes(axis2_stax_om_builder_t *builder,axis2_node_t *element_node);
+void axis2_stax_om_builder_process_attributes(axis2_stax_om_builder_t *builder,axis2_om_node_t *element_node);
/**
* create om text
*
*/
-axis2_node_t *axis2_stax_om_builder_create_om_text(axis2_stax_om_builder_t *builder);
+axis2_om_node_t *axis2_stax_om_builder_create_om_text(axis2_stax_om_builder_t *builder);
/**
* discard building an element
*/
-void axis2_stax_om_builder_discard(axis2_stax_om_builder_t *builder,axis2_node_t *element_node);
+void axis2_stax_om_builder_discard(axis2_stax_om_builder_t *builder,axis2_om_node_t *element_node);
/**
* process namespaces
*
*/
-axis2_node_t *axis2_stax_om_builder_process_namespace_data(axis2_stax_om_builder_t *builder,axis2_node_t *element,int is_soap_element);
+axis2_om_node_t *axis2_stax_om_builder_process_namespace_data(axis2_stax_om_builder_t *builder,axis2_om_node_t *element,int is_soap_element);
+char *axis2_stax_om_builder_get_attribute_name(axis2_stax_om_builder_t *builder,int i);
+
+char *axis2_stax_om_builder_get_attribute_prefix(axis2_stax_om_builder_t *builder,int i);
+
+
+char *axis2_stax_om_builder_get_attribute_namespace(axis2_stax_om_builder_t *builder,int i);
+
+
+int axis2_stax_om_builder_get_attribute_count(axis2_stax_om_builder_t *builder);
Modified: webservices/axis2/trunk/c/modules/test/om/src/test_om.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/test/om/src/test_om.c?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/test/om/src/test_om.c (original)
+++ webservices/axis2/trunk/c/modules/test/om/src/test_om.c Mon Oct 3 22:18:50 2005
@@ -9,25 +9,26 @@
printf("START\n");
if ( apr_initialize () != APR_SUCCESS )
return -1;
- axis2_node_t *ele1, *ele2, *ele3;
+ axis2_om_element_t *ele1, *ele2, *ele3;
+ axis2_om_node_t *node1, *node2, *node3;
axis2_om_attribute_t *attr1, *attr2;
axis2_om_namespace_t *ns1, *ns2;
ns1 = axis2_om_namespace_create ("ns", "test");
- ele1 = axis2_om_element_create ("root", ns1, NULL);
+ ele1 = axis2_om_element_create (NULL, "root", ns1, node1);
ns2 = axis2_om_namespace_create ("ns1", "test1");
- ele2 = axis2_om_element_create ("ele1", ns2, ele1);
+ ele2 = axis2_om_element_create (ele1, "ele1", ns2, node1);
attr1 = axis2_om_attribute_create ("ele1", "attr1", ns2);
axis2_om_element_add_attribute (ele2, attr1);
- ele3 = axis2_om_element_create ("ele2", ns2, NULL);
+ ele3 = axis2_om_element_create (NULL, "ele3", ns2, node3);
- axis2_node_add_child (ele1, ele2);
+ axis2_node_add_child (node1, node2);
printf("DONE\n");
}
Modified: webservices/axis2/trunk/c/modules/xml/om/project.properties
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/project.properties?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/project.properties (original)
+++ webservices/axis2/trunk/c/modules/xml/om/project.properties Mon Oct 3 22:18:50 2005
@@ -17,7 +17,7 @@
freehep.nar.src=src
freehep.nar.outtype=shared
freehep.nar.compile.includepath=${cutest.home}/include/ ${apr.home}/include/apr-1 ../../../include ../guththila/src
-freehep.nar.linker.arg.end=-L${basedir}/target/nar/lib/i386-Linux-g++ -laxis2-xml-om-nar-0.0 -L${basedir}/../../../modules/common/target/nar/lib/i386-Linux-g++ -laxis2-common-nar-0.0 -L${basedir}/../../../modules/xml/guththila/target/nar/lib/i386-Linux-g++ -laxis2-xml-guththila-nar-0.0
+freehep.nar.linker.arg.end=-L${basedir}/target/nar/lib/i386-Linux-g++ -laxis2-xml-om-nar-0.0 -L${basedir}/../../../modules/xml/guththila/target/nar/lib/i386-Linux-g++ -laxis2-xml-guththila-nar-0.0
#freehep.nar.linker.test.arg.end=-Ltarget/nar/lib/i386-Linux-g++ -laxis2-xml-om-nar-0.0 -L${basedir}/../../../modules/xml/guththila/target/nar/lib/i386-Linux-g++ -laxis2-xml-guththila-nar-0.0
freehep.nar.test.src=test
freehep.nar.tests=om_test
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_comment.c Mon Oct 3 22:18:50 2005
@@ -18,9 +18,9 @@
#include <string.h>
#include <axis2_errno.h>
-axis2_node_t *axis2_om_comment_create(const char *value)
+axis2_om_comment_t *axis2_om_comment_create(const char *value,axis2_om_node_t *cnode)
{
- axis2_node_t *node = NULL;
+ axis2_om_node_t *node = NULL;
axis2_om_comment_t *comment = NULL;
node = axis2_node_create();
@@ -44,7 +44,8 @@
node->data_element = comment;
node->element_type =AXIS2_OM_COMMENT;
- return node;
+ cnode = node;
+ return comment;
}
@@ -60,7 +61,7 @@
}
}
-char *axis2_om_comment_get_value(axis2_node_t * comment_node)
+char *axis2_om_comment_get_value(axis2_om_node_t * comment_node)
{
if (!comment_node || comment_node->element_type !=AXIS2_OM_COMMENT)
{
@@ -69,7 +70,7 @@
return ((axis2_om_comment_t *) (comment_node->data_element))->value;
}
-void axis2_om_comment_set_value(axis2_node_t * comment_node,
+void axis2_om_comment_set_value(axis2_om_node_t * comment_node,
const char *value)
{
axis2_om_comment_t *comment = NULL;
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_doctype.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_doctype.c?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_doctype.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_doctype.c Mon Oct 3 22:18:50 2005
@@ -1,4 +1,4 @@
-/*
+ /*
* Copyright 2004,2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,10 +18,11 @@
#include <stdlib.h>
#include <axis2_errno.h>
-axis2_node_t *axis2_create_om_doctype(axis2_node_t * parent,const char *value)
+
+axis2_om_doctype_t *axis2_om_doctype_create(axis2_om_node_t *parent , const char *value, axis2_om_node_t *doc_node)
{
axis2_om_doctype_t *doctype = NULL;
- axis2_node_t *node = axis2_node_create();
+ axis2_om_node_t *node = axis2_node_create();
if (!node)
{
return NULL;
@@ -44,12 +45,13 @@
node->parent = parent;
axis2_node_add_child(parent, node);
}
- return node;
+ doc_node = node;
+ return doctype;
}
-axis2_node_t *axis2_om_doctype_create_empty_doctype(axis2_node_t * parent)
+axis2_om_doctype_t *axis2_om_doctype_create_empty_doctype(axis2_om_node_t * parent,axis2_om_node_t *doc_node)
{
- axis2_node_t *node = NULL;
+ axis2_om_node_t *node = NULL;
axis2_om_doctype_t *doctype = NULL;
if (!node)
{
@@ -73,7 +75,8 @@
node->parent = parent;
axis2_node_add_child(parent, node);
}
- return node;
+ doc_node = node;
+ return doctype;
}
void axis2_free_om_doctype(axis2_om_doctype_t * om_doc)
@@ -88,7 +91,7 @@
}
}
-char *axis2_om_doctype_get_value(axis2_node_t * doctype_node)
+char *axis2_om_doctype_get_value(axis2_om_node_t * doctype_node)
{
if (!doctype_node || doctype_node->element_type !=AXIS2_OM_DOCTYPE)
{
@@ -97,7 +100,7 @@
return ((axis2_om_doctype_t *) (doctype_node->data_element))->value;
}
-void axis2_om_doctype_set_value(axis2_node_t * doctype_node,const char *value)
+void axis2_om_doctype_set_value(axis2_om_node_t * doctype_node,const char *value)
{
axis2_om_doctype_t *doctype = NULL;
if (!doctype_node || doctype_node->element_type !=AXIS2_OM_DOCTYPE)
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_document.c Mon Oct 3 22:18:50 2005
@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <axis2_errno.h>
-axis2_om_document_t *axis2_om_document_create(axis2_node_t * root_ele,
+axis2_om_document_t *axis2_om_document_create(axis2_om_node_t * root_ele,
axis2_stax_om_builder_t * builder)
{
@@ -69,7 +69,7 @@
}
void axis2_om_document_add_child(axis2_om_document_t * document,
- axis2_node_t * child)
+ axis2_om_node_t * child)
{
if (!document || !child)
{ /* nothing to do */
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=293528&r1=293527&r2=293528&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 22:18:50 2005
@@ -22,11 +22,11 @@
static apr_pool_t *om_pool;
-axis2_node_t *
-axis2_om_element_create (const char *localname, axis2_om_namespace_t * ns,
- axis2_node_t * parent)
+axis2_om_element_t *
+axis2_om_element_create (axis2_om_node_t * parent,const char *localname,
+ axis2_om_namespace_t * ns,axis2_om_node_t *ele_node)
{
- axis2_node_t *node;
+ axis2_om_node_t *node;
axis2_om_element_t *element;
if (!localname)
{
@@ -62,38 +62,39 @@
node->element_type = AXIS2_OM_ELEMENT;
node->data_element = element;
axis2_om_element_set_namespace (node, ns);
-
- return node;
+ ele_node = node;
+ return element;
}
/* create an om_element using qname and parent */
-axis2_node_t *
-axis2_om_element_create_with_qname (axis2_qname_t * qname,
- axis2_node_t * parent)
+axis2_om_element_t *
+axis2_om_element_create_with_qname (axis2_om_node_t * parent,
+ axis2_qname_t * qname,axis2_om_node_t *ele_node)
{
- axis2_node_t *node = NULL;;
+ axis2_om_element_t *element;
+ axis2_om_node_t *node = NULL;;
if (!qname)
{
return NULL; /* can't create an element */
}
- node = axis2_om_element_create (qname->localpart, NULL, parent);
+ element = axis2_om_element_create (parent,qname->localpart, NULL,node);
if (node)
{
((axis2_om_element_t *) (node->data_element))->ns =
axis2_om_element_handle_namespace_with_qname (node, qname);
}
- return node;
+ ele_node = node;
+ return element;
}
-axis2_node_t *
-axis2_om_element_create_with_builder (const char *localname,
- axis2_om_namespace_t * ns,
- axis2_node_t * parent,
- axis2_stax_om_builder_t * builder)
+axis2_om_element_t *
+axis2_om_element_create_with_builder (axis2_om_node_t * parent,
+ const char *localname,axis2_om_namespace_t * ns
+ ,axis2_stax_om_builder_t * builder,axis2_om_node_t *ele_node)
{
- axis2_node_t *node;
+ axis2_om_node_t *node;
axis2_om_element_t *element;
if (!localname)
{
@@ -131,11 +132,12 @@
axis2_node_add_child (parent, node);
}
axis2_om_element_set_namespace (node, ns);
- return node;
+ ele_node = node;
+ return element;
}
axis2_om_namespace_t *
-axis2_om_element_find_namespace (axis2_node_t
+axis2_om_element_find_namespace (axis2_om_node_t
* element_node, const char *uri,
const char *prefix)
{
@@ -169,7 +171,7 @@
/* declare a namespace for this om element */
axis2_om_namespace_t *
-axis2_om_element_declare_namespace (axis2_node_t *
+axis2_om_element_declare_namespace (axis2_om_node_t *
element_node, axis2_om_namespace_t * ns)
{
apr_status_t status;
@@ -199,7 +201,7 @@
axis2_om_namespace_t *
-axis2_om_element_declare_namespace_with_ns_uri_prefix (axis2_node_t *
+axis2_om_element_declare_namespace_with_ns_uri_prefix (axis2_om_node_t *
element_node,
const char *uri,
const char *prefix)
@@ -219,7 +221,7 @@
*
*/
axis2_om_namespace_t *
-axis2_om_element_find_declared_namespace (axis2_node_t * element_node,
+axis2_om_element_find_declared_namespace (axis2_om_node_t * element_node,
const char *uri, const char *prefix)
{
void *ns = NULL;
@@ -258,7 +260,7 @@
static axis2_om_namespace_t *
-axis2_om_element_handle_namespace_with_qname (axis2_node_t * element_node,
+axis2_om_element_handle_namespace_with_qname (axis2_om_node_t * element_node,
axis2_qname_t * qname)
{
axis2_om_namespace_t *pns = NULL;
@@ -287,7 +289,7 @@
}
static axis2_om_namespace_t *
-axis2_om_element_handle_namespace (axis2_node_t
+axis2_om_element_handle_namespace (axis2_om_node_t
* element_node, axis2_om_namespace_t * ns)
{
axis2_om_namespace_t *ns1 = NULL;
@@ -306,7 +308,7 @@
axis2_om_attribute_t *
-axis2_om_element_add_attribute (axis2_node_t * element_node,
+axis2_om_element_add_attribute (axis2_om_node_t * element_node,
axis2_om_attribute_t * attr)
{
apr_status_t status;
@@ -336,7 +338,7 @@
}
axis2_om_attribute_t *
-axis2_om_element_get_attribute (axis2_node_t * element_node,
+axis2_om_element_get_attribute (axis2_om_node_t * element_node,
axis2_qname_t * qname)
{
char *key = NULL;
@@ -358,7 +360,7 @@
*/
axis2_om_attribute_t *
-axis2_om_element_add_attribute_with_namespace (axis2_node_t * element_node,
+axis2_om_element_add_attribute_with_namespace (axis2_om_node_t * element_node,
const char *attribute_name,
const char *value,
axis2_om_namespace_t * ns)
@@ -384,7 +386,7 @@
void
-axis2_om_element_set_namespace (axis2_node_t * node,
+axis2_om_element_set_namespace (axis2_om_node_t * node,
axis2_om_namespace_t * ns)
{
axis2_om_namespace_t *nsp = NULL;
@@ -423,7 +425,7 @@
}
void
-axis2_om_element_set_localname (axis2_node_t * element_node,
+axis2_om_element_set_localname (axis2_om_node_t * element_node,
const char *localname)
{
axis2_om_element_t *element = NULL;
@@ -441,7 +443,7 @@
}
char *
-axis2_om_element_get_localname (axis2_node_t * element_node)
+axis2_om_element_get_localname (axis2_om_node_t * element_node)
{
if (!element_node || element_node->element_type != AXIS2_OM_ELEMENT)
{
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=293528&r1=293527&r2=293528&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 Mon Oct 3 22:18:50 2005
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-#include <axis2_node.h>
+#include <axis2_om_node.h>
-axis2_node_t *axis2_node_create()
+axis2_om_node_t *axis2_node_create()
{
- axis2_node_t *node = (axis2_node_t *) malloc(sizeof(axis2_node_t));
+ axis2_om_node_t *node = (axis2_om_node_t *) malloc(sizeof(axis2_om_node_t));
if (!node)
{
@@ -38,13 +38,13 @@
}
-void axis2_node_free(axis2_node_t * node)
+void axis2_node_free(axis2_om_node_t * node)
{
if (!node)
return;
}
-void axis2_node_add_child(axis2_node_t * parent, axis2_node_t * child)
+void axis2_node_add_child(axis2_om_node_t * parent, axis2_om_node_t * child)
{
if (!parent || !child)
{
@@ -67,9 +67,9 @@
-axis2_node_t *axis2_node_detach(axis2_node_t * node_to_detach)
+axis2_om_node_t *axis2_node_detach(axis2_om_node_t * node_to_detach)
{
- axis2_node_t *parent = NULL;
+ axis2_om_node_t *parent = NULL;
if (!node_to_detach)
{
@@ -104,7 +104,7 @@
return node_to_detach;
}
-void axis2_node_set_parent(axis2_node_t * node,axis2_node_t *parent)
+void axis2_node_set_parent(axis2_om_node_t * node,axis2_om_node_t *parent)
{
if(!parent || !node)
{
@@ -131,8 +131,8 @@
* @param nodeto_insert the node that will be inserted
*/
-void axis2_node_insert_sibling_after(axis2_node_t *node,
- axis2_node_t *node_to_insert)
+void axis2_node_insert_sibling_after(axis2_om_node_t *node,
+ axis2_om_node_t *node_to_insert)
{
if(!node || !node_to_insert )
{
@@ -151,8 +151,8 @@
}
-void axis2_node_insert_sibling_before(axis2_node_t *node,
- axis2_node_t *node_to_insert)
+void axis2_node_insert_sibling_before(axis2_om_node_t *node,
+ axis2_om_node_t *node_to_insert)
{
if(!node || !node_to_insert )
{
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_processing_instruction.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_processing_instruction.c?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_processing_instruction.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_processing_instruction.c Mon Oct 3 22:18:50 2005
@@ -13,23 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
#include <axis2_om_processing_instruction.h>
-#include <axis2_node.h>
+#include <axis2_om_node.h>
#include <stdlib.h>
#include <axis2_errno.h>
-/**
-* allocate memory for processing instruction structure and assign the values;
-* This structure is set to axis2_node_t structure and returned.
-*
-*/
-
-axis2_node_t *axis2_create_om_processing_instruction_with_parent(
- axis2_node_t *parent,const char *target,const char *value)
+axis2_om_processing_instruction_t *axis2_om_processing_instruction_create(axis2_om_node_t *parent,const char *target,const char *value,axis2_om_node_t *pinode)
{
axis2_om_processing_instruction_t *pi = NULL;
- axis2_node_t *pi_node = axis2_node_create();
+ axis2_om_node_t *pi_node = axis2_node_create();
if (pi_node)
{
@@ -59,12 +52,15 @@
pi_node->parent = parent;
axis2_node_add_child(parent, pi_node);
}
- return pi_node;
+ pinode = pi_node;
+
+ return pi;
}
-axis2_node_t *axis2_create_empty_om_processing_instruction(axis2_node_t *parent)
+axis2_om_processing_instruction_t *axis2_om_processing_instruction_create_empty(axis2_om_node_t *parent
+ ,axis2_om_node_t *node)
{
- axis2_node_t *pi_node = NULL;
+ axis2_om_node_t *pi_node = NULL;
axis2_om_processing_instruction_t *pi = NULL;
pi_node = axis2_node_create();
if (pi_node)
@@ -87,11 +83,12 @@
pi_node->parent = parent;
axis2_node_add_child(parent, pi_node);
}
- return pi_node;
+ node = pi_node;
+ return pi;
}
-char *axis2_om_processing_instruction_get_value(axis2_node_t * pi_node)
+char *axis2_om_processing_instruction_get_value(axis2_om_node_t * pi_node)
{
if (!pi_node || pi_node->element_type !=AXIS2_OM_PROCESSING_INSTRUCTION)
{
@@ -100,7 +97,7 @@
return ((axis2_om_processing_instruction_t *)(pi_node->data_element))->value;
}
-char *axis2_om_processing_instruction_get_target(axis2_node_t * pi_node)
+char *axis2_om_processing_instruction_get_target(axis2_om_node_t * pi_node)
{
if (!pi_node || pi_node->element_type !=AXIS2_OM_PROCESSING_INSTRUCTION)
{
@@ -109,7 +106,7 @@
return ((axis2_om_processing_instruction_t *)(pi_node->data_element))->target;
}
-void axis2_om_processing_instruction_set_value(axis2_node_t * pi_node,
+void axis2_om_processing_instruction_set_value(axis2_om_node_t * pi_node,
const char *value)
{
axis2_om_processing_instruction_t *pi = NULL;
@@ -126,7 +123,7 @@
pi = NULL;
}
-void axis2_om_processing_instruction_set_target(axis2_node_t * pi_node,
+void axis2_om_processing_instruction_set_target(axis2_om_node_t * pi_node,
const char *value)
{
axis2_om_processing_instruction_t *pi = NULL;
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_text.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_text.c?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_text.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_om_text.c Mon Oct 3 22:18:50 2005
@@ -16,13 +16,14 @@
#include <axis2_om_text.h>
#include <string.h>
-#include <axis2_node.h>
+#include <axis2_om_node.h>
#include <axis2_errno.h>
-axis2_node_t *axis2_create_om_text(axis2_node_t *parent,const char *value)
+axis2_om_text_t *axis2_om_text_create(axis2_om_node_t *parent,const char *value
+ ,axis2_om_node_t *text_node)
{
axis2_om_text_t *text;
- axis2_node_t *node = axis2_node_create();
+ axis2_om_node_t *node = axis2_node_create();
if (!node)
{
fprintf(stderr,"%d Error",AXIS2_ERROR_OM_MEMORY_ALLOCATION);
@@ -47,7 +48,8 @@
node->parent = parent;
axis2_node_add_child(parent,node);
}
- return node;
+ text_node = node;
+ return text;
}
Modified: webservices/axis2/trunk/c/modules/xml/om/src/axis2_stax_ombuilder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/src/axis2_stax_ombuilder.c?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/src/axis2_stax_ombuilder.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/src/axis2_stax_ombuilder.c Mon Oct 3 22:18:50 2005
@@ -15,7 +15,7 @@
*/
#include <axis2_stax_ombuilder.h>
-#include <axis2_node.h>
+#include <axis2_om_node.h>
#include <stdlib.h>
#include <namespace.h>
#include <axis2_om_element.h>
@@ -32,9 +32,9 @@
return NULL;
}
builder->parser = parser;
- builder->cache = true;
- builder->parser_accessed = false;
- builder->done = false;
+ builder->cache = TRUE;
+ builder->parser_accessed = FALSE;
+ builder->done = FALSE;
builder->lastnode=NULL;
document = axis2_om_document_create(NULL,builder);
@@ -45,28 +45,28 @@
return builder;
}
-axis2_node_t *axis2_stax_om_builder_create_om_element(
+axis2_om_node_t *axis2_stax_om_builder_create_om_element(
axis2_stax_om_builder_t *builder)
{
- axis2_node_t *element_node;
+ axis2_om_node_t *element_node;
char *localname = XML_PullParser_getName(builder->parser);
if(!(builder->lastnode))
{ /* */
- element_node = axis2_om_element_create_with_builder(localname,NULL,NULL,builder);
+ axis2_om_element_create_with_builder(NULL,localname,NULL,builder,element_node);
builder->document->root_element = element_node;
axis2_om_document_add_child(builder->document,element_node);
}
else if(builder->lastnode->done)
{ /* */
- element_node = axis2_om_element_create_with_builder(localname,NULL,
- builder->lastnode->parent,builder);
+ axis2_om_element_create_with_builder(builder->lastnode->parent,localname,NULL
+ ,builder,element_node);
builder->lastnode->next_sibling = element_node;
element_node->prev_sibling = builder->lastnode;
}
else
{ /* */
- element_node = axis2_om_element_create_with_builder(localname,NULL,builder->lastnode,builder);
+ axis2_om_element_create_with_builder(builder->lastnode,localname,NULL,builder,element_node);
builder->lastnode->first_child = element_node;
element_node->parent = builder->lastnode;
}
@@ -77,30 +77,26 @@
return NULL;
}
-axis2_node_t *axis2_stax_om_builder_create_om_comment(
+axis2_om_node_t *axis2_stax_om_builder_create_om_comment(
axis2_stax_om_builder_t *builder)
{
- axis2_node_t *node;
- if(!builder)
- {
- return NULL;
- }
- /*****/
+
+ /* guththila does not support yet*/
return NULL;
}
-axis2_node_t *axis2_stax_om_builder_create_om_doctype(
+axis2_om_node_t *axis2_stax_om_builder_create_om_doctype(
axis2_stax_om_builder_t *builder)
{
- /******/
+ /* guththila does not support yet */
}
-axis2_node_t *axis2_stax_om_builder_create_om_processing_instruction(
+axis2_om_node_t *axis2_stax_om_builder_create_om_processing_instruction(
axis2_stax_om_builder_t *builder)
{
- /******/
+ /* guththila does not support yet */
@@ -110,16 +106,16 @@
void axis2_stax_om_builder_end_element(axis2_stax_om_builder_t *builder)
{
- axis2_node_t *parent;
+ axis2_om_node_t *parent;
if(builder->lastnode->done)
{
parent = builder->lastnode->parent;
- parent->done = true;
+ parent->done = TRUE;
builder->lastnode = parent;
}
else
{
- builder->lastnode->done = true;
+ builder->lastnode->done = TRUE;
}
}
@@ -156,14 +152,15 @@
case END_ELEMENT:
{
-
+ axis2_stax_om_builder_end_element(builder);
+
}
break;
case CHARACTER:
{
-
+ builder->lastnode = axis2_stax_om_builder_create_om_text(builder);
@@ -171,35 +168,109 @@
break;
case COMMENT:
{
-
-
-
-
+
}
break;
+
+
};
}
-void axis2_stax_om_builder_process_attributes(axis2_stax_om_builder_t *builder,axis2_node_t *element_node)
+void axis2_stax_om_builder_process_attributes(axis2_stax_om_builder_t *builder,axis2_om_node_t *element_node)
{
+ int i=0;
+ axis2_om_namespace_t *ns=NULL;
+ char *uri=NULL;
+ char *prefix=NULL;
+
+ int attribute_count = XML_PullParser_getAttributeCount(builder->parser);
+ for(i=0 ; i < attribute_count ; i++)
+ {
+
+ uri = XML_PullParser_getAttributeNamespace_by_number(builder->parser,i);
+ prefix = XML_PullParser_getAttributePrefix_by_number(builder->parser,i);
+ if(strcmp(uri,"") != 0)
+ {
+ ns = axis2_om_element_find_namespace(element_node,uri,prefix);
+ }
+
+ if(ns == NULL && (prefix != NULL) && (uri != NULL)
+ && (strcmp(prefix,XMLNS_PREFIX) == 0)
+ && (strcmp(uri,XMLNS_URI) == 0))
+ {
+ axis2_om_element_declare_namespace_with_ns_uri_prefix(element_node,
+ XMLNS_URI,XMLNS_PREFIX);
+ ns = axis2_om_element_find_namespace(element_node,uri,prefix);
+
+
+ }
+ axis2_om_element_add_attribute_with_namespace(element_node
+ ,XML_PullParser_getAttributeName_by_number(builder->parser,i)
+ ,XML_PullParser_getAttributeValue_by_number(builder->parser,i),ns);
+ }
}
-axis2_node_t *axis2_stax_om_builder_create_om_text(axis2_stax_om_builder_t *builder)
+axis2_om_node_t *axis2_stax_om_builder_create_om_text(axis2_stax_om_builder_t *builder)
{
+ axis2_om_node_t *node;
+ if(builder->lastnode)
+ {
+ fprintf(stderr," ERROR");
+ return NULL;
+ }
+ if(builder->lastnode->done)
+ {
+ axis2_om_text_create(builder->lastnode->parent,
+ XML_PullParser_getValue(builder->parser),node);
+ }
+ else
+ {
+ axis2_om_text_create(builder->lastnode,
+ XML_PullParser_getValue(builder->parser),node);
+
+ }
+ return node;
}
-void axis2_stax_om_builder_discard(axis2_stax_om_builder_t *builder,axis2_node_t *element_node)
+void axis2_stax_om_builder_discard(axis2_stax_om_builder_t *builder,axis2_om_node_t *element_node)
{
-
+/* axis2_om_node_t *element;
+ if(element_node->done || !(builder->cache))
+ {
+ fprintf(stderr," Error");
+ return;
+ }
+
+ cache = FALSE;
+ do
+ (
+ while(XML_PullParser_next(builder->parser) != END_ELEMENT);
+
+ }while(
+
+
+
+
+
+
+
+
+
+
+
+
+*/
+
+
}
-axis2_node_t *axis2_stax_om_builder_process_namespace_data(axis2_stax_om_builder_t *builder,axis2_node_t *element,int is_soap_element)
+axis2_om_node_t *axis2_stax_om_builder_process_namespace_data(axis2_stax_om_builder_t *builder,axis2_om_node_t *element,int is_soap_element)
{
int i=0;
char *nsuri = NULL;
@@ -244,4 +315,26 @@
}
}
}
+}
+
+char *axis2_stax_om_builder_get_attribute_prefix(axis2_stax_om_builder_t *builder,int i)
+{
+ return XML_PullParser_getAttributePrefix_by_number(builder->parser,i);
+}
+
+
+
+char *axis2_stax_om_builder_get_attribute_name(axis2_stax_om_builder_t *builder,int i)
+{
+ return XML_PullParser_getAttributeName_by_number(builder->parser,i);
+}
+
+int axis2_stax_om_builder_get_attribute_count(axis2_stax_om_builder_t *builder)
+{
+ return XML_PullParser_getAttributeCount(builder->parser);
+}
+
+char *axis2_stax_om_builder_get_attribute_namespace(axis2_stax_om_builder_t *builder,int i)
+{
+ XML_PullParser_getAttributeNamespace_by_number( builder->parser,i);
}
Modified: webservices/axis2/trunk/c/modules/xml/om/test/om_test.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/xml/om/test/om_test.c?rev=293528&r1=293527&r2=293528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/xml/om/test/om_test.c (original)
+++ webservices/axis2/trunk/c/modules/xml/om/test/om_test.c Mon Oct 3 22:18:50 2005
@@ -4,21 +4,21 @@
#include <axis2_node.h>
void Testnode_detach(CuTest *tc) {
- axis2_node_t* parent = axis2_node_create();
- axis2_node_t* prev_sibling = axis2_node_create();
+ axis2_om_node_t* parent = axis2_node_create();
+ axis2_om_node_t* prev_sibling = axis2_node_create();
axis2_node_add_child(parent, prev_sibling);
- axis2_node_t* test_node = axis2_node_create();
+ axis2_om_node_t* test_node = axis2_node_create();
axis2_node_add_child(parent, test_node);
- axis2_node_t* next_sibling = axis2_node_create();
+ axis2_om_node_t* next_sibling = axis2_node_create();
axis2_node_add_child(parent, next_sibling);
- axis2_node_t* temp_parent = axis2_node_detach(test_node);
+ axis2_om_node_t* temp_parent = axis2_node_detach(test_node);
puts("came");
if(0 == temp_parent) puts("parent is null\n");
- axis2_node_t* expected = temp_parent->first_child;
+ axis2_om_node_t* expected = temp_parent->first_child;
printf("came2");
if(0 == expected) puts("expected is null\n");
- axis2_node_t* actual = next_sibling;
+ axis2_om_node_t* actual = next_sibling;
CuAssertPtrEquals(tc, expected, actual);
}