axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r493640 - /webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Date Sun, 07 Jan 2007 03:58:55 GMT
Author: dims
Date: Sat Jan  6 19:58:55 2007
New Revision: 493640

URL: http://svn.apache.org/viewvc?view=rev&rev=493640
Log:
avoid calling xmlWriter.getPrefix for every element in the array, just call it once

Modified:
    webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl

Modified: webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl?view=diff&rev=493640&r1=493639&r2=493640
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
(original)
+++ webservices/axis2/branches/java/1_1/modules/adb-codegen/src/org/apache/axis2/schema/template/ADBBeanTemplate.xsl
Sat Jan  6 19:58:55 2007
@@ -959,18 +959,18 @@
                         <!-- handle non ADB arrays - Not any however -->
                         <xsl:when test="@array and not(@any)">
                              if (<xsl:value-of select="$varName"/>!=null) {
+                                   namespace = "<xsl:value-of select="$namespace"/>";
+                                   boolean emptyNamespace = namespace == null || namespace.length()
== 0;
+                                   prefix =  emptyNamespace ? null : xmlWriter.getPrefix(namespace);
                                    for (int i = 0;i &lt; <xsl:value-of select="$varName"/>.length;i++){
                                         <xsl:if test="@primitive">
-                                            namespace = "<xsl:value-of select="$namespace"/>";
-                                            if (! namespace.equals("")) {
-                                                prefix = xmlWriter.getPrefix(namespace);
-
+                                            if (!emptyNamespace) {
                                                 if (prefix == null) {
-                                                    prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
+                                                    String prefix2 = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
 
-                                                    xmlWriter.writeStartElement(prefix,"<xsl:value-of
select="$propertyName"/>", namespace);
-                                                    xmlWriter.writeNamespace(prefix, namespace);
-                                                    xmlWriter.setPrefix(prefix, namespace);
+                                                    xmlWriter.writeStartElement(prefix2,"<xsl:value-of
select="$propertyName"/>", namespace);
+                                                    xmlWriter.writeNamespace(prefix2, namespace);
+                                                    xmlWriter.setPrefix(prefix2, namespace);
 
                                                 } else {
                                                     xmlWriter.writeStartElement(namespace,"<xsl:value-of
select="$propertyName"/>");
@@ -985,16 +985,13 @@
                                         </xsl:if>
                                         <xsl:if test="not(@primitive)">
                                             if (<xsl:value-of select="$varName"/>[i]
!= null){
-                                                namespace = "<xsl:value-of select="$namespace"/>";
-                                                if (! namespace.equals("")) {
-                                                    prefix = xmlWriter.getPrefix(namespace);
-
+                                                if (!emptyNamespace) {
                                                     if (prefix == null) {
-                                                        prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
+                                                        String prefix2 = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix();
 
-                                                        xmlWriter.writeStartElement(prefix,"<xsl:value-of
select="$propertyName"/>", namespace);
-                                                        xmlWriter.writeNamespace(prefix,
namespace);
-                                                        xmlWriter.setPrefix(prefix, namespace);
+                                                        xmlWriter.writeStartElement(prefix2,"<xsl:value-of
select="$propertyName"/>", namespace);
+                                                        xmlWriter.writeNamespace(prefix2,
namespace);
+                                                        xmlWriter.setPrefix(prefix2, namespace);
 
                                                     } else {
                                                         xmlWriter.writeStartElement(namespace,"<xsl:value-of
select="$propertyName"/>");



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


Mime
View raw message