[Mashup-dev] [jira] Commented: (MASHUP-882) Return of an xmllist with a single item should be just xml, not xmllist.

Keith Godwin Chapman (JIRA) jira at wso2.org
Wed Jul 2 09:32:35 PDT 2008


    [ https://wso2.org/jira/browse/MASHUP-882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17847#action_17847 ] 

Keith Godwin Chapman commented on MASHUP-882:
---------------------------------------------

Here are two examples,

1. 
test.outputType = "xml";
function test() {
    var x = <root><child/></root>;
    return x.child;
}

2.
test2.outputType = "xml";
function test2() {
    var x = <root><child/><child/></root>;
    return x.child;
}

In 1.0.2

1 returns <ws:testResponse xmlns:ws="http://services.mashup.wso2.org/test?xsd"><return><child /></return></ws:testResponse>

2 returns <ws:test2Response xmlns:ws="http://services.mashup.wso2.org/test?xsd"><return><return><child /><child /></return></return></ws:test2Response>

On trunk 1 returns <ws:testResponse xmlns:ws="http://services.mashup.wso2.org/test?xsd"><return xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:js="http://www.wso2.org/ns/jstype" js:type="xmlList" xsi:type="xs:anyType"><child /></return></ws:testResponse>

and 2 returns <ws:test2Response xmlns:ws="http://services.mashup.wso2.org/test?xsd"><return xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:js="http://www.wso2.org/ns/jstype" js:type="xmlList" xsi:type="xs:anyType"><child /><child /></return></ws:test2Response>

I think the behaviour we have now is correct. The MessageReceiver builds the response based on the XMLSchema. Both "xml" and "xmllist" will produce xs:anyType hence the MR does not know the difference between these annotations. It plainly puts the js:type based on the instance of the object returned. 

If needed we test the length of an xmllist before adding the js:type though. And make it js:type="xml" when the returned xmlList is of length 1.

WDYT?

> Return of an xmllist with a single item should be just xml, not xmllist.
> ------------------------------------------------------------------------
>
>                 Key: MASHUP-882
>                 URL: https://wso2.org/jira/browse/MASHUP-882
>             Project: WSO2 Mashup Server
>          Issue Type: Bug
>            Reporter: Jonathan Marsh
>            Assignee: Keith Godwin Chapman
>             Fix For: 1.1
>
>
> test.outputType = "xml";
> function test() {
>     var x = <root><child/></root>;
>     return x.child;
> }
> In 1.0 this returned js:type="xml".  Now it seems to return js:type="xmllist".  Not backward compatible.
> This doesn't matter in the e4x stub, but in the dom one, the xml element is wrapped in an Array and it must be extracted.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://wso2.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the Mashup-dev mailing list