You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by pr...@apache.org on 2007/10/06 16:53:12 UTC

svn commit: r582501 [2/7] - in /webservices/axis2/branches/java/jaxws21/modules: adb-codegen/src/org/apache/axis2/schema/ adb-codegen/src/org/apache/axis2/schema/template/ adb-codegen/src/org/apache/axis2/schema/writer/ adb-codegen/test-resources/tests...

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl?rev=582501&r1=582500&r2=582501&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/template/CADBBeanTemplateSource.xsl Sat Oct  6 07:53:06 2007
@@ -2,15 +2,14 @@
     <xsl:output method="text"/>
 
      <!-- cater for the multiple classes - wrappped mode - currently not well supported.-->
-    <xsl:template match="/classs">
+    <xsl:template match="/beans">
         <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
         <xsl:variable name="axis2_name">adb_<xsl:value-of select="@name"/></xsl:variable>
-        <xsl:variable name="axis2_capsname">ADB_<xsl:value-of select="@caps-name"/></xsl:variable>
        /**
         * <xsl:value-of select="$axis2_name"/>.c
         *
         * This file was auto-generated from WSDL
-        * by the Apache Axis2/C version: #axisVersion# #today#
+        * by the Apache Axis2/Java version: #axisVersion# #today#
         */
 
        /**
@@ -21,7 +20,6 @@
         <xsl:apply-templates/>
 
     </xsl:template>
-
     <!--cater for the multiple classes - unwrappped mode -->
     <xsl:template match="/">
         <xsl:apply-templates/>
@@ -31,7 +29,6 @@
         <xsl:variable name="name">_<xsl:value-of select="@name"/></xsl:variable>
         <xsl:variable name="axis2_name">adb_<xsl:value-of select="@name"/></xsl:variable>
         <xsl:variable name="istype"><xsl:value-of select="@type"/></xsl:variable>
-        <xsl:variable name="axis2_capsname">ADB_<xsl:value-of select="@caps-name"/></xsl:variable>
 
         <xsl:variable name="originalName"><xsl:value-of select="@originalName"/></xsl:variable>
         <xsl:variable name="nsuri"><xsl:value-of select="@nsuri"/></xsl:variable>
@@ -137,7 +134,7 @@
             </xsl:if>
 
             return <xsl:value-of select="$name"/>;
-         }
+        }
 
         axis2_status_t AXIS2_CALL
         <xsl:value-of select="$axis2_name"/>_free (
@@ -171,20 +168,6 @@
                    <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
-              <xsl:variable name="capspropertyType">
-                 <xsl:choose>
-                   <xsl:when test="@isarray">AXUTIL_ARRAY_LIST</xsl:when>
-                   <xsl:when test="not(@type)">AXIOM_NODE</xsl:when> <!-- these are anonymous -->
-                   <xsl:when test="@ours"><xsl:choose>
-                    <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
-                    ADB_<xsl:value-of select="@caps-type"/></xsl:when>
-                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">AXUTIL_<xsl:value-of select="@caps-type"/></xsl:when>
-                    <xsl:otherwise>
-                    AXIS2_<xsl:value-of select="@caps-type"/></xsl:otherwise>
-                </xsl:choose></xsl:when>
-                   <xsl:otherwise><xsl:value-of select="@caps-type"/></xsl:otherwise> <!-- this will not be used -->
-                 </xsl:choose>
-              </xsl:variable>
               <xsl:variable name="nativePropertyType"> <!--these are used in arrays to take the native type-->
                  <xsl:choose>
                    <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
@@ -198,19 +181,6 @@
                    <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
-              <xsl:variable name="nativeCapspropertyType"><!--these are used in arrays to take the native type-->
-                 <xsl:choose>
-                   <xsl:when test="not(@type)">AXIOM_NODE</xsl:when> <!-- these are anonymous -->
-                   <xsl:when test="@ours"><xsl:choose>
-                    <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
-                    ADB_<xsl:value-of select="@caps-type"/></xsl:when>
-                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">AXUTIL_<xsl:value-of select="@caps-type"/></xsl:when>
-                    <xsl:otherwise>
-                    AXIS2_<xsl:value-of select="@caps-type"/></xsl:otherwise>
-                </xsl:choose></xsl:when>
-                   <xsl:otherwise><xsl:value-of select="@caps-type"/></xsl:otherwise> <!-- this will not be used -->
-                 </xsl:choose>
-              </xsl:variable>
               <xsl:variable name="propertyName"><xsl:value-of select="@name"></xsl:value-of></xsl:variable>
               <xsl:variable name="CName"><xsl:value-of select="@cname"></xsl:value-of></xsl:variable>
 
@@ -249,7 +219,7 @@
                       adb_<xsl:value-of select="@type"/>_free( <xsl:value-of select="$attriName"/>, env);
                    </xsl:when>
 
-                   <xsl:when test="$nativePropertyType='short' or $nativePropertyType='axis2_bool_t' or $nativePropertyType='char' or $nativePropertyType='int' or $nativePropertyType='float' or $nativePropertyType='double' or $nativePropertyType='long'">
+                   <xsl:when test="$nativePropertyType='short' or $nativePropertyType='char' or $nativePropertyType='int' or $nativePropertyType='float' or $nativePropertyType='double' or $nativePropertyType='long'">
                      <xsl:if test="@isarray">
                       <!-- free ints, longs, float in array-->
                       /** we keep primtives as pointers in arrasy, so need to free them */
@@ -288,7 +258,7 @@
 
                    <!--TODO: This should be extended for all the types that should be freed.. -->
                    <xsl:otherwise>
-                     /** This is an unknown type or a primitive. Free this manually for unknown type */
+                     /** This is an unknown type or a primitive. Please free this manually*/
                    </xsl:otherwise>
                  </xsl:choose>
                  <xsl:value-of select="$justAttriName"/> = NULL;
@@ -332,20 +302,196 @@
            }
         </xsl:if>
 
+        <xsl:if test="@simple">
+            axis2_status_t AXIS2_CALL
+            <xsl:value-of select="$axis2_name"/>_deserialize_from_string(
+                            <xsl:value-of select="$axis2_name"/>_t*<xsl:text> </xsl:text><xsl:value-of select="$name"/>,
+                                            const axutil_env_t *env,
+                                            axis2_char_t *node_value)
+            {
+              axis2_status_t status = AXIS2_SUCCESS;
+            <xsl:if test="property/@type='axutil_date_time_t*' or property/@type='axutil_base64_binary_t*'">
+               void *element = NULL;
+            </xsl:if>
+              <xsl:for-each select="property"> <!-- only one property would be in a simpletype -->
+                <xsl:variable name="propertyType">
+                   <xsl:choose>
+                     <xsl:when test="@isarray">axutil_array_list_t*</xsl:when>
+                     <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
+                     <xsl:when test="@ours"><xsl:choose>
+                      <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
+                      adb_<xsl:value-of select="@type"/>_t*</xsl:when>
+                      <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">axutil_<xsl:value-of select="@type"/>_t*</xsl:when>
+                      <xsl:otherwise>
+                      axis2_<xsl:value-of select="@type"/>_t*</xsl:otherwise>
+                  </xsl:choose></xsl:when>
+                     <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
+                   </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="nativePropertyType"> <!--these are used in arrays to take the native type-->
+                   <xsl:choose>
+                     <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
+                     <xsl:when test="@ours"><xsl:choose>
+                      <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
+                      adb_<xsl:value-of select="@type"/>_t*</xsl:when>
+                      <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">axutil_<xsl:value-of select="@type"/>_t*</xsl:when>
+                      <xsl:otherwise>
+                      axis2_<xsl:value-of select="@type"/>_t*</xsl:otherwise>
+                  </xsl:choose></xsl:when>
+                     <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
+                   </xsl:choose>
+                </xsl:variable>
+                <xsl:variable name="propertyName"><xsl:value-of select="@name"></xsl:value-of></xsl:variable>
+                <xsl:variable name="CName"><xsl:value-of select="@cname"></xsl:value-of></xsl:variable>
+  
+                <!-- here only simple type possible -->
+                <xsl:choose>
+                  <!-- add int s -->
+                  <xsl:when test="$nativePropertyType='int'">
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, atoi(node_value));
+                  </xsl:when>
+
+                  <!-- add axis2_char_t s -->
+                  <xsl:when test="$nativePropertyType='char'">
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, (char)(*node_value)); <!-- This should be checked -->
+                  </xsl:when>
+
+                  <!-- add short s -->
+                  <xsl:when test="$nativePropertyType='short'">
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, atoi(node_value));
+                  </xsl:when>
+
+                  <!-- add long s -->
+                  <xsl:when test="$nativePropertyType='long'">
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, atol(node_value));
+                  </xsl:when>
+
+                  <!-- add float s -->
+                  <xsl:when test="$nativePropertyType='float'">
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, atof(node_value));
+                  </xsl:when>
+                  <!-- add double s -->
+                  <xsl:when test="$nativePropertyType='double'">
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, atof(node_value));
+                  </xsl:when>
+
+                  <!-- add axis2_char_t s -->
+                  <xsl:when test="$nativePropertyType='axis2_char_t*'">
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, node_value);
+                  </xsl:when>
+
+                  <!-- add axis2_qname_t s -->
+                  <xsl:when test="$nativePropertyType='axutil_qname_t*'">
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, axutil_qname_create_from_string( env, node_value));
+                  </xsl:when>
+
+                  <!-- add axis2_uri_t s -->
+                  <xsl:when test="$nativePropertyType='axutil_uri_t*'">
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, axutil_uri_parse_string(env, node_value));
+                  </xsl:when>
+                  <!-- add axis2_bool_t s -->
+                  <xsl:when test="$nativePropertyType='axis2_bool_t'">
+                     if ( !axutil_strcmp(node_value, "TRUE") || !axutil_strcmp(node_value, "true") )
+                     {
+                         <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, AXIS2_TRUE);
+                     }
+                     else
+                     {
+                         <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, AXIS2_FALSE);
+                     }
+                  </xsl:when>
+                  <!-- add date_time_t* s -->
+                  <xsl:when test="$nativePropertyType='axutil_date_time_t*'">
+                     element = (void*)axutil_date_time_create( env);
+                     axutil_date_time_deserialize_date_time( (axutil_date_time_t*)element, env,
+                                                                node_value);
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, (<xsl:value-of select="$nativePropertyType"/>)element);
+                  </xsl:when>
+                  <!-- add hex_binary_t* s -->
+                  <xsl:when test="$nativePropertyType='axutil_base64_binary_t*'">
+                     element = (void*)axutil_base64_binary_create( env);
+                     axutil_base64_binary_set_encoded_binary( ( <xsl:value-of select="$nativePropertyType"/>)element, env,
+                                                                node_value);
+                     <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                    env, ( <xsl:value-of select="$nativePropertyType"/>)element);
+                  </xsl:when>
+                  <xsl:when test="@ours">
+                    <!-- It seems this is in an unreachable path -->
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <!--TODO: add new attributes types -->
+                    /** can not handle the attribute type <xsl:value-of select="$nativePropertyType"/>*/
+                    status = AXIS2_FAILURE;
+                  </xsl:otherwise>
+                </xsl:choose>   
+              </xsl:for-each>
+              return status;
+            }
+        </xsl:if>
+
         axis2_status_t AXIS2_CALL
         <xsl:value-of select="$axis2_name"/>_deserialize(
                 <xsl:value-of select="$axis2_name"/>_t*<xsl:text> </xsl:text><xsl:value-of select="$name"/>,
                 const axutil_env_t *env,
                 axiom_node_t* parent)
         {
-
-            axis2_status_t status = AXIS2_SUCCESS;
-            axiom_namespace_t *ns1 = NULL;
-            <xsl:if test="property/@attribute">
+          axis2_status_t status = AXIS2_SUCCESS;
+          <xsl:if test="property/@attribute">
                axiom_attribute_t *parent_attri = NULL;
                axiom_element_t *parent_element = NULL;
                axis2_char_t *attrib_text = NULL;
+          </xsl:if>
+          <xsl:if test="property/@ours or (property/@isarray and (property/@type='short' or property/@type='int' or property/@type='char' or property/@type='long' or property/@type='float' or property/@type='double')) or property/@type='axutil_date_time_t*' or property/@type='axutil_base64_binary_t*'">
+               void *element = NULL;
+          </xsl:if>
+          <!-- these two are requried -->
+
+         <xsl:for-each select="property">
+            <xsl:if test="position()=1"> <!-- check for at least one element exists -->
+             axis2_char_t* text_value = NULL;
+             axutil_qname_t *qname = NULL;
             </xsl:if>
+          </xsl:for-each>
+          <xsl:choose>
+            <xsl:when test="@simple">
+            axiom_element_t *text_element = NULL;
+            axiom_node_t *text_node = NULL;
+            
+            status = AXIS2_FAILURE;
+            if(parent)
+            {
+                text_node = axiom_node_get_first_child(parent, env);
+                if (text_node &amp;&amp;
+                        axiom_node_get_node_type(text_node, env) == AXIOM_TEXT)
+                {
+                    axiom_text_t *text_element = (axiom_text_t*)axiom_node_get_data_element(text_node, env);
+                    if(text_element &amp;&amp; axiom_text_get_value(text_element, env))
+                    {
+                        text_value = (axis2_char_t*)axiom_text_get_value(text_element, env);
+                        status = <xsl:value-of select="$axis2_name"/>_deserialize_from_string(<xsl:value-of select="$name"/>, env, text_value);
+                    }
+                }
+            }
+            </xsl:when>
+            <xsl:otherwise>
+
+            <xsl:for-each select="property">
+              <xsl:if test="position()=1"> <!-- check for at least one element exists -->
+                axiom_namespace_t *ns1 = NULL;
+              </xsl:if>
+            </xsl:for-each>
             <xsl:if test="property/@isarray">
                int i = 0;
                int element_found = 0;
@@ -355,12 +501,6 @@
                int sequence_broken = 0;
                axiom_node_t *tmp_node = NULL;
             </xsl:if>
-            <!-- these two are requried -->
-            <xsl:if test="property/@ours or (property/@isarray and (property/@type='short' or property/@type='int' or property/@type='char' or property/@type='long' or property/@type='float' or property/@type='double')) or property/@type='axutil_date_time_t*' or property/@type='axutil_base64_binary_t*'">
-               void *element = NULL;
-            </xsl:if>
-             axis2_char_t* text_value = NULL;
-             axutil_qname_t *qname = NULL;
             <!--<xsl:if test="property">
               <xsl:if test="not(property/@attribute) and  (not(property/@ours) or property/@ours='')">
                 axis2_char_t* text_value = NULL;
@@ -369,8 +509,15 @@
             <xsl:if test="property and (not(@type) or @type='' or property/@attribute)">
                axis2_qname_t *qname = NULL;
             </xsl:if>-->
-            <xsl:if test="not(property/@attribute) and (not(@ordered or not($anon or $istype)) or @ordered='' or property/@isarray)">
-              axutil_qname_t *element_qname = NULL;
+            <xsl:variable name="element_qname_var_requred">
+                  <xsl:for-each select="property">
+                    <xsl:if test="not(@attribute) and @isarray">
+                        yes
+                    </xsl:if>
+                  </xsl:for-each>
+            </xsl:variable>
+            <xsl:if test="contains($element_qname_var_requred, 'yes')">
+                 axutil_qname_t *element_qname = NULL;
             </xsl:if>
             <xsl:for-each select="property">
              <xsl:if test="position()=1">
@@ -388,9 +535,13 @@
             </xsl:if>
             AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-            ns1 = axiom_namespace_create (env,
+            <xsl:for-each select="property">
+              <xsl:if test="position()=1"> <!-- check for at least one element exists -->
+                ns1 = axiom_namespace_create (env,
                                          "<xsl:value-of select="$nsuri"/>",
                                          "<xsl:value-of select="$nsprefix"/>");
+              </xsl:if>
+            </xsl:for-each>
             <xsl:if test="property">
               if ( NULL == parent )
               {
@@ -401,10 +552,10 @@
                 return AXIS2_FAILURE;
               }
             </xsl:if>
-            <xsl:choose>
-              <xsl:when test="not(@type)">
-                <xsl:for-each select="property">
-                 <xsl:if test="position()=1">
+            <xsl:for-each select="property">
+              <xsl:if test="position()=1"> <!-- check for at least one element exists -->
+                 <xsl:choose>
+                    <xsl:when test="not($istype)">
                     current_element = (axiom_element_t *)axiom_node_get_data_element( parent, env);
                     qname = axiom_element_get_qname( current_element, env, parent);
                     if ( axutil_qname_equals( qname, env, <xsl:value-of select="$name"/>-> qname ) )
@@ -426,14 +577,27 @@
                         <!-- TODO: ADB specific error should be defiend and set here -->
                         return AXIS2_FAILURE;
                     }
-                 </xsl:if>
-                </xsl:for-each>
-              </xsl:when>
-              <xsl:otherwise>
-                first_node = parent;
-              </xsl:otherwise>
-             </xsl:choose>
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <!-- for types, parent refers to the container element -->
+                      first_node = axiom_node_get_first_child( parent, env);
+                      if(first_node == NULL)
+                      {
+                          AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                                            "Failed in building adb object for <xsl:value-of select="$originalName"/> : "
+                                            "Wrong XML to deserialize");
+                          <!-- TODO: ADB specific error should be defiend and set here -->
+                          return AXIS2_FAILURE;
+                      }
+                    </xsl:otherwise>
+                 </xsl:choose>
+               </xsl:if>
+            </xsl:for-each>
+            
+            </xsl:otherwise> <!--otherwise for @simple check -->
+          </xsl:choose>
 
+          <!-- attributes are common to simple types(when used in simple content) and other types -->
             <xsl:for-each select="property/@attribute">
              <xsl:if test="position()=1">
                  parent_element = (axiom_element_t *)axiom_node_get_data_element( parent, env);
@@ -455,20 +619,6 @@
                    <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
-              <xsl:variable name="capspropertyType">
-                 <xsl:choose>
-                   <xsl:when test="@isarray">AXUTIL_ARRAY_LIST</xsl:when>
-                   <xsl:when test="not(@type)">AXIOM_NODE</xsl:when> <!-- these are anonymous -->
-                   <xsl:when test="@ours"><xsl:choose>
-                    <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
-                    ADB_<xsl:value-of select="@caps-type"/></xsl:when>
-                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">AXUTIL_<xsl:value-of select="@caps-type"/></xsl:when>
-                    <xsl:otherwise>
-                    AXIS2_<xsl:value-of select="@caps-type"/></xsl:otherwise>
-                </xsl:choose></xsl:when>
-                   <xsl:otherwise><xsl:value-of select="@caps-type"/></xsl:otherwise> <!-- this will not be used -->
-                 </xsl:choose>
-              </xsl:variable>
               <xsl:variable name="nativePropertyType"> <!--these are used in arrays to take the native type-->
                  <xsl:choose>
                    <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
@@ -482,22 +632,8 @@
                    <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
-              <xsl:variable name="nativeCapspropertyType"><!--these are used in arrays to take the native type-->
-                 <xsl:choose>
-                   <xsl:when test="not(@type)">AXIOM_NODE</xsl:when> <!-- these are anonymous -->
-                   <xsl:when test="@ours"><xsl:choose>
-                    <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
-                    ADB_<xsl:value-of select="@caps-type"/></xsl:when>
-                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">AXUTIL_<xsl:value-of select="@type"/></xsl:when>
-                    <xsl:otherwise>
-                    AXIS2_<xsl:value-of select="@caps-type"/></xsl:otherwise>
-                </xsl:choose></xsl:when>
-                   <xsl:otherwise><xsl:value-of select="@caps-type"/></xsl:otherwise> <!-- this will not be used -->
-                 </xsl:choose>
-              </xsl:variable>
               <xsl:variable name="propertyName"><xsl:value-of select="@name"></xsl:value-of></xsl:variable>
               <xsl:variable name="CName"><xsl:value-of select="@cname"></xsl:value-of></xsl:variable>
-              <xsl:variable name="CapsCName"><xsl:value-of select="@caps-cname"></xsl:value-of></xsl:variable>
 
               <xsl:variable name="attriName"><!--these are used in arrays to take the native type-->
                  <xsl:choose>
@@ -539,7 +675,7 @@
                         <!-- add axis2_char_t s -->
                         <xsl:when test="$nativePropertyType='char'">
                            <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
-                                                          env, (char)atoi( attrib_text));
+                                                          env, (char)(*attrib_text));
                         </xsl:when>
 
                         <!-- add short s -->
@@ -568,7 +704,7 @@
                         <!-- add axis2_char_t s -->
                         <xsl:when test="$nativePropertyType='axis2_char_t*'">
                            <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
-                                                          env, AXIS2_STRDUP( attrib_text, env));
+                                                          env, attrib_text);
                         </xsl:when>
 
                         <!-- add axis2_qname_t s -->
@@ -606,12 +742,17 @@
                         <!-- add hex_binary_t* s -->
                         <xsl:when test="$nativePropertyType='axutil_base64_binary_t*'">
                            element = (void*)axutil_base64_binary_create( env);
-                           axutil_base64_binary_set_encoded_binary( <xsl:value-of select="$name"/>-> attrib_<xsl:value-of select="$CName"/>, env,
+                           axutil_base64_binary_set_encoded_binary( ( <xsl:value-of select="$nativePropertyType"/>)element), env,
                                                                       attrib_text);
                            <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
                                                           env, ( <xsl:value-of select="$nativePropertyType"/>)element);
                         </xsl:when>
-                          
+                        <xsl:when test="@ours">
+                            element =  (void*)adb_<xsl:value-of select="@type"/>_create(env);
+                            adb_<xsl:value-of select="@type"/>_deserialize_from_string(element, env, attrib_text);
+                           <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>,
+                                                          env, ( <xsl:value-of select="$nativePropertyType"/>)element);
+                        </xsl:when>
                         <xsl:otherwise>
                           <!--TODO: add new attributes types -->
                           /** can not handle the attribute type <xsl:value-of select="$nativePropertyType"/>*/
@@ -629,6 +770,7 @@
                     }
                     </xsl:if>
                 </xsl:when>
+                <xsl:when test="../@simple"></xsl:when> <!-- just to avoid preceeding code to be parsed in a simple type -->
                 <xsl:otherwise> <!-- when it is an element not(@attribute) -->
                   <!-- handles arrays -->
                    <xsl:if test="@isarray">
@@ -694,17 +836,10 @@
                                  <xsl:choose>
                                     <xsl:when test="@ours">
                                       element = (void*)adb_<xsl:value-of select="@type"/>_create( env);
-                                      if(axiom_node_get_first_child(current_node, env)==NULL)
-                                      {
-                                          AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                                                "Failed in building adb object for <xsl:value-of select="$propertyName"/> : "
-                                                "Wrong XML to deserialize");
-                                          <!-- TODO: ADB specific error should be defiend and set here -->
-                                          return AXIS2_FAILURE;
-                                      }
-                                      status =  adb_<xsl:value-of select="@type"/>_deserialize( ( <xsl:value-of select="$nativePropertyType"/>)element, env,
-                                                                             axiom_node_get_first_child(current_node, env));
-                                      if( AXIS2_FAILURE ==  status)
+
+                                      status =  adb_<xsl:value-of select="@type"/>_deserialize(( <xsl:value-of select="$nativePropertyType"/>)element,
+                                                                            env, current_node);
+                                      if( AXIS2_FAILURE == status)
                                       {
                                           AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in building element <xsl:value-of select="$propertyName"/> "
                                                               " %d :: %s", env->error->error_number,
@@ -740,13 +875,13 @@
                                             else
                                             {
                                                 status = <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>, env,
-                                                                    (char)atoi( text_value));
+                                                                    (char)(*text_value));
                                             }
 
                                             </xsl:when>
                                             <xsl:otherwise>
                                       status = <xsl:value-of select="$axis2_name"/>_set_<xsl:value-of select="$CName"/>( <xsl:value-of select="$name"/>, env,
-                                                                    (char)atoi( text_value));
+                                                                    (char)(*text_value));
                                             </xsl:otherwise>
                                         </xsl:choose>
                                     </xsl:when>
@@ -977,16 +1112,9 @@
                                      <xsl:choose>
                                         <xsl:when test="@ours">
                                           element = (void*)adb_<xsl:value-of select="@type"/>_create( env);
-                                          if(axiom_node_get_first_child(current_node, env)==NULL)
-                                          {
-                                              AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                                                    "Failed in building adb object for <xsl:value-of select="$propertyName"/> : "
-                                                    "Wrong XML to deserialize");
-                                              <!-- TODO: ADB specific error should be defiend and set here -->
-                                              return AXIS2_FAILURE;
-                                          }
+                                          
                                           status =  adb_<xsl:value-of select="@type"/>_deserialize( ( <xsl:value-of select="$nativePropertyType"/>)element, env,
-                                                                                 axiom_node_get_first_child(current_node, env));
+                                                                                 current_node);
                                           
                                           if( AXIS2_FAILURE ==  status)
                                           {
@@ -1013,7 +1141,7 @@
                                           text_value = axiom_element_get_text(current_element, env, current_node );
                                           /** we keeps ints in arrays from their pointers */
                                           element = AXIS2_MALLOC( env-> allocator, 64);
-                                          (*(<xsl:value-of select="$nativePropertyType"/>*)element) = (char)atoi(text_value);
+                                          (*(<xsl:value-of select="$nativePropertyType"/>*)element) = (char)(*text_value);
                                           axutil_array_list_add_at( arr_list, env, i, element);
                                         </xsl:when>
                                         <xsl:when test="$nativePropertyType='int'">
@@ -1083,7 +1211,7 @@
                                         <xsl:when test="$nativePropertyType='axutil_base64_binary_t*'">
                                           element = (void*)axutil_base64_binary_create( env);
                                           text_value = axiom_element_get_text(current_element, env, current_node );
-                                          status = axutil_base64_binary_set_encoded_binary( <xsl:value-of select="$name"/>-> attrib_<xsl:value-of select="$CName"/>, env,
+                                          status = axutil_base64_binary_set_encoded_binary( (axutil_base64_binary_t*)element, env,
                                                                           text_value);
                                           if( AXIS2_FAILURE ==  status)
                                           {
@@ -1141,16 +1269,9 @@
                                      <xsl:choose>
                                         <xsl:when test="@ours">
                                           element = (void*)adb_<xsl:value-of select="@type"/>_create( env);
-                                          if(axiom_node_get_first_child(current_node, env)==NULL)
-                                          {
-                                              AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                                                    "Failed in building adb object for <xsl:value-of select="$propertyName"/> : "
-                                                    "Wrong XML to deserialize");
-                                              <!-- TODO: ADB specific error should be defiend and set here -->
-                                              return AXIS2_FAILURE;
-                                          }
+                                          
                                           status =  adb_<xsl:value-of select="@type"/>_deserialize( ( <xsl:value-of select="$nativePropertyType"/>)element, env,
-                                                                                 axiom_node_get_first_child(current_node, env));
+                                                                                 current_node);
                                           if( AXIS2_FAILURE ==  status)
                                           {
                                               AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "failed in building element <xsl:value-of select="$propertyName"/> "
@@ -1176,7 +1297,7 @@
                                           text_value = axiom_element_get_text(current_element, env, current_node );
                                           /** we keeps ints in arrays from their pointers */
                                           element = AXIS2_MALLOC( env-> allocator, 64);
-                                          (*(<xsl:value-of select="$nativePropertyType"/>*)element) = (char)atoi(text_value);
+                                          (*(<xsl:value-of select="$nativePropertyType"/>*)element) = (char)(*text_value);
                                           axutil_array_list_add_at( arr_list, env, i, element);
                                         </xsl:when>
                                         <xsl:when test="$nativePropertyType='int'">
@@ -1246,7 +1367,7 @@
                                         <xsl:when test="$nativePropertyType='axutil_base64_binary_t*'">
                                           element = (void*)axutil_base64_binary_create( env);
                                           text_value = axiom_element_get_text(current_element, env, current_node );
-                                          status = axutil_base64_binary_set_encoded_binary( <xsl:value-of select="$name"/>-> attrib_<xsl:value-of select="$CName"/>, env,
+                                          status = axutil_base64_binary_set_encoded_binary( (axutil_base64_binary_t*)element, env,
                                                                           text_value);
                                           if( AXIS2_FAILURE ==  status)
                                           {
@@ -1282,24 +1403,180 @@
                       </xsl:choose> <!-- check array or not -->
                    </xsl:otherwise> <!-- closing when it is an element not(@attribute) -->
                  </xsl:choose> <!--- chooosing for element or attribute -->
-            </xsl:for-each> <!-- closing for each property -->
+              </xsl:for-each> <!-- closing for each property -->
 
           return status;
        }
 
+        <xsl:if test="@simple">
+            axis2_char_t* AXIS2_CALL
+            <xsl:value-of select="$axis2_name"/>_serialize_to_string(
+                    <xsl:value-of select="$axis2_name"/>_t*<xsl:text> </xsl:text><xsl:value-of select="$name"/>,
+                    const axutil_env_t *env)
+            {
+                axis2_char_t *text_value = NULL;
+
+                <xsl:for-each select="property">
+                  <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable>
+                  <xsl:variable name="propertyType">
+                     <xsl:choose>
+                       <xsl:when test="@isarray">axutil_array_list_t*</xsl:when>
+                       <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
+                       <xsl:when test="@ours"><xsl:choose>
+                        <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
+                        adb_<xsl:value-of select="@type"/>_t*</xsl:when>
+                        <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">axutil_<xsl:value-of select="@type"/>_t*</xsl:when>
+                        <xsl:otherwise>
+                        axis2_<xsl:value-of select="@type"/>_t*</xsl:otherwise>
+                    </xsl:choose></xsl:when>
+                       <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
+                     </xsl:choose>
+                  </xsl:variable>
+                  <xsl:variable name="nativePropertyType"> <!--these are used in arrays to take the native type-->
+                     <xsl:choose>
+                       <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
+                       <xsl:when test="@ours"><xsl:choose>
+                        <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
+                        adb_<xsl:value-of select="@type"/>_t*</xsl:when>
+                        <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">axutil_<xsl:value-of select="@type"/>_t*</xsl:when>
+                        <xsl:otherwise>
+                        axis2_<xsl:value-of select="@type"/>_t*</xsl:otherwise>
+                    </xsl:choose></xsl:when>
+                       <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
+                     </xsl:choose>
+                  </xsl:variable>
+                  <xsl:variable name="propertyName"><xsl:value-of select="@originalName"></xsl:value-of></xsl:variable>
+                  <xsl:variable name="CName"><xsl:value-of select="@cname"></xsl:value-of></xsl:variable>
+    
+                  <xsl:variable name="attriName"><!--these are used in arrays to take the native type-->
+                     <xsl:choose>
+                       <xsl:when test="@isarray">(<xsl:value-of select="$nativePropertyType"/>)element</xsl:when>
+                       <xsl:otherwise><xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/></xsl:otherwise>
+                     </xsl:choose>
+                  </xsl:variable>
+                  <xsl:variable name="justAttriName"><!--these are used in arrays to take the native type-->
+                     <xsl:choose>
+                       <xsl:when test="@isarray">element</xsl:when>
+                       <xsl:otherwise><xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/></xsl:otherwise>
+                     </xsl:choose>
+                  </xsl:variable>
+
+
+                 <xsl:choose>
+                    <!-- add int s -->
+                    <xsl:when test="$nativePropertyType='int'">
+                       text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 64);
+                       sprintf ( text_value, "%d", <xsl:value-of select="$attriName"/> );
+                    </xsl:when>
+
+                    <!-- add char s -->
+                    <xsl:when test="$nativePropertyType='char'">
+                       text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 64);
+                       sprintf ( text_value, "%c", <xsl:value-of select="$attriName"/> );
+                    </xsl:when>
+
+                    <!-- add short s -->
+                    <xsl:when test="$nativePropertyType='short'">
+                       text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 64);
+                       sprintf ( text_value, "%d", <xsl:value-of select="$attriName"/> );
+                    </xsl:when>
+
+                    <!-- add long s -->
+                    <xsl:when test="$nativePropertyType='long'">
+                       text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 64);
+                       sprintf ( text_value, "%d", (int)<xsl:value-of select="$attriName"/> );
+                    </xsl:when>
+
+                    <!-- add float s -->
+                    <xsl:when test="$nativePropertyType='float'">
+                       text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 64);
+                       sprintf ( text_value, "%f", <xsl:value-of select="$attriName"/> );
+                    </xsl:when>
+
+                    <!-- add double s -->
+                    <xsl:when test="$nativePropertyType='double'">
+                       text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 64);
+                       sprintf ( text_value, "%f", <xsl:value-of select="$attriName"/> );
+                    </xsl:when>
+
+                    <!-- add axis2_char_t* s -->
+                    <xsl:when test="$nativePropertyType='axis2_char_t*'">
+                       text_value = (axis2_char_t*)axutil_strdup(env, <xsl:value-of select="$attriName"/>);
+                    </xsl:when>
+
+                    <!-- add axis2_uri_t s -->
+                    <xsl:when test="$nativePropertyType='axutil_uri_t*'">
+                       text_value = axutil_uri_to_string(<xsl:value-of select="$attriName"/>, env, AXIS2_URI_UNP_OMITUSERINFO);
+                    </xsl:when>
+
+                    <!-- add axis2_qname_t s -->
+                    <xsl:when test="$nativePropertyType='axutil_qname_t*'">
+                       text_value = AXIS2_QNAME_TO_STRING(<xsl:value-of select="$attriName"/>, env);
+                    </xsl:when>
+
+                    <!-- add axis2_bool_t s -->
+                    <xsl:when test="$nativePropertyType='axis2_bool_t'">
+                       <!--text_value = (<xsl:value-of select="$attriName"/>)?"true":"false";-->
+                       text_value = (axis2_char_t*)axutil_strdup(env, (<xsl:value-of select="$attriName"/>)?"true":"false");
+                    </xsl:when>
+                    <!-- add axis2_date_time_t s -->
+                    <xsl:when test="$nativePropertyType='axutil_date_time_t*'">
+                       text_value =  axutil_date_time_serialize_date_time( <xsl:value-of select="$attriName"/>, env);
+                    </xsl:when>
+                    <!-- add axis2_base64_binary_t s -->
+                    <xsl:when test="$nativePropertyType='axutil_base64_binary_t*'">
+                       text_value =  axutil_base64_binary_get_encoded_binary( <xsl:value-of select="$attriName"/>, env);
+                    </xsl:when>
+                    <xsl:when test="@ours">
+                        <!-- This should be in an unreachable path -->
+                    </xsl:when>
+                    <xsl:otherwise>
+                      <!--TODO: add new attributes types -->
+                      /** can not handle the attribute type <xsl:value-of select="$nativePropertyType"/>*/
+                      text_value = NULL;
+                    </xsl:otherwise>
+                  </xsl:choose>
+                </xsl:for-each>
+                return text_value;
+            }
+        </xsl:if>
+        
         axiom_node_t* AXIS2_CALL
         <xsl:value-of select="$axis2_name"/>_serialize(
                 <xsl:value-of select="$axis2_name"/>_t*<xsl:text> </xsl:text><xsl:value-of select="$name"/>,
-                const axutil_env_t *env, axiom_node_t* parent, int has_parent)
+                const axutil_env_t *env, axiom_node_t* parent, int has_parent, int tag_closed)
         {
-            <!-- first declration part -->
-            axiom_namespace_t *ns1 = NULL;
+            <!-- first declaration part -->
             <xsl:for-each select="property/@attribute">
              <xsl:if test="position()=1">
                axiom_attribute_t *text_attri = NULL;
                axiom_element_t *parent_element = NULL;
              </xsl:if>
             </xsl:for-each>
+            <xsl:if test="@type">
+             axis2_char_t *string_to_stream;
+            </xsl:if>
+         <!--now distinguise the properties specific to simple types -->
+         <xsl:choose>
+           <xsl:when test="@simple">
+            axiom_node_t *current_node = NULL;
+            axiom_data_source_t *data_source = NULL;
+            axutil_stream_t *stream = NULL;
+            axis2_char_t *text_value;
+            <xsl:for-each select="property/@attribute">
+             <xsl:if test="position()=1">
+               axiom_namespace_t *ns1 = NULL;
+             </xsl:if>
+            </xsl:for-each>
+           </xsl:when>
+
+           <!-- non simple types -->
+           <xsl:otherwise>
+            <xsl:for-each select="property">
+              <xsl:if test="position()=1"> <!-- check for at least one element exists -->
+                axiom_namespace_t *ns1 = NULL;
+              </xsl:if>
+            </xsl:for-each>
             <xsl:for-each select="property/@isarray">
              <xsl:if test="position()=1">
                long i = 0;
@@ -1307,11 +1584,6 @@
                void *element = NULL;
              </xsl:if>
             </xsl:for-each>
-            <xsl:for-each select="property/@attribute">
-             <xsl:if test="position()=1">
-               axis2_char_t *text_value;
-             </xsl:if>
-            </xsl:for-each>
             <xsl:for-each select="property">
                 <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable>
                 <xsl:choose>
@@ -1339,21 +1611,35 @@
              </xsl:if>
             </xsl:for-each>
         <!--remove end-->
+            
+            <xsl:for-each select="property/@attribute">
+             <xsl:if test="position()=1">
+                axis2_char_t *text_value = NULL;
+             </xsl:if>
+            </xsl:for-each>
             <xsl:if test="property and (not(property/@attribute) or property/@attribute='' or property/@notattribute)">
                axiom_node_t *current_node = NULL;
                axiom_element_t *current_element = NULL;
-               axiom_data_source_t *data_source = NULL;
-               axutil_stream_t *stream = NULL;
                axis2_char_t *start_input_str = NULL;
                axis2_char_t *end_input_str = NULL;
                unsigned int start_input_str_len = 0;
                unsigned int end_input_str_len = 0;
             </xsl:if>
+            <!-- Following is in special situatioin where no properties exist -->
+            <xsl:if test="(property and (not(property/@attribute) or property/@attribute='' or property/@notattribute)) or count(property)=0"> 
+               axiom_data_source_t *data_source = NULL;
+               axutil_stream_t *stream = NULL;
+            </xsl:if>
             AXIS2_ENV_CHECK(env, NULL);
 
-            ns1 = axiom_namespace_create (env,
+            
+            <xsl:for-each select="property">
+              <xsl:if test="position()=1"> <!-- check for at least one element exists -->
+                ns1 = axiom_namespace_create (env,
                                          "<xsl:value-of select="$nsuri"/>",
                                          "<xsl:value-of select="$nsprefix"/>");
+               </xsl:if>
+            </xsl:for-each>
             <xsl:if test="not(@type)">
               <xsl:for-each select="property">
                <xsl:if test="position()=1">
@@ -1372,12 +1658,10 @@
                </xsl:if>
               </xsl:for-each>
             </xsl:if>
-            <xsl:for-each select="property/@attribute">
-             <xsl:if test="position()=1">
-                 parent_element = (axiom_element_t *)axiom_node_get_data_element( parent, env);
-             </xsl:if>
-            </xsl:for-each>
-            <xsl:if test="property and (not(property/@attribute) or property/@attribute='' or property/@notattribute)">
+            </xsl:otherwise> <!--otherwise for @simple -->
+            </xsl:choose>
+
+            <xsl:if test="@simple or (property and (not(property/@attribute) or property/@attribute='' or property/@notattribute)) or count(property)=0">
                 if(has_parent)
                 {
                     data_source = (axiom_data_source_t *)axiom_node_get_data_element(parent, env);
@@ -1386,16 +1670,34 @@
                     stream = axiom_data_source_get_stream(data_source, env); /* assume parent is of type data source */
                     if (!stream)
                         return NULL;
-                    current_node = parent;
+                    <xsl:if test="count(property)!=0">
+                      current_node = parent;
+                    </xsl:if>
                 }
+                <xsl:if test="count(property)!=0">
                 else
                 {
                     data_source = axiom_data_source_create(env, parent, &amp;current_node);
                     stream = axiom_data_source_get_stream(data_source, env);
                 }
+                </xsl:if>
              </xsl:if>
 
 
+            <xsl:for-each select="property/@attribute">
+             <xsl:if test="position()=1">
+                parent_element = (axiom_element_t *)axiom_node_get_data_element( parent, env);
+                ns1 = axiom_namespace_create (env,
+                                         "<xsl:value-of select="$nsuri"/>",
+                                         "<xsl:value-of select="$nsprefix"/>");
+             </xsl:if>
+            </xsl:for-each>
+            
+            <!--first write attributes tothe parent-->
+            <xsl:if test="count(property[@attribute])!=0 or @type">
+            if(!tag_closed)
+            {
+            </xsl:if>
             <xsl:for-each select="property">
               <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable>
               <xsl:variable name="propertyType">
@@ -1412,22 +1714,207 @@
                    <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
-              <xsl:variable name="capspropertyType">
+              <xsl:variable name="nativePropertyType"> <!--these are used in arrays to take the native type-->
                  <xsl:choose>
-                   <xsl:when test="@isarray">AXUTIL_ARRAY_LIST</xsl:when>
-                   <xsl:when test="not(@type)">AXIOM_NODE</xsl:when> <!-- these are anonymous -->
+                   <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
                    <xsl:when test="@ours"><xsl:choose>
                     <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
-                    ADB_<xsl:value-of select="@caps-type"/></xsl:when>
-                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">AXUTIL_<xsl:value-of select="@caps-type"/></xsl:when>
+                    adb_<xsl:value-of select="@type"/>_t*</xsl:when>
+                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">axutil_<xsl:value-of select="@type"/>_t*</xsl:when>
                     <xsl:otherwise>
-                    AXIS2_<xsl:value-of select="@caps-type"/></xsl:otherwise>
+                    axis2_<xsl:value-of select="@type"/>_t*</xsl:otherwise>
                 </xsl:choose></xsl:when>
-                   <xsl:otherwise><xsl:value-of select="@caps-type"/></xsl:otherwise> <!-- this will not be used -->
+                   <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
-              <xsl:variable name="nativePropertyType"> <!--these are used in arrays to take the native type-->
+              <xsl:variable name="propertyName"><xsl:value-of select="@originalName"></xsl:value-of></xsl:variable>
+              <xsl:variable name="CName"><xsl:value-of select="@cname"></xsl:value-of></xsl:variable>
+
+              <xsl:variable name="attriName"><!--these are used in arrays to take the native type-->
+                 <xsl:choose>
+                   <xsl:when test="@isarray">(<xsl:value-of select="$nativePropertyType"/>)element</xsl:when>
+                   <xsl:otherwise><xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/></xsl:otherwise>
+                 </xsl:choose>
+              </xsl:variable>
+              <xsl:variable name="justAttriName"><!--these are used in arrays to take the native type-->
+                 <xsl:choose>
+                   <xsl:when test="@isarray">element</xsl:when>
+                   <xsl:otherwise><xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/></xsl:otherwise>
+                 </xsl:choose>
+              </xsl:variable>
+
+              <xsl:variable name="namespacePrefix">
+                <xsl:choose>
+                    <xsl:when test="$nsprefix">
+                        <xsl:value-of select="$nsprefix"/><xsl:text>:</xsl:text>
+                    </xsl:when>
+                    <xsl:otherwise>
+                        <xsl:text></xsl:text>
+                    </xsl:otherwise>
+                </xsl:choose>
+              </xsl:variable>
+
+                <xsl:if test="@attribute">
+                      <!-- here only simple type possible -->
+                      <!-- 64 bytes is used to the store the string representation of the number and the namespace prefix + ":" -->
+                      <xsl:choose>
+                        <!-- add int s -->
+                        <xsl:when test="$nativePropertyType='int'">
+                           text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>")));
+                           sprintf(text_value, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%d\"", <xsl:value-of select="$attriName"/> );
+                           axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
+                           AXIS2_FREE( env-> allocator, text_value);
+                        </xsl:when>
+
+                        <!-- add int s -->
+                        <xsl:when test="$nativePropertyType='char'">
+                           text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>")));
+                           sprintf(text_value, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%c\"", <xsl:value-of select="$attriName"/> );
+                           axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
+                           AXIS2_FREE( env-> allocator, text_value);
+                        </xsl:when>
+
+                        <!-- add short s -->
+                        <xsl:when test="$nativePropertyType='short'">
+                           text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>")));
+                           sprintf(text_value, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%d\"", <xsl:value-of select="$attriName"/> );
+                           axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
+                           AXIS2_FREE( env-> allocator, text_value);
+                        </xsl:when>
+
+                        <!-- add long s -->
+                        <xsl:when test="$nativePropertyType='long'">
+                           text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>")));
+                           sprintf(text_value, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%d\"", <xsl:value-of select="$attriName"/> );
+                           axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
+                           AXIS2_FREE( env-> allocator, text_value);
+                        </xsl:when>
+
+                        <!-- add float s -->
+                        <xsl:when test="$nativePropertyType='float'">
+                           text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>")));
+                           sprintf(text_value, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%f\"", <xsl:value-of select="$attriName"/> );
+                           axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
+                           AXIS2_FREE( env-> allocator, text_value);
+                        </xsl:when>
+
+                        <!-- add double s -->
+                        <xsl:when test="$nativePropertyType='double'">
+                           text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>")));
+                           sprintf(text_value, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%f\"", <xsl:value-of select="$attriName"/> );
+                           axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
+                           AXIS2_FREE( env-> allocator, text_value);
+                        </xsl:when>
+
+                        <!-- add axis2_char_t s -->
+                        <xsl:when test="$nativePropertyType='axis2_char_t*'">
+                           text_value = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) * 
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>" +
+                                                             strlen(<xsl:value-of select="$attriName"/>))));
+                           sprintf(text_value, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%s\"", <xsl:value-of select="$attriName"/> );
+                           axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
+                           AXIS2_FREE( env-> allocator, text_value);
+                        </xsl:when>
+
+                        <!-- add axis2_uri_t s -->
+                        <xsl:when test="$nativePropertyType='axutil_uri_t*'">
+                           text_value = axutil_uri_to_string(<xsl:value-of select="$attriName"/>, env, AXIS2_URI_UNP_OMITUSERINFO);
+                           string_to_stream = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) *
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>" +
+                                                             strlen(text_value))));
+                           sprintf(string_to_stream, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%s\"", text_value );
+                           axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
+                           AXIS2_FREE( env-> allocator, string_to_stream);
+                        </xsl:when>
+
+                        <!-- add axis2_qname_t s -->
+                        <xsl:when test="$nativePropertyType='axutil_qname_t*'">
+                           text_value = AXIS2_QNAME_TO_STRING(<xsl:value-of select="$attriName"/>, env);
+                           string_to_stream = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) *
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>" +
+                                                             strlen(text_value))));
+                           sprintf(string_to_stream, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%s\"", text_value );
+                           axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
+                           AXIS2_FREE( env-> allocator, string_to_stream);
+                        </xsl:when>
+
+                        <!-- add axis2_bool_t s -->
+                        <xsl:when test="$nativePropertyType='axis2_bool_t'">
+                           <!--text_value = (<xsl:value-of select="$attriName"/>)?"true":"false";-->
+                           text_value = (<xsl:value-of select="$attriName"/>)?"true":"false";
+                           string_to_stream = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) *
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>" +
+                                                             strlen(text_value))));
+                           sprintf(string_to_stream, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%s\"", text_value );
+                           axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
+                           AXIS2_FREE( env-> allocator, string_to_stream);
+                        </xsl:when>
+                        <!-- add axis2_date_time_t s -->
+                        <xsl:when test="$nativePropertyType='axutil_date_time_t*'">
+                           text_value =  axutil_date_time_serialize_date_time( <xsl:value-of select="$attriName"/>, env);
+                           string_to_stream = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) *
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>" +
+                                                             strlen(text_value))));
+                           sprintf(string_to_stream, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%s\"", text_value );
+                           axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
+                           AXIS2_FREE( env-> allocator, string_to_stream);
+                        </xsl:when>
+                        <!-- add axis2_base64_binary_t s -->
+                        <xsl:when test="$nativePropertyType='axutil_base64_binary_t*'">
+                           text_value =  axutil_base64_binary_get_encoded_binary( <xsl:value-of select="$attriName"/>, env);
+                           string_to_stream = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) *
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>" +
+                                                             strlen(text_value))));
+                           sprintf(string_to_stream, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%s\"", text_value );
+                           axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
+                           AXIS2_FREE( env-> allocator, string_to_stream);
+                        </xsl:when>
+                        <xsl:when test="@ours">
+                           text_value = adb_<xsl:value-of select="@type"/>_serialize_to_string(<xsl:value-of select="$attriName"/>, env);
+                           string_to_stream = (axis2_char_t*) AXIS2_MALLOC ( env-> allocator, sizeof ( axis2_char_t) *
+                                                            (64 + strlen("<xsl:value-of select="$propertyName"/>" +
+                                                             strlen(text_value))));
+                           sprintf(string_to_stream, " <xsl:value-of select="$namespacePrefix"/><xsl:value-of select="$propertyName"/>=\"%s\"", text_value );
+                           axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
+                           AXIS2_FREE( env-> allocator, string_to_stream);
+                           AXIS2_FREE( env-> allocator, text_value);
+                        </xsl:when>
+                        <xsl:otherwise>
+                          <!--TODO: add new attributes types -->
+                          /** can not handle the attribute type <xsl:value-of select="$nativePropertyType"/>*/
+                           text_value = NULL;
+                        </xsl:otherwise>
+                      </xsl:choose>
+                </xsl:if>
+            </xsl:for-each>
+
+            <xsl:if test="@type">
+             string_to_stream = "&gt;"; <!-- The ending tag of the parent -->
+             axutil_stream_write(stream, env, string_to_stream, axutil_strlen(string_to_stream));
+            </xsl:if>
+             <!-- end bracket for if(!tag_closed)-->
+            <xsl:if test="count(property[@attribute])!=0 or @type">
+            }
+            </xsl:if>
+
+            <xsl:if test="@simple">
+               
+               text_value = <xsl:value-of select="$axis2_name"/>_serialize_to_string(<xsl:value-of select="$name"/>, env);
+               axutil_stream_write(stream, env, text_value, axutil_strlen(text_value));
+
+            </xsl:if>
+
+            <xsl:for-each select="property">
+              <xsl:variable name="position"><xsl:value-of select="position()"/></xsl:variable>
+              <xsl:variable name="propertyType">
                  <xsl:choose>
+                   <xsl:when test="@isarray">axutil_array_list_t*</xsl:when>
                    <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
                    <xsl:when test="@ours"><xsl:choose>
                     <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
@@ -1439,17 +1926,17 @@
                    <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
-              <xsl:variable name="nativeCapspropertyType"><!--these are used in arrays to take the native type-->
+              <xsl:variable name="nativePropertyType"> <!--these are used in arrays to take the native type-->
                  <xsl:choose>
-                   <xsl:when test="not(@type)">AXIOM_NODE</xsl:when> <!-- these are anonymous -->
+                   <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
                    <xsl:when test="@ours"><xsl:choose>
                     <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
-                    ADB_<xsl:value-of select="@caps-type"/></xsl:when>
-                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">AXUTIL_<xsl:value-of select="@caps-type"/></xsl:when>
+                    adb_<xsl:value-of select="@type"/>_t*</xsl:when>
+                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">axutil_<xsl:value-of select="@type"/>_t*</xsl:when>
                     <xsl:otherwise>
-                    AXIS2_<xsl:value-of select="@caps-type"/></xsl:otherwise>
+                    axis2_<xsl:value-of select="@type"/>_t*</xsl:otherwise>
                 </xsl:choose></xsl:when>
-                   <xsl:otherwise><xsl:value-of select="@caps-type"/></xsl:otherwise> <!-- this will not be used -->
+                   <xsl:otherwise><xsl:value-of select="@type"/></xsl:otherwise>
                  </xsl:choose>
               </xsl:variable>
               <xsl:variable name="propertyName"><xsl:value-of select="@originalName"></xsl:value-of></xsl:variable>
@@ -1471,6 +1958,8 @@
               <xsl:choose>
                 <xsl:when test="@attribute">
                       <!-- here only simple type possible -->
+                      if(tag_closed)
+                      {
                       <xsl:choose>
                         <!-- add int s -->
                         <xsl:when test="$nativePropertyType='int'">
@@ -1560,21 +2049,29 @@
                            text_attri = axiom_attribute_create (env, "<xsl:value-of select="$propertyName"/>", text_value, ns1);
                            axiom_element_add_attribute (parent_element, env, text_attri, parent);
                         </xsl:when>
-                        <!-- add axis2_base64_binary_t s -->
+                       <!-- add axis2_base64_binary_t s -->
                         <xsl:when test="$nativePropertyType='axutil_base64_binary_t*'">
                            text_value =  axutil_base64_binary_get_encoded_binary( <xsl:value-of select="$attriName"/>, env);
                            text_attri = axiom_attribute_create (env, "<xsl:value-of select="$propertyName"/>", text_value, ns1);
                            axiom_element_add_attribute (parent_element, env, text_attri, parent);
                         </xsl:when>
+                        <xsl:when test="@ours">
+                           text_value = adb_<xsl:value-of select="@type"/>_serialize_to_string(<xsl:value-of select="$attriName"/>, env);
+                           text_attri = axiom_attribute_create (env, "<xsl:value-of select="$propertyName"/>", text_value, ns1);
+                           axiom_element_add_attribute (parent_element, env, text_attri, parent);
+                           AXIS2_FREE( env-> allocator, text_value);
+                        </xsl:when>
                         <xsl:otherwise>
                           <!--TODO: add new attributes types -->
                           /** can not handle the attribute type <xsl:value-of select="$nativePropertyType"/>*/
-                          text_value = NULL;
-                          parent_element = NULL;
-                          text_attri = NULL;
+                           text_value = NULL;
+                           parent_element = NULL;
+                           text_attri = NULL;
                         </xsl:otherwise>
                       </xsl:choose>
+                      } <!-- End bracket for if(tag_closed)-->
                 </xsl:when>
+                <xsl:when test="../@simple"></xsl:when> <!--Just to ignore parsing following code at simple types-->
                 <xsl:otherwise>
 
                    <!-- handles arrays -->
@@ -1586,7 +2083,14 @@
                       */
                      if ( <xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/> != NULL)
                      {
+                        <xsl:choose>
+                            <xsl:when test="@ours">
+                         start_input_str = "&lt;<xsl:value-of select="$nsprefix"/>:<xsl:value-of select="$propertyName"/><xsl:if test="@child-nsuri and @child-nsprefix and @ours"> xmlns:<xsl:value-of select="@child-nsprefix"/>=\"<xsl:value-of select="@child-nsuri"/>\"</xsl:if>";
+                            </xsl:when>
+                            <xsl:otherwise>
                          start_input_str = "&lt;<xsl:value-of select="$nsprefix"/>:<xsl:value-of select="$propertyName"/><xsl:if test="@child-nsuri and @child-nsprefix and @ours"> xmlns:<xsl:value-of select="@child-nsprefix"/>=\"<xsl:value-of select="@child-nsuri"/>\"</xsl:if>&gt;";
+                            </xsl:otherwise>
+                        </xsl:choose>
                          start_input_str_len = axutil_strlen(start_input_str);
                          end_input_str = "&lt;/<xsl:value-of select="$nsprefix"/>:<xsl:value-of select="$propertyName"/>&gt;";
                          end_input_str_len = axutil_strlen(end_input_str);
@@ -1604,7 +2108,14 @@
 
                     <!-- how to build all the ours things -->
                     <xsl:if test="not(@isarray)">
+                        <xsl:choose>
+                            <xsl:when test="@ours">
+                        start_input_str = "&lt;<xsl:value-of select="$nsprefix"/>:<xsl:value-of select="$propertyName"/><xsl:if test="@child-nsuri and @child-nsprefix and @ours"> xmlns:<xsl:value-of select="@child-nsprefix"/>=\"<xsl:value-of select="@child-nsuri"/>\"</xsl:if>";
+                            </xsl:when>
+                            <xsl:otherwise>
                         start_input_str = "&lt;<xsl:value-of select="$nsprefix"/>:<xsl:value-of select="$propertyName"/><xsl:if test="@child-nsuri and @child-nsprefix and @ours"> xmlns:<xsl:value-of select="@child-nsprefix"/>=\"<xsl:value-of select="@child-nsuri"/>\"</xsl:if>&gt;";
+                            </xsl:otherwise>
+                        </xsl:choose>
                         start_input_str_len = axutil_strlen(start_input_str);
                         end_input_str = "&lt;/<xsl:value-of select="$nsprefix"/>:<xsl:value-of select="$propertyName"/>&gt;";
                         end_input_str_len = axutil_strlen(end_input_str);
@@ -1612,10 +2123,26 @@
 
                     <xsl:choose>
                         <xsl:when test="@ours">
-                            <xsl:if test="$anon or $istype">
+                            <xsl:if test="$anon or $istype"> <!-- As this shows, elements are not writing their tags here from stream.
+                                                                 It is done using axiom above..-->
                             axutil_stream_write(stream, env, start_input_str, start_input_str_len);
                             </xsl:if>
-                            adb_<xsl:value-of select="@type"/>_serialize( <xsl:value-of select="$attriName"/>, env, current_node, AXIS2_TRUE);
+                            
+                            <xsl:variable name="element_closed">
+                                <xsl:choose>
+                                    <xsl:when test="../@type"> 
+                                        AXIS2_FALSE
+                                    </xsl:when>
+                                    <xsl:when test="$anon or $istype"> <!-- this mean the anonymous header is writing -->
+                                        AXIS2_FALSE
+                                    </xsl:when>
+                                    <xsl:otherwise>
+                                        AXIS2_TRUE
+                                    </xsl:otherwise>
+                                </xsl:choose>
+                            </xsl:variable>
+                            adb_<xsl:value-of select="@type"/>_serialize(<xsl:value-of select="$attriName"/>, env, current_node,
+                                                                                 AXIS2_TRUE, <xsl:value-of select="$element_closed"/>);
                             <xsl:if test="$anon or $istype">
                             axutil_stream_write(stream, env, end_input_str, end_input_str_len);
                             </xsl:if>
@@ -1865,6 +2392,7 @@
             return parent;
         }
 
+
         <xsl:for-each select="property">
             <xsl:variable name="propertyType">
                <xsl:choose>
@@ -1882,7 +2410,57 @@
             </xsl:variable>
             <xsl:variable name="propertyName"><xsl:value-of select="@name"></xsl:value-of></xsl:variable>
             <xsl:variable name="CName"><xsl:value-of select="@cname"></xsl:value-of></xsl:variable>
+           
+           <xsl:variable name="nativePropertyType"> <!--these are used in arrays to take the native type-->
+                 <xsl:choose>
+                   <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
+                   <xsl:when test="@ours">
+                    <xsl:choose>
+                    <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
+                     adb_<xsl:value-of select="@type"/>_t*</xsl:when>
+                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">
+                     axutil_<xsl:value-of select="@type"/>_t*
+                    </xsl:when>
+                    <xsl:otherwise>
+                     axis2_<xsl:value-of select="@type"/>_t*
+                    </xsl:otherwise>
+                    </xsl:choose>
+                   </xsl:when>
+                   <xsl:otherwise>
+                    <xsl:value-of select="@type"/>
+                   </xsl:otherwise>
+                 </xsl:choose>
+              </xsl:variable>
+
+              <!-- Just to identiy the pointer to arrays -->
+              <!-- Simmilar to native property type except for shor, tint, float, double -->
+              <xsl:variable name="PropertyTypeArrayParam"> <!--these are used in arrays to take the native type-->
+                 <xsl:choose>
+                   <xsl:when test="not(@type)">axiom_node_t*</xsl:when> <!-- these are anonymous -->
+                   <xsl:when test="@ours">
+                    <xsl:choose>
+                    <xsl:when test="not(@type='char' or @type='bool' or @type='date_time' or @type='duration')">
+                     adb_<xsl:value-of select="@type"/>_t*</xsl:when>
+                    <xsl:when test="@type='duration' or @type='date_time' or @type='uri' or @type='qname' or @type='base64_binary'">
+                     axutil_<xsl:value-of select="@type"/>_t*
+                    </xsl:when>
+                    <xsl:otherwise>
+                     axis2_<xsl:value-of select="@type"/>_t*
+                    </xsl:otherwise>
+                    </xsl:choose>
+                   </xsl:when>
+                   <xsl:when test="@type='short' or @type='char' or @type='int' or @type='float' or @type='double' or @type='long'">
+                    <xsl:value-of select="@type"/><xsl:text>*</xsl:text>
+                   </xsl:when>
+                   <xsl:otherwise>
+                    <xsl:value-of select="@type"/>
+                   </xsl:otherwise>
+                 </xsl:choose>
+              </xsl:variable>
 
+              <xsl:variable name="attriName"><!--these are used in arrays to take the native type-->
+                   <xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/>
+              </xsl:variable>
             /**
              * getter for <xsl:value-of select="$propertyName"/>.
              */
@@ -1893,7 +2471,7 @@
              {
                 AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-                return <xsl:value-of select="$name"/>-> attrib_<xsl:value-of select="$CName"/>;
+                return <xsl:value-of select="$attriName"/>;
              }
 
             /**
@@ -1915,7 +2493,7 @@
                     return AXIS2_FAILURE;
                 }
 
-                <xsl:if test="@isarray">
+                 <xsl:if test="@isarray">
                   size = axutil_array_list_size( param_<xsl:value-of select="$CName"/>, env);
                   <xsl:if test="not(@unbound)">
                       if ( size &gt; <xsl:value-of select="@maxOccurs"/> )
@@ -1943,12 +2521,15 @@
                       return AXIS2_FAILURE;
                   }
                 </xsl:if>
+                <xsl:if test="@isarray">
+                <xsl:value-of select="$axis2_name"/>_reset_<xsl:value-of select="$CName"/>(<xsl:value-of select="$name"/>, env);
+                </xsl:if>
                 <xsl:choose>
                     <xsl:when test="@type='axis2_char_t*' and not(@isarray)">
-                        <xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/> = (axis2_char_t *)axutil_strdup(env, param_<xsl:value-of select="$CName"/>);
+                        <xsl:value-of select="$attriName"/> = (axis2_char_t *)axutil_strdup(env, param_<xsl:value-of select="$CName"/>);
                     </xsl:when>
                     <xsl:otherwise>
-                        <xsl:value-of select="$name"/>->attrib_<xsl:value-of select="$CName"/> = param_<xsl:value-of select="$CName"/>;
+                        <xsl:value-of select="$attriName"/> = param_<xsl:value-of select="$CName"/>;
                     </xsl:otherwise>
                 </xsl:choose>
                 return AXIS2_SUCCESS;
@@ -1956,6 +2537,96 @@
 
             <xsl:if test="@isarray">
             /**
+             * Get ith element of <xsl:value-of select="$propertyName"/>.
+             */
+            <xsl:value-of select="$nativePropertyType"/> AXIS2_CALL
+            <xsl:value-of select="$axis2_name"/>_get_<xsl:value-of select="$CName"/>_at(
+                    <xsl:value-of select="$axis2_name"/>_t*<xsl:text> </xsl:text><xsl:value-of select="$name"/>,
+                    const axutil_env_t *env, int i)
+            {
+                <xsl:value-of select="$PropertyTypeArrayParam"/> ret_val;
+                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+                if(<xsl:value-of select="$attriName"/> == NULL)
+                {
+                    return (<xsl:value-of select="$nativePropertyType"/>)NULL;
+                }
+                ret_val = (<xsl:value-of select="$PropertyTypeArrayParam"/>)axutil_array_list_get(<xsl:value-of select="$attriName"/>, env, i);
+                <xsl:choose>
+                  <xsl:when test="@type='short' or @type='char' or @type='int' or @type='float' or @type='double' or @type='long'">
+                    return *ret_val;
+                  </xsl:when>
+                  <xsl:otherwise>
+                    return ret_val;
+                  </xsl:otherwise>
+                </xsl:choose>
+            }
+
+            /**
+             * Add to <xsl:value-of select="$propertyName"/>.
+             */
+            axis2_status_t AXIS2_CALL
+            <xsl:value-of select="$axis2_name"/>_add_<xsl:value-of select="$CName"/>(
+                    <xsl:value-of select="$axis2_name"/>_t*<xsl:text> </xsl:text><xsl:value-of select="$name"/>,
+                    const axutil_env_t *env,
+                    <xsl:value-of select="$nativePropertyType"/><xsl:text> param_</xsl:text> <xsl:value-of select="$CName"/>)
+             {
+                <xsl:if test="@type='short' or @type='char' or @type='int' or @type='float' or @type='double' or @type='long'">
+                   <xsl:value-of select="$PropertyTypeArrayParam"/><xsl:text> ptr_param_</xsl:text><xsl:value-of select="$CName"/>;
+                </xsl:if>
+
+                AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+                if(<xsl:value-of select="$attriName"/> == NULL)
+                {
+                    <xsl:value-of select="$attriName"/> = axutil_array_list_create(env, 10);
+                }
+                if(<xsl:value-of select="$attriName"/> == NULL)
+                {
+                    AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "cannot allocate memory for <xsl:value-of select="$propertyName"/>"
+                                               " %d :: %s", env->error->error_number,
+                                               AXIS2_ERROR_GET_MESSAGE(env->error));
+                    return AXIS2_FAILURE;
+                    
+                }
+                <xsl:choose>
+                  <xsl:when test="@type='short' or @type='char' or @type='int' or @type='float' or @type='double' or @type='long'">
+                   <xsl:text>ptr_param_</xsl:text><xsl:value-of select="$CName"/> =  (<xsl:value-of select="$PropertyTypeArrayParam"/>)
+                            AXIS2_MALLOC(env->allocator, sizeof(<xsl:value-of select="@type"/>));
+                   if(<xsl:value-of select="$attriName"/> == NULL)
+                   {
+                       AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "cannot allocate memory for new value of <xsl:value-of select="$propertyName"/>"
+                                                  " %d :: %s", env->error->error_number,
+                                                  AXIS2_ERROR_GET_MESSAGE(env->error));
+                       return AXIS2_FAILURE;
+                       
+                   }
+                   <xsl:text>*ptr_param_</xsl:text><xsl:value-of select="$CName"/> = <xsl:text>param_</xsl:text><xsl:value-of select="$CName"/>;
+                   axutil_array_list_add(<xsl:value-of select="$attriName"/> , env, <xsl:text>ptr_param_</xsl:text><xsl:value-of select="$CName"/>);
+                  </xsl:when>
+                  <xsl:otherwise>
+                   axutil_array_list_add(<xsl:value-of select="$attriName"/> , env, <xsl:text>param_</xsl:text><xsl:value-of select="$CName"/>);
+                  </xsl:otherwise>
+                </xsl:choose>
+                return AXIS2_SUCCESS;
+             }
+
+            /**
+             * Get the size of the <xsl:value-of select="$propertyName"/> array.
+             */
+            int AXIS2_CALL
+            <xsl:value-of select="$axis2_name"/>_sizeof_<xsl:value-of select="$CName"/>(
+                    <xsl:value-of select="$axis2_name"/>_t*<xsl:text> </xsl:text><xsl:value-of select="$name"/>,
+                    const axutil_env_t *env)
+            {

[... 92 lines stripped ...]


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org