Author: jonathan
Date: Mon Dec 10 11:06:21 2007
New Revision: 10869
Log:
Backing out Keith's change, moving it deeper into the stub, so whenever we
called .responseXML instead we call new XML (.responseText) to convert directly
to XML.
Fixed a few related unwrapping glitches in the e4x stub.
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 Mon Dec 10 11:06:21 2007
@@ -70,7 +70,10 @@
if (thisRequest.error != null) {
callbacks[1](thisRequest.error);
} else {
- response = thisRequest.responseXML;
+ <xsl:choose>
+ <xsl:when test="$e4x">response = new
XML(thisRequest.responseText);</xsl:when>
+ <xsl:otherwise>response =
thisRequest.responseXML;</xsl:otherwise>
+ </xsl:choose>
if (response == null) {
resultValue = null;
} else {
@@ -283,7 +286,10 @@
if (resultContent == "") {
throw new WebServiceError("No response",
"WebService._call() did not recieve a response to a synchronous request.");
}
- var resultXML = thisRequest.responseXML;
+ <xsl:choose>
+ <xsl:when test="$e4x">var resultXML = new
XML(thisRequest.responseText);</xsl:when>
+ <xsl:otherwise>var resultXML =
thisRequest.responseXML;</xsl:otherwise>
+ </xsl:choose>
} catch (e) {
throw new WebServiceError(e);
}
@@ -301,7 +307,7 @@
var extractedValue = element["<xsl:value-of
select="@name"/>"].toString();
var resultValue, i;
var js = new Namespace("http://www.wso2.org/ns/jstype");
- switch ([EMAIL PROTECTED]::type) {
+ switch ([EMAIL PROTECTED]::type.toString()) {
case "string":
return extractedValue;
break;
@@ -332,8 +338,6 @@
return element.*;
break;
case "xml":
- return WSRequest.util._serializeToString(element[1]);
- break;
default:
if (isWrapped == true)
return element.*;
@@ -345,7 +349,7 @@
if (element == null) return "";
var extractedValue = WSRequest.util._stringValue(element);
var resultValue, i;
- switch (element.getAttribute("js:type")) {
+ switch (element.getAttribute("js:type").toString()) {
case "string":
return extractedValue;
break;
@@ -376,8 +380,6 @@
return element.childNodes;
break;
case "xml":
- return element.firstChild;
- break;
default:
if (isWrapped == true)
return element.firstChild;
@@ -705,9 +707,7 @@
<xsl:template match="[EMAIL PROTECTED]@type-namespace =
'http://www.w3.org/2001/XMLSchema' and
( @type = 'anyType' )]" mode="convert">
<xsl:choose>
- <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 test="$e4x"> resultValue = /* xs:anyType */
convertJSType(response["<xsl:value-of select="@name"/>"], true);
</xsl:when>
<xsl:otherwise> resultValue = /* xs:anyType */
convertJSType(response.documentElement.firstChild, true);
</xsl:otherwise>
@@ -730,7 +730,7 @@
<xsl:template match="[EMAIL PROTECTED] = 'http://www.w3.org/2001/XMLSchema' and
( @type = 'anyType' )]" mode="convert-array">
<xsl:choose>
- <xsl:when test="$e4x"> resultValue = /* xs:anyType */
convertJSType(response["<xsl:value-of select="@name"/>"].*);
+ <xsl:when test="$e4x"> resultValue = /* xs:anyType */
convertJSType(response["<xsl:value-of select="@name"/>"]);
</xsl:when>
<xsl:otherwise> resultValue = /* xs:anyType */
convertJSType(response.documentElement.firstChild);
</xsl:otherwise>
_______________________________________________
Commons-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/commons-dev