Author: keith Date: Sun Dec 9 23:39:15 2007 New Revision: 10770 Log:
Fixing E4X stubs (need to convert the returned response to E4X before performing E4X operations) Modified: trunk/commons/dynamic-codegen/src/jsstub.xslt Modified: trunk/commons/dynamic-codegen/src/jsstub.xslt ============================================================================== --- trunk/commons/dynamic-codegen/src/jsstub.xslt (original) +++ trunk/commons/dynamic-codegen/src/jsstub.xslt Sun Dec 9 23:39:15 2007 @@ -705,7 +705,9 @@ <xsl:template match="[EMAIL PROTECTED]@type-namespace = 'http://www.w3.org/2001/XMLSchema' and ( @type = 'anyType' )]" mode="convert"> <xsl:choose> - <xsl:when test="$e4x"> resultValue = /* xs:anyType */ convertJSType(response["<xsl:value-of select="@name"/>"].*, true); + <xsl:when test="$e4x"> + var responseXML = new XML(WSRequest.util._serializeToString(response)); + resultValue = /* xs:anyType */ convertJSType((responseXML["<xsl:value-of select="@name"/>"]).*, true); </xsl:when> <xsl:otherwise> resultValue = /* xs:anyType */ convertJSType(response.documentElement.firstChild, true); </xsl:otherwise> @@ -716,7 +718,9 @@ <xsl:template match="param[not(@name)[EMAIL PROTECTED] = 'http://www.w3.org/2001/XMLSchema' and ( @type = 'anyType' )]" mode="convert"> <xsl:choose> - <xsl:when test="$e4x"> resultValue = /* xs:anyType */ convertJSType(response); + <xsl:when test="$e4x"> + var responseXML = new XML(WSRequest.util._serializeToString(response)); + resultValue = /* xs:anyType */ convertJSType(responseXML); </xsl:when> <xsl:otherwise> resultValue = /* xs:anyType */ convertJSType(response.documentElement); </xsl:otherwise> @@ -768,7 +772,8 @@ --> <xsl:template name="extracted-value"> <xsl:choose> - <xsl:when test="$e4x"> var extractedValue = response["<xsl:value-of select="@name"/>"].toString();</xsl:when> + <xsl:when test="$e4x"> + var extractedValue = (response["<xsl:value-of select="@name"/>"]).toString();</xsl:when> <xsl:otherwise> var extractedValue = WSRequest.util._stringValue(response.documentElement);</xsl:otherwise> </xsl:choose> </xsl:template> @@ -777,7 +782,8 @@ <xsl:param name="extraction-code"/> <xsl:choose> <!-- TODO E4X arrays --> - <xsl:when test="$e4x"> var extractedValue = response["<xsl:value-of select="@name"/>"].toString();</xsl:when> + <xsl:when test="$e4x"> + var extractedValue = (response["<xsl:value-of select="@name"/>"]).toString();</xsl:when> <xsl:otherwise> var extractedItems = response.documentElement.childNodes; var extractedValues = new Array(); for (var i=0; i<extractedItems.length; i++) { _______________________________________________ Commons-dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/commons-dev
