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/12/05 04:49:50 UTC

svn commit: r353971 [1/2] - in /webservices/axis2/trunk/c: bindings/php/ include/ modules/util/src/ modules/xml/parser/ modules/xml/parser/guththila/src/ modules/xml/parser/libxml2/src/ test/xml/om/

Author: samisa
Date: Sun Dec  4 19:49:16 2005
New Revision: 353971

URL: http://svn.apache.org/viewcvs?rev=353971&view=rev
Log:
om_test.c modified , new files added to php modules 

Added:
    webservices/axis2/trunk/c/bindings/php/om_attribute.c
    webservices/axis2/trunk/c/bindings/php/om_comment.c
    webservices/axis2/trunk/c/bindings/php/om_doctype.c
    webservices/axis2/trunk/c/bindings/php/om_document.c
    webservices/axis2/trunk/c/bindings/php/om_element.c
    webservices/axis2/trunk/c/bindings/php/om_namespace.c
    webservices/axis2/trunk/c/bindings/php/om_node.c
    webservices/axis2/trunk/c/bindings/php/om_output.c
    webservices/axis2/trunk/c/bindings/php/om_processing_instruction.c
    webservices/axis2/trunk/c/bindings/php/om_stax_builder.c
    webservices/axis2/trunk/c/bindings/php/om_text.c
    webservices/axis2/trunk/c/bindings/php/output.php
    webservices/axis2/trunk/c/bindings/php/qname.c
    webservices/axis2/trunk/c/bindings/php/xml_writer.c
Modified:
    webservices/axis2/trunk/c/bindings/php/axis2.c
    webservices/axis2/trunk/c/bindings/php/axis2_ce.h
    webservices/axis2/trunk/c/bindings/php/axis2_common.h
    webservices/axis2/trunk/c/bindings/php/axis2_fe.h
    webservices/axis2/trunk/c/bindings/php/axis2_properties.h
    webservices/axis2/trunk/c/bindings/php/php_axis2.h
    webservices/axis2/trunk/c/include/axis2_om_element.h
    webservices/axis2/trunk/c/modules/util/src/env.c
    webservices/axis2/trunk/c/modules/xml/parser/axis2_xml_writer.h
    webservices/axis2/trunk/c/modules/xml/parser/guththila/src/guththila_xml_writer_wrapper.c
    webservices/axis2/trunk/c/modules/xml/parser/libxml2/src/axis2_libxml2_writer_wrapper.c
    webservices/axis2/trunk/c/test/xml/om/test_om.c

Modified: webservices/axis2/trunk/c/bindings/php/axis2.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2.c?rev=353971&r1=353970&r2=353971&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2.c (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2.c Sun Dec  4 19:49:16 2005
@@ -32,7 +32,7 @@
 #include "axis2_log_default.h"
 
 
-zend_object_value axis2_objects_new(zend_class_entry *class_type TSRMLS_DC );
+static zend_object_value axis2_objects_new(zend_class_entry *class_type TSRMLS_DC );
 
 
 
@@ -132,8 +132,26 @@
 	
 	REGISTER_AXIS2_CLASS(ce,"Axis2XMLReader",NULL, php_axis2_xml_reader_class_functions, axis2_xml_reader_class_entry);
     
+    REGISTER_AXIS2_CLASS(ce,"Axis2XMLWriter",NULL, php_axis2_xml_writer_class_functions, axis2_xml_writer_class_entry);
     
+    REGISTER_AXIS2_CLASS(ce,"Axis2OMBuilder",NULL, php_axis2_om_stax_builder_class_functions, axis2_om_stax_builder_class_entry);
     
+    REGISTER_AXIS2_CLASS(ce,"Axis2OMDocument",NULL, php_axis2_om_document_class_functions, axis2_om_document_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce,"Axis2OMOutput",NULL, php_axis2_om_output_class_functions, axis2_om_output_class_entry);
+    
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMNamespace", NULL, php_axis2_om_namespace_class_functions, axis2_om_namespace_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMAttribute", NULL, php_axis2_om_attribute_class_functions, axis2_om_attribute_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2Qname", NULL, php_axis2_qname_class_functions, axis2_qname_class_entry);
+   
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMNode", NULL, php_axis2_om_node_class_functions, axis2_om_node_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMElement", axis2_om_node_class_entry , php_axis2_om_element_class_functions , axis2_om_element_class_entry);
+    
+    REGISTER_AXIS2_CLASS(ce, "Axis2OMText", axis2_om_node_class_entry , php_axis2_om_text_class_functions , axis2_om_text_class_entry);
     
     
     REGISTER_LONG_CONSTANT("AXIS2_XML_READER_START_DOCUMENT",	AXIS2_XML_READER_START_DOCUMENT,		CONST_CS | CONST_PERSISTENT);
@@ -174,13 +192,7 @@
     zend_hash_destroy(intern->std.properties);
     FREE_HASHTABLE(intern->std.properties);
     
-    if(intern->node_list)
-    {
-        zend_hash_destroy(intern->node_list);
-        FREE_HASHTABLE(intern->node_list);
-    
-    }
-    /*TODO individaul objects must be freed */
+    /*TODO individual objects must be freed */
     if(intern->ptr)
     {
     
@@ -199,8 +211,7 @@
     
     intern = emalloc(sizeof(axis2_object));
     intern->std.ce = class_type;
-    intern->std.in_get = 0;
-    intern->std.in_set = 0;
+   
     
     intern->ptr = NULL;
     intern->prop_handler = NULL;
@@ -217,17 +228,6 @@
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
 /* Remove if there's nothing to do at request start */
 /* {{{ PHP_RINIT_FUNCTION
  */
@@ -287,6 +287,115 @@
     TSRMLS_FETCH();
     return AXIS2_G(env);
 }
+
+/* {{{ create_axis2_om_object */
+zval *php_axis2_create_om_object(void *obj, int obj_type, zend_class_entry *class_type TSRMLS_DC)
+{
+    zval *wrapper = NULL;
+    zend_class_entry *ce = NULL;
+    axis2_object *intern = NULL;
+    om_object *om_obj = NULL;
+    
+    if(!obj)
+    {
+        return NULL;
+    }
+    ce = class_type;
+   
+    ALLOC_ZVAL(wrapper);
+    /* ZVAL_NULL(wrapper); */
+    object_init_ex(wrapper,ce);
+    intern = (axis2_object_ptr)zend_objects_get_address(wrapper TSRMLS_CC);
+    ZVAL_ADDREF(wrapper);
+    
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->ptr = obj;
+    om_obj->obj_type = obj_type;
+    intern->ptr = om_obj;
+    intern->obj_type = OM_OBJ;
+    return (wrapper);   
+}
+
+/* }}} end create object */
+
+/* {{{ create om_node object */
+
+zval *php_axis2_create_om_node_object(void *obj, int node_type, zend_class_entry *class_type  TSRMLS_DC)
+{
+    zval *wrapper = NULL;
+    zend_class_entry *ce = NULL;
+    axis2_object *intern = NULL;
+    om_node_t *node_obj = NULL;
+    if(!obj)
+    {
+        return NULL;
+    }
+    ce = class_type;
+    ALLOC_ZVAL(wrapper);
+    /* ZVAL_NULL(wrapper); */
+    object_init_ex(wrapper, ce);
+    intern = (axis2_object_ptr)zend_objects_get_address(wrapper TSRMLS_CC);
+    ZVAL_ADDREF(wrapper);
+    
+    node_obj = (om_node_ptr)emalloc(sizeof(om_node_t));
+    node_obj->ptr = obj;
+    node_obj->node_type = node_type;
+    node_obj->builder = NULL;
+    node_obj->doc = NULL;
+    intern->ptr = node_obj;
+    intern->obj_type = OM_NODE_OBJ;
+    return (wrapper);
+}
+/* }}} end om_node_create obj */
+
+/* {{{ set Object */
+void php_axis2_set_object(void *obj,int obj_type, zval *wrapper_in TSRMLS_DC)
+{
+    axis2_object_ptr axis2_obj = NULL;
+   
+    axis2_obj = (axis2_object_ptr)zend_object_store_get_object(wrapper_in TSRMLS_CC);
+    axis2_obj->obj_type = obj_type;
+    axis2_obj->ptr = obj;
+}
+/* }}} end set object */
+
+/* {{{ stream to buffer */
+char* php_axis2_stream_to_buffer(php_stream *stream TSRMLS_DC)
+{
+    char *buffer = NULL;
+    int size = 0;
+    char *temp_buffer = NULL;
+    size = php_stream_copy_to_mem(stream,&temp_buffer,PHP_STREAM_COPY_ALL, 0);
+    buffer = estrdup(temp_buffer);
+    pefree(temp_buffer, 0);
+    return buffer;
+}
+
+zend_class_entry* php_axis2_get_class_type(int node_type)
+{
+    zend_class_entry *ce = NULL;
+    switch(node_type)
+    {
+        case OM_ELEMENT:
+            ce = axis2_om_element_class_entry;
+            break;
+        case OM_TEXT: 
+            ce = axis2_om_text_class_entry;
+            break;
+        case OM_PI:
+            ce = axis2_om_pi_class_entry;
+            break;
+        case OM_COMMENT:
+            ce = axis2_om_comment_class_entry;            
+            break;
+        default:
+            ce = NULL;
+            break;    
+    }
+    return ce;
+}
+/* }}} end stream to buffer */
+
 
 /*
  * Local variables:

Modified: webservices/axis2/trunk/c/bindings/php/axis2_ce.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2_ce.h?rev=353971&r1=353970&r2=353971&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2_ce.h (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2_ce.h Sun Dec  4 19:49:16 2005
@@ -1,16 +1,35 @@
+/*
+  +----------------------------------------------------------------------+
+  | PHP Version 5                                                        |
+  +----------------------------------------------------------------------+
+  | Copyright (c) 1997-2004 The PHP Group                                |
+  +----------------------------------------------------------------------+
+  | This source file is subject to version 3.0 of the PHP license,       |
+  | that is bundled with this package in the file LICENSE, and is        |
+  | available through the world-wide-web at the following url:           |
+  | http://www.php.net/license/3_0.txt.                                  |
+  | If you did not receive a copy of the PHP license and are unable to   |
+  | obtain it through the world-wide-web, please send a note to          |
+  | license@php.net so we can mail you a copy immediately.               |
+  +----------------------------------------------------------------------+
+  | Author:                                                              |
+  +----------------------------------------------------------------------+
+*/
+
 #ifndef AXIS2_CE_H
 #define AXIS2_CE_H
 
 zend_class_entry *axis2_xml_reader_class_entry;
 zend_class_entry *axis2_xml_writer_class_entry;
+zend_class_entry *axis2_qname_class_entry;
 zend_class_entry *axis2_om_element_class_entry;
 zend_class_entry *axis2_om_comment_class_entry;
 zend_class_entry *axis2_om_text_class_entry;
-zend_class_entry *axis2_om_pi_entry;
+zend_class_entry *axis2_om_pi_class_entry;
 zend_class_entry *axis2_om_stax_builder_class_entry;
 zend_class_entry *axis2_om_document_class_entry;
 zend_class_entry *axis2_om_attribute_class_entry;
 zend_class_entry *axis2_om_namespace_class_entry;
-
-
+zend_class_entry *axis2_om_node_class_entry;
+zend_class_entry *axis2_om_output_class_entry;
 #endif /* AXIS2_CE_H */

Modified: webservices/axis2/trunk/c/bindings/php/axis2_common.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2_common.h?rev=353971&r1=353970&r2=353971&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2_common.h (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2_common.h Sun Dec  4 19:49:16 2005
@@ -24,12 +24,13 @@
 #include <axis2_om_document.h>
 #include <axis2_om_stax_builder.h>
 
-typedef struct _axis2_om_node {
-    axis2_om_node_t *node;
+typedef struct _om_node {
+    void *ptr;
     axis2_om_document_t *doc;
     axis2_om_stax_builder_t *builder;
+    int node_type;
     int ref_count;
-}axis2_om_node;
+}om_node_t;
 
 typedef struct _om_object{
     void *ptr;
@@ -37,9 +38,7 @@
     int ref_count;
 }om_object;
 
-
-
-typedef axis2_om_node* axis2_om_node_ptr;
+typedef om_node_t* om_node_ptr;
 typedef om_object* om_object_ptr;
 
 
@@ -48,6 +47,20 @@
 ce.create_object = axis2_objects_new; \
 entry = zend_register_internal_class_ex(&ce, parent_ce, NULL TSRMLS_CC);
 
-
+#define AXIS2_GET_THIS(zval) \
+        if(NULL == (zval = getThis())) \
+        { \
+            php_error_docref(NULL TSRMLS_CC, E_WARNING, "object missing ");  \
+            RETURN_FALSE; \
+        } 
+        
+#define AXIS2_GET_OBJ(__ptr, __id, __ptr_type, __intern) \
+        { \
+            __intern = (axis2_object *)zend_object_store_get_object(__id TSRMLS_CC); \
+            if((__intern->ptr)) \
+            { \
+                __ptr = (__ptr_type)(__intern->ptr); \
+            } \
+        }
 
 #endif /* AXIS2_COMMON_H */

Modified: webservices/axis2/trunk/c/bindings/php/axis2_fe.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2_fe.h?rev=353971&r1=353970&r2=353971&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2_fe.h (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2_fe.h Sun Dec  4 19:49:16 2005
@@ -1,3 +1,21 @@
+/*
+  +----------------------------------------------------------------------+
+  | PHP Version 5                                                        |
+  +----------------------------------------------------------------------+
+  | Copyright (c) 1997-2004 The PHP Group                                |
+  +----------------------------------------------------------------------+
+  | This source file is subject to version 3.0 of the PHP license,       |
+  | that is bundled with this package in the file LICENSE, and is        |
+  | available through the world-wide-web at the following url:           |
+  | http://www.php.net/license/3_0.txt.                                  |
+  | If you did not receive a copy of the PHP license and are unable to   |
+  | obtain it through the world-wide-web, please send a note to          |
+  | license@php.net so we can mail you a copy immediately.               |
+  +----------------------------------------------------------------------+
+  | Author:                                                              |
+  +----------------------------------------------------------------------+
+*/
+
 #ifndef AXIS2_FE_H
 #define AXIS2_FE_H
 
@@ -11,6 +29,10 @@
 extern zend_function_entry php_axis2_om_document_class_functions[];
 extern zend_function_entry php_axis2_om_attribute_class_functions[];
 extern zend_function_entry php_axis2_om_namespace_class_functions[];
+extern zend_function_entry php_axis2_om_node_class_functions[];
+extern zend_function_entry php_axis2_qname_class_functions[];
+extern zend_function_entry php_axis2_om_output_class_functions[];
+
 
 /** axis2_xml_reader functions */
 PHP_METHOD(xml_reader, __construct);
@@ -29,20 +51,160 @@
 PHP_FUNCTION(axis2_xml_reader_get_pi_target);
 PHP_FUNCTION(axis2_xml_reader_get_pi_data);
 
+/** xml_writer functions */
+
+PHP_FUNCTION(axis2_xml_writer_write_start_element);
+PHP_FUNCTION(axis2_xml_writer_end_start_element);
+PHP_FUNCTION(axis2_xml_writer_write_start_element_with_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_start_element_with_namespace_prefix);
+PHP_FUNCTION(axis2_xml_writer_write_empty_element);
+PHP_FUNCTION(axis2_xml_writer_write_empty_element_with_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_empty_element_with_namespace_prefix);
+PHP_FUNCTION(axis2_xml_writer_write_end_element);
+PHP_FUNCTION(axis2_xml_writer_write_end_document);
+PHP_FUNCTION(axis2_xml_writer_write_attribute);
+PHP_FUNCTION(axis2_xml_writer_write_attribute_with_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_attribute_with_namespace_prefix);
+PHP_FUNCTION(axis2_xml_writer_write_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_default_namespace);
+PHP_FUNCTION(axis2_xml_writer_write_comment);
+PHP_FUNCTION(axis2_xml_writer_write_processing_instruction);
+PHP_FUNCTION(axis2_xml_writer_write_processing_instruction_data);
+PHP_FUNCTION(axis2_xml_writer_write_cdata);
+PHP_FUNCTION(axis2_xml_writer_write_dtd);
+PHP_FUNCTION(axis2_xml_writer_write_entity_ref);
+PHP_FUNCTION(axis2_xml_writer_write_start_document);
+PHP_FUNCTION(axis2_xml_writer_write_start_document_with_version);
+PHP_FUNCTION(axis2_xml_writer_write_start_document_with_version_encoding);
+PHP_FUNCTION(axis2_xml_writer_write_characters);
+PHP_FUNCTION(axis2_xml_writer_get_prefix);
+PHP_FUNCTION(axis2_xml_writer_set_prefix);
+PHP_FUNCTION(axis2_xml_writer_set_default_prefix);
+PHP_FUNCTION(axis2_xml_writer_write_encoded);
+PHP_FUNCTION(axis2_xml_writer_get_xml);
+PHP_METHOD(axis2_xml_writer, __construct);
+
+/********* axis2 qname functions ***************/
+PHP_FUNCTION(axis2_qname_equals);
+PHP_FUNCTION(axis2_qname_clone);
+PHP_FUNCTION(axis2_qname_get_uri);
+PHP_FUNCTION(axis2_qname_get_prefix);
+PHP_FUNCTION(axis2_qname_get_localpart);
+PHP_METHOD(axis2_qname, __construct);
+
+/******** axis2_om_attribute functions *********/
+
+PHP_FUNCTION(axis2_om_attribute_get_qname);
+PHP_FUNCTION(axis2_om_attribute_serialize);
+PHP_FUNCTION(axis2_om_attribute_get_localname);
+PHP_FUNCTION(axis2_om_attribute_get_value);
+PHP_FUNCTION(axis2_om_attribute_set_localname);
+PHP_FUNCTION(axis2_om_attribute_set_value);
+PHP_FUNCTION(axis2_om_attribute_get_namespace);
+PHP_FUNCTION(axis2_om_attribute_set_namespace);
+PHP_METHOD(om_attribute, __construct); 
+
+/******* om_namespace functions ******************/
+PHP_FUNCTION(axis2_om_namespace_equals);
+PHP_FUNCTION(axis2_om_namespace_serialize);
+PHP_FUNCTION(axis2_om_namespace_get_uri);
+PHP_FUNCTION(axis2_om_namespace_get_prefix);
+PHP_METHOD(om_namespace, __construct);
+
+/******* om_element functions ********************/
+PHP_FUNCTION(axis2_om_element_find_namespace);
+PHP_FUNCTION(axis2_om_element_declare_namespace);
+PHP_FUNCTION(axis2_om_element_find_namespace_with_qname);
+PHP_FUNCTION(axis2_om_element_add_attribute);
+PHP_FUNCTION(axis2_om_element_get_attribute);
+PHP_FUNCTION(axis2_om_element_serialize);
+PHP_FUNCTION(axis2_om_element_find_declared_namespace);
+PHP_FUNCTION(axis2_om_element_get_localname);
+PHP_FUNCTION(axis2_om_element_get_namespace);
+PHP_FUNCTION(axis2_om_element_set_namespace);
+PHP_FUNCTION(axis2_om_element_set_localname);
+PHP_METHOD(om_element, __construct);
+
+/******* om_comment functions ******************/
+
+PHP_FUNCTION(axis2_om_comment_serialize);
+PHP_FUNCTION(axis2_om_comment_get_value);
+PHP_FUNCTION(axis2_om_comment_set_value);
+PHP_METHOD(om_comment, __construct);
+
+/******** om_document functions ******************/
+
+PHP_FUNCTION(axis2_om_document_build_next);
+PHP_FUNCTION(axis2_om_document_add_child);
+PHP_FUNCTION(axis2_om_document_get_root_element);
+PHP_FUNCTION(axis2_om_document_set_root_element);
+PHP_FUNCTION(axis2_om_document_build_all);
+PHP_METHOD(om_document, __construct);
+
+
+/******* om_node_functions **********************/
+
+PHP_FUNCTION(axis2_om_node_add_child);
+PHP_FUNCTION(axis2_om_node_detach);
+PHP_FUNCTION(axis2_om_node_insert_sibling_after);
+PHP_FUNCTION(axis2_om_node_insert_sibling_before);
+PHP_FUNCTION(axis2_om_node_set_parent);
+PHP_FUNCTION(axis2_om_node_serialize);
+PHP_FUNCTION(axis2_om_node_get_parent);
+PHP_FUNCTION(axis2_om_node_get_first_child);
+PHP_FUNCTION(axis2_om_node_get_last_child);
+PHP_FUNCTION(axis2_om_node_get_previous_sibling);
+PHP_FUNCTION(axis2_om_node_get_next_sibling);
+PHP_FUNCTION(axis2_om_node_get_node_type);
+PHP_FUNCTION(axis2_om_node_get_build_status);
+PHP_METHOD(om_node, __construct);
+
+/****** om_text functions ************************/
+PHP_FUNCTION(axis2_om_text_serialize);
+PHP_FUNCTION(axis2_om_text_set_value);
+PHP_FUNCTION(axis2_om_text_get_value);
+PHP_METHOD(om_text, __construct);
+
+/***** om_stax_builder **************************/
+
+PHP_FUNCTION(axis2_om_stax_builder_next);
+PHP_FUNCTION(axis2_om_stax_builder_discard_current_element);
+PHP_METHOD(om_stax_builder, __construct);
+
+
+/******** processing instruction functions ******/
+PHP_FUNCTION(axis2_om_pi_set_value);
+PHP_FUNCTION(axis2_om_pi_set_target);
+PHP_FUNCTION(axis2_om_pi_get_value);
+PHP_FUNCTION(axis2_om_pi_getTarget);
+PHP_FUNCTION(axis2_om_pi_serialize);
+PHP_METHOD(om_pi, __construct);
+
+/******** om_output *****************************/
+PHP_METHOD(om_output, __construct);
 
 typedef enum {
 
-    OM_ELEMENT = 0,
-    OM_NODE,
-    OM_PI,
+    NODE_INVALID = 0,
+    OM_DOCUMENT,
+    OM_ELEMENT,
+    OM_DOCTYPE,
     OM_COMMENT,
+    OM_ATTRIBUTE,
+    OM_NAMESPACE,
+    OM_PI,
     OM_TEXT,
-    OM_DOCTYPE,
+    OM_NODE,
     AXIS2_XML_READER,
     AXIS2_XML_WRITER,
-    OM_DOCUMENT,
-    OM_STAX_BUILDER
+    OM_STAX_BUILDER,
+    AXIS2_QNAME,
+    OM_OUTPUT
 }om_obj_types;
 
+typedef enum{
+    OM_OBJ = 0,
+    OM_NODE_OBJ
+}axis2_obj_types;
 
 #endif /* AXIS2_FE_H */

Modified: webservices/axis2/trunk/c/bindings/php/axis2_properties.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/axis2_properties.h?rev=353971&r1=353970&r2=353971&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/axis2_properties.h (original)
+++ webservices/axis2/trunk/c/bindings/php/axis2_properties.h Sun Dec  4 19:49:16 2005
@@ -1,3 +1,21 @@
+/*
+  +----------------------------------------------------------------------+
+  | PHP Version 5                                                        |
+  +----------------------------------------------------------------------+
+  | Copyright (c) 1997-2004 The PHP Group                                |
+  +----------------------------------------------------------------------+
+  | This source file is subject to version 3.0 of the PHP license,       |
+  | that is bundled with this package in the file LICENSE, and is        |
+  | available through the world-wide-web at the following url:           |
+  | http://www.php.net/license/3_0.txt.                                  |
+  | If you did not receive a copy of the PHP license and are unable to   |
+  | obtain it through the world-wide-web, please send a note to          |
+  | license@php.net so we can mail you a copy immediately.               |
+  +----------------------------------------------------------------------+
+  | Author:                                                              |
+  +----------------------------------------------------------------------+
+*/
+
 #ifndef AXIS2_PROPERTIES_H
 #define AXIS2_PROPERTIES_H
 

Added: webservices/axis2/trunk/c/bindings/php/om_attribute.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_attribute.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_attribute.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_attribute.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,253 @@
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_attribute.h"
+
+zend_function_entry php_axis2_om_attribute_class_functions[]=
+{
+    PHP_FALIAS(getQname , axis2_om_attribute_get_qname, NULL)
+    PHP_FALIAS(serialize, axis2_om_attribute_serialize, NULL)
+    PHP_FALIAS(getLocalname , axis2_om_attribute_get_localname, NULL)
+    PHP_FALIAS(getValue , axis2_om_attribute_get_value, NULL)
+    PHP_FALIAS(setLocalname , axis2_om_attribute_set_localname, NULL)
+    PHP_FALIAS(setValue , axis2_om_attribute_set_value, NULL)
+    PHP_FALIAS(getNamespace , axis2_om_attribute_get_namespace, NULL)
+    PHP_FALIAS(setNamespace , axis2_om_attribute_set_namespace, NULL)
+    PHP_ME(om_attribute, __construct, NULL, ZEND_ACC_PUBLIC)
+    {NULL, NULL, NULL}
+};
+
+PHP_METHOD(om_attribute, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *lname = NULL;
+    char *val =  NULL;
+    int lname_len = 0;
+    int val_len = 0;
+    axis2_om_attribute_t *om_attr = NULL;
+    
+    axis2_object_ptr intern_ns = NULL;
+    om_object_ptr om_obj_ns = NULL;
+    zval *ns_obj = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OssO!",&object, axis2_om_attribute_class_entry ,&lname, &lname_len, &val, &val_len,
+                    &ns_obj,axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = OM_ATTRIBUTE;
+    om_obj->ptr = NULL;
+   
+    if(ns_obj)
+    {
+        AXIS2_GET_OBJ(om_obj_ns, ns_obj, om_object_ptr, intern_ns);
+        if(om_obj_ns && om_obj_ns->ptr)
+            ns = (axis2_om_namespace_t *)(om_obj_ns->ptr);
+    }
+            
+    om_attr = axis2_om_attribute_create(&env, lname, val, ns);
+    om_obj->ptr = om_attr;
+    intern->ptr = om_obj;        
+}
+
+PHP_FUNCTION(axis2_om_attribute_get_localname)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    char *lname = NULL;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    
+    if(attr)
+    {
+       lname = AXIS2_OM_ATTRIBUTE_GET_LOCALNAME(attr, &env);
+       RETURN_STRING(lname, 1);     
+    }
+    RETURN_NULL();
+}
+
+/* {{{ proto qname getValue */
+PHP_FUNCTION(axis2_om_attribute_get_value)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    char *value = NULL;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    
+    if(attr)
+    {
+       value = AXIS2_OM_ATTRIBUTE_GET_VALUE(attr, &env);
+       RETURN_STRING(value, 1);     
+    }
+    RETURN_NULL();
+}
+/* }}} end getValue */
+PHP_FUNCTION(axis2_om_attribute_get_namespace)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    zval *namespace_obj = NULL;  
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    
+    if(attr)
+    {
+       ns = AXIS2_OM_ATTRIBUTE_GET_NAMESPACE(attr, &env);
+       namespace_obj = php_axis2_create_om_object(ns, 
+                            OM_NAMESPACE, axis2_om_namespace_class_entry TSRMLS_CC);
+       RETURN_ZVAL(namespace_obj, NULL, NULL);                    
+    }
+    RETURN_NULL();
+}
+
+
+PHP_FUNCTION(axis2_om_attribute_get_qname)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    axis2_qname_t *qname = NULL;
+    zval *qname_obj = NULL;  
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    if(attr)
+    {
+       qname = AXIS2_OM_ATTRIBUTE_GET_QNAME(attr, &env);
+       qname_obj = php_axis2_create_om_object(qname, 
+                            AXIS2_QNAME, axis2_qname_class_entry TSRMLS_CC);
+       RETURN_ZVAL(qname_obj, NULL, NULL);                    
+    }
+    RETURN_NULL();
+}
+
+
+PHP_FUNCTION(axis2_om_attribute_set_localname)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *lname = NULL;
+    int lname_len = 0;
+    axis2_om_attribute_t *om_attr = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_om_attribute_class_entry ,&lname, &lname_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+   
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    if(om_obj)
+    {
+       om_attr = (axis2_om_attribute_t*)(om_obj->ptr);
+       AXIS2_OM_ATTRIBUTE_SET_LOCALNAME(om_attr, &env, lname);
+    }
+}
+PHP_FUNCTION(axis2_om_attribute_set_value)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *value = NULL;
+    int value_len = 0;
+    axis2_om_attribute_t *om_attr = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_om_attribute_class_entry ,&value, &value_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+   
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    if(om_obj)
+    {
+       om_attr = (axis2_om_attribute_t*)(om_obj->ptr);
+       AXIS2_OM_ATTRIBUTE_SET_VALUE(om_attr, &env, value);
+    }
+
+}
+
+PHP_FUNCTION(axis2_om_attribute_set_namespace)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr ns_intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    om_object_ptr om_ns_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    zval *ns_obj = NULL;  
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_attribute_class_entry ,&ns_obj, axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    AXIS2_GET_OBJ(om_ns_obj, ns_obj, om_object_ptr, ns_intern);
+    
+    attr = (axis2_om_attribute_t *)(om_obj->ptr);
+    ns   = (axis2_om_namespace_t *)(om_ns_obj->ptr);
+    
+    if(attr && ns)
+    {
+        AXIS2_OM_ATTRIBUTE_SET_NAMESPACE(attr, &env, ns);   
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_attribute_serialize)
+{
+}

Added: webservices/axis2/trunk/c/bindings/php/om_comment.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_comment.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_comment.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_comment.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,19 @@
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_comment.h"
+
+zend_function_entry php_axis2_om_comment_class_functions[]=
+{
+    PHP_FALIAS(serialize , axis2_om_comment_serialize, NULL)
+    PHP_FALIAS(getValue , axis2_om_comment_get_value, NULL)
+    PHP_FALIAS(setValue , axis2_om_comment_set_value, NULL)
+    PHP_ME(om_comment, __construct, NULL, ZEND_ACC_PUBLIC)
+    { NULL, NULL, NULL}
+};
+
+PHP_FUNCTION(axis2_om_comment_serialize){}
+PHP_FUNCTION(axis2_om_comment_get_value){}
+PHP_FUNCTION(axis2_om_comment_set_value){}
+PHP_METHOD(om_comment, __construct){}
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/om_doctype.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_doctype.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_doctype.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_doctype.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,5 @@
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_doctype.h"

Added: webservices/axis2/trunk/c/bindings/php/om_document.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_document.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_document.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_document.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,160 @@
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_document.h"
+
+zend_function_entry php_axis2_om_document_class_functions[] = 
+{
+    PHP_FALIAS(buildNext , axis2_om_document_build_next, NULL)
+    PHP_FALIAS(addChild , axis2_om_document_add_child, NULL)
+    PHP_FALIAS(getRootElement , axis2_om_document_get_root_element, NULL)
+    PHP_FALIAS(setRootElement , axis2_om_document_set_root_element, NULL)
+    PHP_FALIAS(buildAll , axis2_om_document_build_all, NULL)
+    PHP_ME(om_document, __construct, NULL, ZEND_ACC_PUBLIC)
+    { NULL, NULL, NULL}    
+};
+
+
+PHP_METHOD(om_document, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_root = NULL;
+    axis2_object_ptr intern_builder = NULL;
+   
+    
+    om_object_ptr om_obj = NULL;
+    om_node_ptr node_obj_root = NULL;
+    om_object_ptr om_obj_builder = NULL;
+    
+    
+    zval *object = NULL;
+    zval *object_root = NULL;
+    zval *object_builder = NULL;
+    
+    
+    axis2_om_stax_builder_t *builder = NULL;
+    axis2_om_node_t *root = NULL;
+    axis2_om_document_t *document = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO!O!",&object, axis2_om_document_class_entry, &object_root,
+             axis2_om_node_class_entry, &object_builder, 
+             axis2_om_stax_builder_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(om_obj_builder, object_builder, om_object_ptr, intern_builder);
+    
+    AXIS2_GET_OBJ(node_obj_root, object_root, om_node_ptr, intern_root);
+    
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = OM_DOCUMENT;
+    om_obj->ptr = NULL;
+    
+    builder = (axis2_om_stax_builder_t *)(om_obj_builder->ptr);
+    root    = (axis2_om_node_t *)(node_obj_root->ptr);
+    
+    document = axis2_om_document_create(&env, root, builder);
+    om_obj->ptr = document;
+    intern->ptr = om_obj; 
+}
+
+PHP_FUNCTION(axis2_om_document_build_next)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_node = NULL;
+    
+    
+    om_object_ptr om_obj = NULL;
+    om_node_ptr node_obj = NULL;
+        
+    zval *object = NULL;
+    zval *object_node = NULL;
+    
+    
+    axis2_om_node_t *node = NULL;
+    axis2_om_document_t *document = NULL;
+    axis2_env_t *env = NULL; 
+    int node_type = 0;   
+    zend_class_entry *ce_node = NULL;
+
+    AXIS2_GET_THIS(object);
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    env = php_axis2_get_env();
+    
+    document = (axis2_om_document_t *)(om_obj->ptr);
+    
+    
+    
+    if(document)
+    {
+        node = AXIS2_OM_DOCUMENT_BUILD_NEXT(document, &env);  
+        if(node)
+        {
+            node_type = AXIS2_OM_NODE_GET_NODE_TYPE(node, &env);
+            ce_node = php_axis2_get_class_type(node_type);
+            object_node = php_axis2_create_om_node_object(node, node_type, ce_node TSRMLS_CC);
+            RETURN_ZVAL(object_node, NULL, NULL);        
+        }    
+    }    
+    RETURN_NULL();    
+}
+PHP_FUNCTION(axis2_om_document_add_child)
+{
+     php_printf("not implemented yet");
+}
+PHP_FUNCTION(axis2_om_document_get_root_element)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_node = NULL;
+    
+    
+    om_object_ptr om_obj = NULL;
+    om_node_ptr node_obj = NULL;
+        
+    zval *object = NULL;
+    zval *object_node = NULL;
+    
+    
+    axis2_om_node_t *node = NULL;
+    axis2_om_document_t *document = NULL;
+    axis2_env_t *env = NULL; 
+    int node_type = 0;   
+    zend_class_entry *ce_node = NULL;
+
+    AXIS2_GET_THIS(object);
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    env = php_axis2_get_env();
+    
+    document = (axis2_om_document_t *)(om_obj->ptr);
+    
+    
+    
+    if(document)
+    {
+        node = AXIS2_OM_DOCUMENT_GET_ROOT_ELEMENT(document, &env);  
+        if(node)
+        {
+            node_type = AXIS2_OM_NODE_GET_NODE_TYPE(node, &env);
+            ce_node = php_axis2_get_class_type(node_type);
+            object_node = php_axis2_create_om_node_object(node, node_type, ce_node TSRMLS_CC);
+            RETURN_ZVAL(object_node, NULL, NULL);        
+        }    
+    }    
+    RETURN_NULL();    
+}
+
+PHP_FUNCTION(axis2_om_document_set_root_element)
+{
+    php_printf("not implemented yet");
+}
+PHP_FUNCTION(axis2_om_document_build_all)
+{
+ php_printf("not implemented yet");
+}

Added: webservices/axis2/trunk/c/bindings/php/om_element.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_element.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_element.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_element.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,306 @@
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_element.h"
+
+zend_function_entry php_axis2_om_element_class_functions[]=
+{
+    PHP_FALIAS(findNamespace , axis2_om_element_find_namespace, NULL)
+    PHP_FALIAS(declareNamespace , axis2_om_element_declare_namespace, NULL)
+    PHP_FALIAS(findNamespaceWithQname , axis2_om_element_find_namespace_with_qname, NULL)
+    PHP_FALIAS(addAttribute , axis2_om_element_add_attribute, NULL)
+    PHP_FALIAS(getAttribute , axis2_om_element_get_attribute, NULL)
+ /*   PHP_FALIAS(serialize , axis2_om_element_serialize, NULL) */
+    PHP_FALIAS(findDeclaredNamespace , axis2_om_element_find_declared_namespace, NULL)
+    PHP_FALIAS(getLocalname , axis2_om_element_get_localname, NULL)
+    PHP_FALIAS(getNamespace , axis2_om_element_get_namespace, NULL)
+    PHP_FALIAS(setNamespace , axis2_om_element_set_namespace, NULL)
+    PHP_FALIAS(setLocalname , axis2_om_element_set_localname, NULL)
+    PHP_ME(om_element, __construct, NULL, ZEND_ACC_PUBLIC)
+{NULL, NULL, NULL}
+};
+
+PHP_METHOD(om_element, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_parent = NULL;
+    axis2_object_ptr intern_ns = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_node_ptr node_obj_parent = NULL;
+    om_object_ptr om_obj_ns = NULL;
+    
+    zval *object = NULL;
+    zval *object_parent = NULL;
+    zval *object_ns = NULL;
+    
+    axis2_env_t *env = NULL;
+    char *lname = NULL;
+    int lname_len = 0;
+    char *n = NULL;
+
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_node_t *node_parent = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO!sO!",&object, axis2_om_element_class_entry, &object_parent,
+                    axis2_om_node_class_entry, &lname, &lname_len,
+                    &object_ns, axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    node_obj = (om_node_ptr)emalloc(sizeof(om_node_t));
+    node_obj->builder = NULL;
+    node_obj->doc = NULL;
+    node_obj->node_type = OM_ELEMENT;
+    
+    if(object_parent)
+    {
+        AXIS2_GET_OBJ(node_obj_parent, object_parent, om_node_ptr, intern_parent);
+        if(node_obj_parent && node_obj_parent->ptr)
+            node_parent = (axis2_om_node_t *)(node_obj_parent->ptr);
+    }
+    if(object_ns)
+    {
+        AXIS2_GET_OBJ(om_obj_ns, object_ns, om_object_ptr, intern_ns);
+        if(om_obj_ns && om_obj_ns->ptr)
+            ns = (axis2_om_namespace_t *)(om_obj_ns->ptr);
+    }
+    
+    om_element = axis2_om_element_create(&env, node_parent, lname, ns, &node);
+    node_obj->ptr = node;
+    intern->obj_type = OM_NODE_OBJ;
+    intern->ptr = node_obj;
+}
+
+
+PHP_FUNCTION(axis2_om_element_get_localname)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    
+    zval *object = NULL;
+    
+    axis2_env_t *env = NULL;
+    char *localname = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+
+    AXIS2_GET_THIS(object);
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+   
+    localname = AXIS2_OM_ELEMENT_GET_LOCALNAME(om_element, &env);
+    if(localname)
+    {
+        RETURN_STRING(localname, 1);
+    }
+    RETURN_NULL();
+   
+}
+PHP_FUNCTION(axis2_om_element_get_namespace)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    zval *object = NULL;
+    zval *object_ns = NULL;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_namespace_t *ns = NULL;
+   
+    AXIS2_GET_THIS(object);
+    env = php_axis2_get_env();
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+   
+    ns = AXIS2_OM_ELEMENT_GET_NAMESPACE(om_element, &env);
+    if(ns)
+    {
+        object_ns = php_axis2_create_om_object(ns, OM_OBJ, axis2_om_namespace_class_entry TSRMLS_CC);         
+        RETURN_ZVAL(object_ns, NULL, NULL);
+    }
+    RETURN_NULL();
+}
+
+
+PHP_FUNCTION(axis2_om_element_get_attribute)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_qname = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_object_ptr qname_obj = NULL;
+    
+    zval *object = NULL;
+    zval *object_attr = NULL;
+    zval *object_qname = NULL;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_attribute_t *attr = NULL;
+    axis2_qname_t *qname = NULL;
+   
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_element_class_entry, &object_qname,
+                    axis2_qname_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    AXIS2_GET_OBJ(qname_obj, object_qname, om_object_ptr, intern_qname);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+    qname = (axis2_qname_t *)(qname_obj->ptr);
+    
+    attr = AXIS2_OM_ELEMENT_GET_ATTRIBUTE(om_element, &env, qname);
+    if(attr)
+    {
+        object_attr = php_axis2_create_om_object(attr, OM_OBJ, axis2_om_attribute_class_entry TSRMLS_CC);         
+        RETURN_ZVAL(object_attr, NULL, NULL);
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_element_add_attribute)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_attr = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_object_ptr attr_obj = NULL;
+    
+    zval *object = NULL;
+    zval *object_attr = NULL;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_attribute_t *attr = NULL;
+   
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_element_class_entry, &object_attr,
+                    axis2_om_attribute_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    AXIS2_GET_OBJ(attr_obj, object_attr, om_object_ptr, intern_attr);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+    attr = (axis2_om_attribute_t *)(attr_obj->ptr);
+    if(attr)
+    {
+        AXIS2_OM_ELEMENT_ADD_ATTRIBUTE(om_element, &env, attr);
+    }
+}
+
+
+PHP_FUNCTION(axis2_om_element_set_namespace)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_ns = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_object_ptr om_obj = NULL;
+    
+    zval *object = NULL;
+    zval *object_ns = NULL;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_namespace_t *ns = NULL;
+   
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_element_class_entry, &object_ns,
+                    axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    AXIS2_GET_OBJ(om_obj, object_ns , om_object_ptr, intern_ns);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+    ns  = (axis2_om_namespace_t *)(om_obj->ptr);
+    if(ns)
+    {
+        AXIS2_OM_ELEMENT_SET_NAMESPACE(om_element, &env, ns, node);
+    }
+}
+
+
+PHP_FUNCTION(axis2_om_element_set_localname)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    zval *object = NULL;
+
+    char *localname = NULL;
+    int lnamelen = 0;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_element_t *om_element = NULL;
+    axis2_om_node_t *node = NULL;
+   
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_om_element_class_entry, &localname,
+                    &lnamelen) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_element = (axis2_om_element_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+    if(om_element)
+    {
+        AXIS2_OM_ELEMENT_SET_LOCALNAME(om_element, &env, localname);
+    }
+}
+
+
+PHP_FUNCTION(axis2_om_element_serialize)
+{
+
+}
+
+
+PHP_FUNCTION(axis2_om_element_find_namespace)
+{}
+PHP_FUNCTION(axis2_om_element_declare_namespace)
+{}
+
+PHP_FUNCTION(axis2_om_element_find_namespace_with_qname)
+{}
+PHP_FUNCTION(axis2_om_element_find_declared_namespace){}

Added: webservices/axis2/trunk/c/bindings/php/om_namespace.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_namespace.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_namespace.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_namespace.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,149 @@
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_namespace.h"
+
+zend_function_entry php_axis2_om_namespace_class_functions[]=
+{
+    PHP_FALIAS(equals , axis2_om_namespace_equals, NULL)
+    PHP_FALIAS(serialize , axis2_om_namespace_serialize, NULL)
+    PHP_FALIAS(getUri , axis2_om_namespace_get_uri, NULL)
+    PHP_FALIAS(getPrefix , axis2_om_namespace_get_prefix, NULL)
+    PHP_ME(om_namespace, __construct, NULL, ZEND_ACC_PUBLIC)
+    {NULL, NULL, NULL} 
+};
+
+/* {{{ om_namespace __construct [ string, string ] */
+PHP_METHOD(om_namespace, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    char *ns_uri = NULL;
+    char *prefix = NULL;
+    int urilen = 0;
+    int prefixlen = 0;
+    axis2_om_namespace_t *om_namespace = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Oss",&object, axis2_om_namespace_class_entry ,&ns_uri, &urilen, &prefix, &prefixlen) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+  
+    env = php_axis2_get_env();
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = OM_NAMESPACE;
+    om_obj->ptr = NULL;
+    
+    om_namespace = axis2_om_namespace_create (&env, ns_uri, prefix);
+    if(!om_namespace)
+    {
+        php_error_docref(NULL TSRMLS_CC, E_OUTOFMEMORY, " namespace create failure ");
+    }
+    
+    om_obj->ptr = om_namespace;
+    
+    intern->obj_type = OM_OBJ;
+    intern->ptr = om_obj;
+}
+
+/* }}} end om_namespace __construct */
+
+/* {{{ om_namespace equals */
+PHP_FUNCTION(axis2_om_namespace_equals)
+{
+    axis2_object_ptr intern= NULL;
+    axis2_object_ptr intern1 = NULL;
+    zval *object = NULL;
+    zval *ns_obj = NULL;
+    om_object_ptr this_ns = NULL;
+    om_object_ptr ns_to_cmp = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_namespace_t *ns1 = NULL;
+    axis2_om_namespace_t *ns2 = NULL;
+    axis2_bool_t *equals = AXIS2_FALSE;
+    
+    env = php_axis2_get_env();
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_namespace_class_entry , &ns_obj, axis2_om_namespace_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    } 
+    
+    AXIS2_GET_OBJ(this_ns, object, om_object_ptr, intern);
+    AXIS2_GET_OBJ(ns_to_cmp, ns_obj, om_object_ptr, intern1);
+    
+    ns1 = (axis2_om_namespace_t *)(this_ns->ptr);
+    ns2 = (axis2_om_namespace_t *)(ns_to_cmp->ptr);
+    
+    equals = AXIS2_OM_NAMESPACE_EQUALS(ns1, &env, ns2);
+    
+    if(equals == AXIS2_TRUE)
+    {
+        RETURN_BOOL(1);
+    }
+    if(equals == AXIS2_FALSE) 
+    {
+        RETURN_BOOL(0);
+    }
+}
+/* }}} end om_namespace equals */
+
+
+
+PHP_FUNCTION(axis2_om_namespace_get_uri)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    char *uri;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    ns = (axis2_om_namespace_t *)(om_obj->ptr);
+    
+    if(ns)
+    {
+       uri = AXIS2_OM_NAMESPACE_GET_URI(ns, &env);
+       RETURN_STRING(uri, 1);     
+    }
+    RETURN_NULL();
+}
+
+
+PHP_FUNCTION(axis2_om_namespace_get_prefix)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_namespace_t *ns = NULL;
+    char *prefix;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    ns = (axis2_om_namespace_t *)(om_obj->ptr);
+    
+    if(ns)
+    {
+       prefix = AXIS2_OM_NAMESPACE_GET_PREFIX(ns, &env);
+       RETURN_STRING(prefix, 1);     
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_namespace_serialize){}

Added: webservices/axis2/trunk/c/bindings/php/om_node.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_node.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_node.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_node.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,403 @@
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_element.h"
+
+zend_function_entry php_axis2_om_node_class_functions[] =
+{
+    PHP_FALIAS(addChild , axis2_om_node_add_child, NULL)
+    PHP_FALIAS(detach , axis2_om_node_detach, NULL)
+    PHP_FALIAS(insertSiblingAfter , axis2_om_node_insert_sibling_after, NULL)
+    PHP_FALIAS(insertSiblingBefore , axis2_om_node_insert_sibling_before, NULL)
+    PHP_FALIAS(setParent , axis2_om_node_set_parent, NULL)
+    PHP_FALIAS(serialize , axis2_om_node_serialize, NULL)
+    PHP_FALIAS(getParent , axis2_om_node_get_parent, NULL)
+    PHP_FALIAS(getFirstChild , axis2_om_node_get_first_child, NULL)
+    PHP_FALIAS(getLastChild , axis2_om_node_get_last_child, NULL)
+    PHP_FALIAS(getPreviousSibling , axis2_om_node_get_previous_sibling, NULL)
+    PHP_FALIAS(getNextSibling , axis2_om_node_get_next_sibling, NULL)
+    PHP_FALIAS(getNodeType , axis2_om_node_get_node_type, NULL)
+    PHP_FALIAS(isComplete , axis2_om_node_get_build_status, NULL)
+    PHP_ME(om_node, __construct, NULL, ZEND_ACC_PRIVATE)
+    { NULL, NULL, NULL}
+};
+/*
+static zend_class_entry* php_axis2_get_class_type(int node_type)
+{
+    zend_class_entry *ce = NULL;
+    switch(node_type)
+    {
+        case OM_ELEMENT:
+            ce = axis2_om_element_class_entry;
+            break;
+        case OM_TEXT: 
+            ce = axis2_om_text_class_entry;
+            break;
+        case OM_PI:
+            ce = axis2_om_pi_class_entry;
+            break;
+        case OM_COMMENT:
+            ce = axis2_om_comment_class_entry;            
+            break;
+        default:
+            ce = NULL;
+            break;    
+    }
+    return ce;
+}
+*/
+PHP_METHOD(om_node, __construct)
+{
+
+}
+
+/* {{{ proto void Axis2OMNode::addChild */
+PHP_FUNCTION(axis2_om_node_add_child)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_child = NULL;
+    
+    zval *object = NULL;
+    zval *obj_child = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_node_ptr node_obj_child = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *child   = NULL;
+    axis2_env_t *env = NULL;
+     
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_node_class_entry ,&obj_child,axis2_om_node_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+ 
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    AXIS2_GET_OBJ(node_obj_child, obj_child, om_node_ptr, intern_child);
+    
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    child = (axis2_om_node_t *)(node_obj_child->ptr);
+    /* this should be fixed */
+    AXIS2_OM_NODE_ADD_CHILD(child, &env, om_node);    
+    
+}
+/* }}} */
+
+PHP_FUNCTION(axis2_om_node_detach)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_node_ptr node_obj = NULL;
+    axis2_om_node_t *om_node = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_node_class_entry ) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+ 
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    AXIS2_OM_NODE_DETACH(om_node, &env);    
+}
+
+PHP_FUNCTION(axis2_om_node_set_parent)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_parent = NULL;
+    
+    zval *object = NULL;
+    zval *obj_parent = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_node_ptr node_obj_parent = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *parent   = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_node_class_entry ,&obj_parent,axis2_om_node_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+ 
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    AXIS2_GET_OBJ(node_obj_parent, obj_parent, om_node_ptr, intern_parent);
+    
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    parent = (axis2_om_node_t *)(node_obj_parent->ptr);
+    AXIS2_OM_NODE_SET_PARENT(om_node, &env, parent);    
+}
+
+PHP_FUNCTION(axis2_om_node_get_node_type)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_node_ptr node_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_node_t *om_node = NULL;
+    int node_type = 0;
+        
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    node_type = AXIS2_OM_NODE_GET_NODE_TYPE(om_node, &env);
+    RETURN_LONG(node_type);
+}
+
+PHP_FUNCTION(axis2_om_node_get_build_status)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_node_ptr node_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_om_node_t *om_node = NULL;
+    axis2_bool_t status = AXIS2_FALSE;
+        
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    status = AXIS2_OM_NODE_GET_BUILD_STATUS(om_node, &env);
+    RETURN_BOOL(status);
+}
+
+PHP_FUNCTION(axis2_om_node_get_parent)
+{
+    zend_class_entry *parent_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_parent = NULL;
+    
+    zval *object = NULL;
+    zval *obj_parent = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *parent   = NULL;
+    axis2_env_t *env = NULL;
+    int parent_node_type = 0;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    parent = AXIS2_OM_NODE_GET_PARENT(om_node, &env);
+    if(parent)
+    {
+        parent_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(parent, &env);
+        parent_ce = php_axis2_get_class_type(parent_node_type);
+        obj_parent = php_axis2_create_om_node_object(parent, 
+                        parent_node_type, parent_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_parent, NULL, NULL);    
+    }
+    RETURN_NULL();
+}
+PHP_FUNCTION(axis2_om_node_get_first_child)
+{
+    zend_class_entry *child_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_child = NULL;
+    
+    zval *object = NULL;
+    zval *obj_child = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *child   = NULL;
+    axis2_env_t *env = NULL;
+    int child_node_type = 0;
+    axis2_om_element_t *e = NULL;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    
+    child = AXIS2_OM_NODE_GET_FIRST_CHILD(om_node, &env);
+    if(child)
+    {
+        child_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(child, &env);
+        child_ce = php_axis2_get_class_type(child_node_type);
+        obj_child = php_axis2_create_om_node_object(child, 
+                        child_node_type, child_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_child, NULL, NULL);   
+        
+    }
+    RETURN_NULL();
+    
+}
+
+PHP_FUNCTION(axis2_om_node_get_last_child)
+{
+    zend_class_entry *child_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_child = NULL;
+    
+    zval *object = NULL;
+    zval *obj_child = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *child   = NULL;
+    axis2_env_t *env = NULL;
+    int child_node_type = 0;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    child = AXIS2_OM_NODE_GET_LAST_CHILD(om_node, &env);
+    if(child)
+    {
+        child_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(child, &env);
+        child_ce = php_axis2_get_class_type(child_node_type);
+        obj_child = php_axis2_create_om_node_object(child, 
+                        child_node_type, child_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_child, NULL, NULL);    
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_node_get_previous_sibling)
+{
+    zend_class_entry *sibling_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_sibling = NULL;
+    
+    zval *object = NULL;
+    zval *obj_sibling = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *sibling   = NULL;
+    axis2_env_t *env = NULL;
+    int sibling_node_type = 0;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    sibling = AXIS2_OM_NODE_GET_PREVIOUS_SIBLING(om_node, &env);
+    if(sibling)
+    {
+        sibling_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(sibling, &env);
+        sibling_ce = php_axis2_get_class_type(sibling_node_type);
+        obj_sibling = php_axis2_create_om_node_object(sibling, 
+                        sibling_node_type, sibling_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_sibling, NULL, NULL);    
+    }
+    RETURN_NULL();
+}
+
+PHP_FUNCTION(axis2_om_node_get_next_sibling)
+{
+    zend_class_entry *sibling_ce = NULL;
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_sibling = NULL;
+    
+    zval *object = NULL;
+    zval *obj_sibling = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    
+    axis2_om_node_t *om_node = NULL;
+    axis2_om_node_t *sibling   = NULL;
+    axis2_env_t *env = NULL;
+    int sibling_node_type = 0;
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+       
+    om_node = (axis2_om_node_t *)(node_obj->ptr);
+    sibling = AXIS2_OM_NODE_GET_NEXT_SIBLING(om_node, &env);
+    if(sibling)
+    {
+        sibling_node_type = AXIS2_OM_NODE_GET_NODE_TYPE(sibling, &env);
+        sibling_ce = php_axis2_get_class_type(sibling_node_type);
+        obj_sibling = php_axis2_create_om_node_object(sibling, 
+                        sibling_node_type, sibling_ce TSRMLS_CC);
+        RETURN_ZVAL(obj_sibling, NULL, NULL);    
+    }
+    RETURN_NULL();
+}
+PHP_FUNCTION(axis2_om_node_serialize)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_output = NULL;
+    
+    zval *object = NULL;
+    zval *object_output = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_object_ptr om_obj_output = NULL;
+    
+    axis2_om_output_t *output = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_node_class_entry,
+             &object_output , axis2_om_output_class_entry ) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    AXIS2_GET_OBJ(om_obj_output, object_output, om_object_ptr, intern_output);
+    
+    node = (axis2_om_node_t *)(node_obj->ptr);
+    output = (axis2_om_output_t *)(om_obj_output->ptr);
+    
+    AXIS2_OM_NODE_SERIALIZE(node, &env, output);
+}
+PHP_FUNCTION(axis2_om_node_insert_sibling_after)
+{
+    php_printf("not implemented yet");
+}
+PHP_FUNCTION(axis2_om_node_insert_sibling_before)
+{
+    php_printf("not implemented yet");
+}
+
+
+

Added: webservices/axis2/trunk/c/bindings/php/om_output.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_output.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_output.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_output.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,49 @@
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_output.h"
+#include "axis2_xml_writer.h"
+
+extern zend_function_entry php_axis2_om_output_class_functions[] =
+{
+    PHP_ME(om_output, __construct, NULL, ZEND_ACC_PUBLIC)
+    { NULL, NULL, NULL}
+};
+
+PHP_METHOD(om_output, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_writer = NULL;
+    
+    zval *object = NULL;
+    zval *object_writer = NULL;
+    
+    om_object_ptr om_obj = NULL;
+    om_object_ptr om_obj_writer = NULL;
+    
+    axis2_om_output_t *om_output = NULL;
+    axis2_xml_writer_t *writer = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_output_class_entry,
+                 &object_writer, axis2_xml_writer_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+
+    env = php_axis2_get_env();    
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = OM_OUTPUT;
+    om_obj->ptr = NULL;   
+    
+    AXIS2_GET_OBJ(om_obj_writer, object_writer, om_object_ptr, intern_writer);
+    writer = (axis2_xml_writer_t *)(om_obj_writer->ptr);
+       
+    om_output = axis2_om_output_create(&env, writer);
+    om_obj->ptr = om_output;
+    
+    intern->obj_type = OM_OBJ;
+    intern->ptr = om_obj;
+}
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/om_processing_instruction.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_processing_instruction.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_processing_instruction.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_processing_instruction.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,24 @@
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_processing_instruction.h"
+
+zend_function_entry axis2_om_pi_class_functions[] =
+{
+    PHP_FALIAS( , axis2_om_pi_set_value, NULL)
+    PHP_FALIAS( , axis2_om_pi_set_target, NULL)
+    PHP_FALIAS( , axis2_om_pi_get_value, NULL)
+    PHP_FALIAS( , axis2_om_pi_getTarget, NULL)
+    PHP_FALIAS( , axis2_om_pi_serialize, NULL)
+    PHP_ME(om_pi, __construct, NULL, ZEND_ACC_PUBLIC)
+    { NULL, NULL, NULL}
+};
+
+
+
+PHP_FUNCTION(axis2_om_pi_set_value){}
+PHP_FUNCTION(axis2_om_pi_set_target){}
+PHP_FUNCTION(axis2_om_pi_get_value){}
+PHP_FUNCTION(axis2_om_pi_getTarget){}
+PHP_FUNCTION(axis2_om_pi_serialize){}
+PHP_METHOD(om_pi, __construct){}
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/om_stax_builder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_stax_builder.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_stax_builder.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_stax_builder.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,100 @@
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_stax_builder.h"
+
+zend_function_entry php_axis2_om_stax_builder_class_functions[] =
+{
+    PHP_FALIAS(next , axis2_om_stax_builder_next, NULL)
+    PHP_FALIAS(discard , axis2_om_stax_builder_discard_current_element, NULL)
+    PHP_ME(om_stax_builder, __construct, NULL, ZEND_ACC_PUBLIC)
+    { NULL, NULL, NULL}
+};
+
+
+
+PHP_METHOD(om_stax_builder, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_reader = NULL;
+    
+    om_object_ptr om_obj = NULL;
+    om_object_ptr om_obj_reader = NULL;
+    
+    zval *object = NULL;
+    zval *object_reader = NULL;
+    
+    axis2_om_stax_builder_t *builder = NULL;
+    axis2_xml_reader_t *reader = NULL;
+    axis2_env_t *env = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_om_stax_builder_class_entry, &object_reader,
+                    axis2_xml_reader_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_OBJ(om_obj_reader, object_reader, om_object_ptr, intern_reader);
+    
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = OM_STAX_BUILDER;
+    om_obj->ptr = NULL;
+    reader  = (axis2_xml_reader_t *)(om_obj_reader->ptr);
+        
+    builder = axis2_om_stax_builder_create(&env, reader);
+    
+    om_obj->ptr = builder;
+    
+    intern->ptr = om_obj; 
+}
+
+PHP_FUNCTION(axis2_om_stax_builder_next)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_node = NULL;
+    
+    om_object_ptr om_obj = NULL;
+    om_node_ptr node_obj = NULL;
+    
+    zval *object = NULL;
+    zval *object_node = NULL;
+    
+    axis2_om_stax_builder_t *builder = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_env_t *env = NULL; 
+    int node_type = 0;   
+    zend_class_entry *ce_node = NULL;
+
+    AXIS2_GET_THIS(object);
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    env = php_axis2_get_env();
+    
+    builder = (axis2_om_stax_builder_t *)(om_obj->ptr);
+
+    if(builder)
+    {
+        node = AXIS2_OM_STAX_BUILDER_NEXT(builder, &env);
+        /*
+        if(node)
+        {
+            node_type = AXIS2_OM_NODE_GET_NODE_TYPE(node, &env);
+            ce_node = php_axis2_get_class_type(node_type);
+            object_node = php_axis2_create_om_node_object(node, node_type, ce_node TSRMLS_CC);
+            RETURN_ZVAL(object_node, NULL, NULL);        
+        }
+        */     
+    }
+    
+      
+    RETURN_NULL();    
+}
+
+PHP_FUNCTION(axis2_om_stax_builder_discard_current_element)
+{
+     php_printf("not implemented yet");
+}

Added: webservices/axis2/trunk/c/bindings/php/om_text.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/om_text.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/om_text.c (added)
+++ webservices/axis2/trunk/c/bindings/php/om_text.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,144 @@
+/*
+  +----------------------------------------------------------------------+
+  | PHP Version 5                                                        |
+  +----------------------------------------------------------------------+
+  | Copyright (c) 1997-2004 The PHP Group                                |
+  +----------------------------------------------------------------------+
+  | This source file is subject to version 3.0 of the PHP license,       |
+  | that is bundled with this package in the file LICENSE, and is        |
+  | available through the world-wide-web at the following url:           |
+  | http://www.php.net/license/3_0.txt.                                  |
+  | If you did not receive a copy of the PHP license and are unable to   |
+  | obtain it through the world-wide-web, please send a note to          |
+  | license@php.net so we can mail you a copy immediately.               |
+  +----------------------------------------------------------------------+
+  | Author:                                                              |
+  +----------------------------------------------------------------------+
+*/
+
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_om_node.h"
+#include "axis2_om_text.h"
+
+zend_function_entry php_axis2_om_text_class_functions[]  = 
+{
+    PHP_FALIAS(getValue, axis2_om_text_get_value, NULL)
+    PHP_FALIAS(setValue, axis2_om_text_get_value, NULL)
+ /*   PHP_FALIAS(serialize, axis2_om_text_serialize, NULL) */
+    PHP_ME(om_text, __construct, NULL, ZEND_ACC_PUBLIC)    
+    { NULL, NULL, NULL}
+};
+
+
+PHP_METHOD(om_text, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    axis2_object_ptr intern_parent = NULL;
+    
+    om_node_ptr node_obj = NULL;
+    om_node_ptr node_obj_parent = NULL;
+    
+    zval *object = NULL;
+    zval *object_parent = NULL;
+    
+    axis2_env_t *env = NULL;
+    char *value = NULL;
+    int value_len = 0;
+
+    axis2_om_text_t *om_text = NULL;
+    axis2_om_node_t *node = NULL;
+    axis2_om_node_t *node_parent = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO!s",&object, axis2_om_text_class_entry, &object_parent,
+                    axis2_om_node_class_entry, &value, &value_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    node_obj = (om_node_ptr)emalloc(sizeof(om_node_t));
+    node_obj->builder = NULL;
+    node_obj->doc = NULL;
+    node_obj->node_type = OM_ELEMENT;
+    
+    if(object_parent)
+    {
+        AXIS2_GET_OBJ(node_obj_parent, object_parent, om_node_ptr, intern_parent);
+        if(node_obj_parent && node_obj_parent->ptr)
+            node_parent = (axis2_om_node_t *)(node_obj_parent->ptr);
+    }
+    
+    om_text = axis2_om_text_create(&env, node_parent, value, &node);
+    node_obj->ptr = node;
+    intern->obj_type = OM_NODE_OBJ;
+    intern->ptr = node_obj;
+}
+
+PHP_FUNCTION(axis2_om_text_set_value)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    zval *object = NULL;
+
+    char *value = NULL;
+    int value_len = 0;
+    
+    axis2_env_t *env = NULL;
+    axis2_om_text_t *om_text = NULL;
+    axis2_om_node_t *node = NULL;
+   
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_om_text_class_entry, &value,
+                    &value_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_text = (axis2_om_text_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+    if(om_text)
+    {
+        AXIS2_OM_TEXT_SET_VALUE(om_text, &env, value);
+    }
+}
+
+
+PHP_FUNCTION(axis2_om_text_get_value)
+{
+    axis2_object_ptr intern = NULL;
+    om_node_ptr node_obj = NULL;
+    
+    zval *object = NULL;
+    
+    axis2_env_t *env = NULL;
+    char *value = NULL;
+    axis2_om_text_t *om_text = NULL;
+    axis2_om_node_t *node = NULL;
+
+    AXIS2_GET_THIS(object);
+    
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_OBJ(node_obj, object, om_node_ptr, intern);
+    node = (axis2_om_node_t*)(node_obj->ptr);
+    om_text = (axis2_om_text_t*)AXIS2_OM_NODE_GET_DATA_ELEMENT(node , &env);
+   
+    value = AXIS2_OM_TEXT_GET_VALUE(om_text, &env);
+    if(value)
+    {
+        RETURN_STRING(value, 1);
+    }
+    RETURN_NULL();
+}
+PHP_FUNCTION(axis2_om_text_serialize)
+{
+
+}
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/output.php
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/output.php?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/output.php (added)
+++ webservices/axis2/trunk/c/bindings/php/output.php Sun Dec  4 19:49:16 2005
@@ -0,0 +1,18 @@
+<?php
+$writer = new Axis2XMLWriter(NULL,1,0);
+$output = new Axis2OMOutput($writer);
+$ns1= new Axis2OMNamespace("http://test.org","testprefix");
+$element = new Axis2OMElement(NULL,"ThisIsATest",$ns1);
+$attr1 = new Axis2OMAttribute("key","value",NULL);
+$element1 = new Axis2OMElement(NULL,"Test1",NULL);
+$element1->addAttribute($attr1);
+$text = new Axis2OMText(NULL,"This is text");
+$element->addChild($text);
+
+
+$element->addChild($element1);
+$element->serialize($output);
+echo $writer->getXML();
+
+
+?>
\ No newline at end of file

Modified: webservices/axis2/trunk/c/bindings/php/php_axis2.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/php_axis2.h?rev=353971&r1=353970&r2=353971&view=diff
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/php_axis2.h (original)
+++ webservices/axis2/trunk/c/bindings/php/php_axis2.h Sun Dec  4 19:49:16 2005
@@ -69,7 +69,11 @@
 void php_axis2_objects_free_storage(void *object TSRMLS_DC);
 void php_axis2_destroy_env();
 axis2_env_t *php_axis2_get_env();
-
+zval *php_axis2_create_om_object(void* obj, int obj_type, zend_class_entry *class_type TSRMLS_DC);
+zval *php_axis2_create_om_node_object(void* obj,int node_type, zend_class_entry *class_type  TSRMLS_DC);
+void php_axis2_set_object(void *obj,int obj_type, zval *wrapper_in TSRMLS_DC); 
+char* php_axis2_stream_to_buffer(php_stream *stream TSRMLS_DC);
+zend_class_entry* php_axis2_get_class_type(int node_type);
 /* 
   	Declare any global variables you may need between the BEGIN
 	and END macros here:     */

Added: webservices/axis2/trunk/c/bindings/php/qname.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/qname.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/qname.c (added)
+++ webservices/axis2/trunk/c/bindings/php/qname.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,178 @@
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_qname.h"
+
+zend_function_entry php_axis2_qname_class_functions[]=
+{
+    PHP_FALIAS(equals , axis2_qname_equals, NULL )
+    PHP_FALIAS(clone , axis2_qname_clone, NULL )
+    PHP_FALIAS(getUri , axis2_qname_get_uri, NULL )
+    PHP_FALIAS(getPrefix , axis2_qname_get_prefix, NULL )
+    PHP_FALIAS(getLocalpart , axis2_qname_get_localpart, NULL )
+    PHP_ME(axis2_qname,__construct, NULL, ZEND_ACC_PUBLIC)
+    {NULL , NULL, NULL}
+};
+/* {{{ proto void Axis2Qname::__construct 
+        (string localpart,[string namespaceuri], string prefix) 
+*/
+PHP_METHOD(axis2_qname, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    char *lpart = NULL;
+    int lpart_len = 0;
+    char *ns_uri = NULL;
+    int urilen = 0;
+    char *prefix = NULL;
+    int prefixlen = 0;
+    axis2_qname_t *qname = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+            getThis(), "Oss!s",&object, axis2_qname_class_entry ,&lpart, &lpart_len, &ns_uri, &urilen,
+                    &prefix, &prefixlen) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    om_obj->obj_type = AXIS2_QNAME;
+    
+    qname = axis2_qname_create(&env, lpart, ns_uri, prefix);
+    om_obj->ptr = qname;
+    intern->ptr = om_obj;
+    intern->obj_type = OM_OBJ;     
+}
+/* }}} end Axis2Qname::_construct */
+
+/* {{{ proto string getUri */
+PHP_FUNCTION(axis2_qname_get_uri)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_qname_t *qname = NULL;
+    char *uri;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    qname = (axis2_qname_t *)(om_obj->ptr);
+    
+    if(qname)
+    {
+       uri = AXIS2_QNAME_GET_URI(qname, &env);
+       RETURN_STRING(uri, 1);     
+    }
+    RETURN_NULL();
+}
+
+/* }}} end getUri */
+
+/* {{{ proto string getPrefix */
+PHP_FUNCTION(axis2_qname_get_prefix)
+{
+     axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_qname_t *qname = NULL;
+    char *prefix;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    qname = (axis2_qname_t *)(om_obj->ptr);
+    
+    if(qname)
+    {
+       prefix = AXIS2_QNAME_GET_PREFIX(qname, &env);
+       RETURN_STRING(prefix, 1);     
+    }
+    RETURN_NULL();  
+}
+/* }}} end getPrefix */
+
+/* {{{ proto string getLocalpart */
+PHP_FUNCTION(axis2_qname_get_localpart)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    axis2_qname_t *qname = NULL;
+    char *localname;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    qname = (axis2_qname_t *)(om_obj->ptr);
+    
+    if(qname)
+    {
+       localname = AXIS2_QNAME_GET_PREFIX(qname, &env);
+       RETURN_STRING(localname, 1);     
+    }
+    RETURN_NULL();
+}
+
+/* }}} end getLocalpart */
+
+/* {{{ proto void equals */
+PHP_FUNCTION(axis2_qname_equals)
+{
+   axis2_object_ptr intern= NULL;
+    axis2_object_ptr intern_cmp = NULL;
+    zval *object = NULL;
+    zval *object_cmp = NULL;
+    om_object_ptr om_qname = NULL;
+    om_object_ptr om_qname_cmp = NULL;
+    axis2_env_t *env = NULL;
+    axis2_qname_t *qname = NULL;
+    axis2_qname_t *qname_cmp = NULL;
+    axis2_bool_t *equals = AXIS2_FALSE;
+    
+    env = php_axis2_get_env();
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "OO",&object, axis2_qname_class_entry ,
+                  &object_cmp, axis2_qname_class_entry) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    } 
+    
+    AXIS2_GET_OBJ(om_qname, object, om_object_ptr, intern);
+    AXIS2_GET_OBJ(om_qname_cmp, object_cmp, om_object_ptr, intern_cmp);
+    
+    qname = (axis2_qname_t *)(om_qname->ptr);
+    qname_cmp = (axis2_qname_t *)(om_qname_cmp->ptr);
+    
+    equals = AXIS2_QNAME_EQUALS(qname, &env, qname_cmp);
+    
+    if(equals == AXIS2_TRUE)
+    {
+        RETURN_BOOL(1);
+    }
+    if(equals == AXIS2_FALSE) 
+    {
+        RETURN_BOOL(0);
+    }
+
+}
+/* }}} end equals */
+
+PHP_FUNCTION(axis2_qname_clone)
+{
+    php_printf("not implemented");
+}
\ No newline at end of file

Added: webservices/axis2/trunk/c/bindings/php/xml_writer.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/bindings/php/xml_writer.c?rev=353971&view=auto
==============================================================================
--- webservices/axis2/trunk/c/bindings/php/xml_writer.c (added)
+++ webservices/axis2/trunk/c/bindings/php/xml_writer.c Sun Dec  4 19:49:16 2005
@@ -0,0 +1,210 @@
+#include "php.h"
+#include "php_axis2.h"
+#include "axis2_xml_writer.h"
+
+
+zend_function_entry php_axis2_xml_writer_class_functions[]=
+{
+    PHP_FALIAS(writeStartElementWithNamespace, axis2_xml_writer_write_start_element_with_namespace, NULL)
+    PHP_FALIAS(endStartElement, axis2_xml_writer_end_start_element, NULL)
+    PHP_FALIAS(getXML, axis2_xml_writer_get_xml, NULL)
+    PHP_FALIAS(writeStartElement, axis2_xml_writer_write_start_element, NULL)
+    PHP_FALIAS(writeEndElement, axis2_xml_writer_write_end_element, NULL)
+    PHP_ME(axis2_xml_writer, __construct, NULL, ZEND_ACC_PUBLIC)
+    {NULL, NULL, NULL}
+};
+
+
+/**
+   PHP_FALIAS(writeEmptyElement, axis2_xml_writer_write_empty_element, NULL)
+    PHP_FALIAS(writeEmptyElementWithNamespace, axis2_xml_writer_write_empty_element_with_namespace, NULL)
+    PHP_FALIAS(writeEmptyElementWithNamespacePrefix, axis2_xml_writer_write_empty_element_with_namespace_prefix, NULL)
+    
+    PHP_FALIAS(writeEndDocument, axis2_xml_writer_write_end_document, NULL)
+    PHP_FALIAS(writeAttribute, axis2_xml_writer_write_attribute, NULL)
+    PHP_FALIAS(writeAttributeWithNamespace, axis2_xml_writer_write_attribute_with_namespace, NULL)
+    PHP_FALIAS(writeAttributeWithNamespacePrefix, axis2_xml_writer_write_attribute_with_namespace_prefix, NULL)
+    PHP_FALIAS(writeNamespace, axis2_xml_writer_write_namespace, NULL)
+    PHP_FALIAS(writeComment, axis2_xml_writer_write_comment, NULL)
+    PHP_FALIAS(writeProcessingInstruction, axis2_xml_writer_write_processing_instruction, NULL)
+    PHP_FALIAS(writeProcessingInstructionData, axis2_xml_writer_write_processing_instruction_data, NULL)
+    PHP_FALIAS(writeStartDocument, axis2_xml_writer_write_start_document, NULL)
+    PHP_FALIAS(writeStartDocumentWithVersion, axis2_xml_writer_write_start_document_with_version, NULL)
+    PHP_FALIAS(writeStartDocumentWithVersionEncoding, axis2_xml_writer_write_start_document_with_version_encoding, NULL)
+    
+    
+    PHP_FALIAS(writeCharacters, axis2_xml_writer_write_characters, NULL)
+    
+    
+    
+    PHP_FALIAS(writeStartElementNSPrefix, axis2_xml_writer_write_start_element_with_namespace_prefix, NULL)
+
+*/
+
+
+PHP_METHOD(axis2_xml_writer, __construct)
+{
+    axis2_object_ptr intern = NULL;
+    zval *object = NULL;
+    om_object_ptr om_obj = NULL;
+    axis2_env_t *env = NULL;
+    char *encoding = NULL;
+    int enc_len = 0;
+    int pdef = 0;
+    int cmp = 0;
+    axis2_xml_writer_t *writer = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os!ll",&object, axis2_xml_writer_class_entry, &encoding, &enc_len,&pdef, &cmp) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    intern = (axis2_object_ptr)zend_object_store_get_object(object TSRMLS_CC);
+    om_obj = (om_object_ptr)emalloc(sizeof(om_object));
+    
+    om_obj->obj_type = AXIS2_XML_WRITER;
+    
+    om_obj->ptr = NULL;
+    
+    writer = axis2_xml_writer_create_for_memory (&env,encoding, pdef, cmp);
+    
+    if(!writer)
+    {
+        php_error_docref(NULL TSRMLS_CC, E_OUTOFMEMORY, " writer create failure ");
+    }
+    
+    om_obj->ptr = writer;
+    intern->obj_type = OM_OBJ;
+    intern->ptr = om_obj;
+}
+
+PHP_FUNCTION(axis2_xml_writer_write_start_element)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    char *lname = NULL;
+    int lname_len = 0;
+    axis2_xml_writer_t *writer = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Os",&object, axis2_xml_writer_class_entry ,&lname, &lname_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    env = php_axis2_get_env();
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    writer = (axis2_xml_writer_t *)(om_obj->ptr);
+    AXIS2_XML_WRITER_WRITE_START_ELEMENT(writer, &env, lname);
+}
+
+PHP_FUNCTION(axis2_xml_writer_end_start_element)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    axis2_xml_writer_t *writer = NULL;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    writer = (axis2_xml_writer_t *)(om_obj->ptr);
+    AXIS2_XML_WRITER_END_START_ELEMENT(writer, &env);
+}
+
+PHP_FUNCTION(axis2_xml_writer_write_end_element)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    axis2_xml_writer_t *writer = NULL;
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_THIS(object);
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    writer = (axis2_xml_writer_t *)(om_obj->ptr);
+    AXIS2_XML_WRITER_WRITE_END_ELEMENT(writer, &env);
+}
+PHP_FUNCTION(axis2_xml_writer_write_start_element_with_namespace)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    
+    char *lname = NULL;
+    int lname_len = 0;
+    char *uri = NULL;
+    int uri_len = 0;
+    
+    axis2_xml_writer_t *writer = NULL;
+    
+    if(zend_parse_method_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
+             getThis(), "Oss",&object, axis2_xml_writer_class_entry , &lname, &lname_len, &uri, &uri_len) == FAILURE)
+    {
+        php_std_error_handling();
+        return;
+    }
+    
+    env = php_axis2_get_env();
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    writer = (axis2_xml_writer_t *)(om_obj->ptr);
+    AXIS2_XML_WRITER_WRITE_START_ELEMENT_WITH_NAMESPACE(writer, &env, lname, uri);
+
+}
+PHP_FUNCTION(axis2_xml_writer_write_start_element_with_namespace_prefix){}
+
+PHP_FUNCTION(axis2_xml_writer_write_end_document){}
+PHP_FUNCTION(axis2_xml_writer_write_attribute){}
+PHP_FUNCTION(axis2_xml_writer_write_attribute_with_namespace){}
+PHP_FUNCTION(axis2_xml_writer_write_attribute_with_namespace_prefix){}
+PHP_FUNCTION(axis2_xml_writer_write_namespace){}
+PHP_FUNCTION(axis2_xml_writer_write_default_namespace){}
+PHP_FUNCTION(axis2_xml_writer_write_comment){}
+PHP_FUNCTION(axis2_xml_writer_write_processing_instruction){}
+PHP_FUNCTION(axis2_xml_writer_write_processing_instruction_data){}
+PHP_FUNCTION(axis2_xml_writer_write_cdata){}
+PHP_FUNCTION(axis2_xml_writer_write_dtd){}
+PHP_FUNCTION(axis2_xml_writer_write_entity_ref){}
+PHP_FUNCTION(axis2_xml_writer_write_start_document){}
+PHP_FUNCTION(axis2_xml_writer_write_start_document_with_version){}
+PHP_FUNCTION(axis2_xml_writer_write_start_document_with_version_encoding){}
+PHP_FUNCTION(axis2_xml_writer_write_characters){}
+PHP_FUNCTION(axis2_xml_writer_get_prefix){}
+PHP_FUNCTION(axis2_xml_writer_set_prefix){}
+PHP_FUNCTION(axis2_xml_writer_set_default_prefix){}
+PHP_FUNCTION(axis2_xml_writer_write_encoded){}
+
+
+PHP_FUNCTION(axis2_xml_writer_write_empty_element){}
+PHP_FUNCTION(axis2_xml_writer_write_empty_element_with_namespace){}
+PHP_FUNCTION(axis2_xml_writer_write_empty_element_with_namespace_prefix){}
+
+PHP_FUNCTION(axis2_xml_writer_get_xml)
+{
+    axis2_object_ptr intern = NULL;
+    om_object_ptr om_obj = NULL;
+    zval *object = NULL;
+    axis2_env_t *env = NULL;
+    axis2_xml_writer_t *writer = NULL;
+    char *output = NULL;
+
+    env = php_axis2_get_env();
+    
+    AXIS2_GET_THIS(object);    
+    AXIS2_GET_OBJ(om_obj, object, om_object_ptr, intern);
+    
+    writer = (axis2_xml_writer_t *)(om_obj->ptr);
+    output = AXIS2_XML_WRITER_GET_XML(writer, &env);
+    if(output)
+    {
+        RETURN_STRING(output, 1);
+    } 
+    RETURN_NULL();
+}
\ No newline at end of file