make choice element's nillable -- gsoap seems to like it more
authorAleš Křenek <ljocha@ics.muni.cz>
Mon, 30 May 2005 12:54:31 +0000 (12:54 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Mon, 30 May 2005 12:54:31 +0000 (12:54 +0000)
org.glite.lb.ws-interface/src/puke-wsdl.xsl

index 1ca4379..646e845 100644 (file)
 
 
 <xsl:template name="inner-struct">
+       <xsl:variable name="nillable">
+               <xsl:choose>
+                       <xsl:when test="local-name(.)='choice'">true</xsl:when>
+                       <xsl:otherwise>false</xsl:otherwise>
+               </xsl:choose>
+       </xsl:variable>
                        <xsl:for-each select="elem">
                                <xsl:variable name="type">
                                        <xsl:choose>
                                                <xsl:otherwise>1</xsl:otherwise>
                                        </xsl:choose>
                                </xsl:variable>
-                               <xsd:element name="{@name}" type="{$type}" minOccurs="{$min}" maxOccurs="{$max}"/>
+                               <xsd:element name="{@name}" type="{$type}" minOccurs="{$min}" maxOccurs="{$max}" nillable="{$nillable}"/>
                        </xsl:for-each>
 <!--
        <xsd:complexType name="{@name}List">