[mashup-dev] JavaScript DataBinding Framework

Keith Chapman keith at wso2.com
Thu Aug 16 18:32:41 PDT 2007


Jonathan Marsh wrote:
> Excellent!
>
> Couple of small questions:
>
> 1) xs:ID can still be used with elements, it's only for compatibility
> reasons with DTDs that the spec recommends limiting its use to attributes.
> If you plan to limit xs:ID, you also need to limit xs:NMTOKEN, xs:NMTOKENS,
> xs:IDREF, xs:IDREFS, xs:ENTITY, and xs:ENTITIES, which also recommend that
> they only be used for attributes.  I think I'd rather allow all these types
> to be used.
>
> 2) xs:NOTATION can only be used with an enumeration, and we only support
> enumerations of strings.  So I agree that this type should not be supported.
>
>
> 3) Did I see you change the conversion of Numbers to xs:double instead of
> xs:float?  That's good - my mistake using xs:float in the spec.
>   
Yes I did change it to xs:double.
> Jonathan Marsh - http://www.wso2.com - http://auburnmarshes.spaces.live.com
>  
>
>   
>> -----Original Message-----
>> From: mashup-dev-bounces at wso2.org [mailto:mashup-dev-bounces at wso2.org]
>> On Behalf Of Keith Chapman
>> Sent: Wednesday, August 15, 2007 2:09 AM
>> To: mashup-dev at wso2.org
>> Subject: [mashup-dev] JavaScript DataBinding Framework
>>
>> Hi all,
>>
>> The implementation of JavaScript DataBinding (in line with Jonathan's
>> proposal at
>> http://wso2.org/repos/wso2/people/jonathan/Javascript%20data%20binding.
>> doc)
>> is almost complete (Need to do more rigorous testing though). We now
>> have support for the following,
>>
>> 1. The ability to use JavaScript types as annotations
>> e.g string, number, boolean, date, array, object ....
>>
>> 2. Support for XML Schema built-in types
>> e.g. xs:string, xs:int, xs:double,.....
>> (We do not support xs:NOTATION (Only derived types of xs:NOTATION can
>> be
>> used in a schema) and xs:ID (It can be used on attributes only))
>>
>> 3. Support for optional parameters and arrays
>>
>> 4. Support for single string valued enumerations.
>>
>> 5. Adding type information (via js:type attribute, where
>> xmlns:js="http://www.wso2.org/ns/jstype) when response is anytype
>>
>> 6. Support for multiple return values (the function should return a
>> javascript object in this case with the defined parameters as
>> properties
>> in the object).
>> e.g.
>>
>> foo.outputType = {"simple" : "string", "complex" : {"nested1" :
>> "string", "nested2" : "string"}};
>> function foo(){
>>
>>     fooReturn = new Function();
>>     fooReturn.simple = "test";
>>     complex = new Function();
>>     complex.nested1="test2";
>>     complex.nested2="test3";
>>     fooReturn.complex = complex;
>>     return fooReturn;
>> }
>>
>>
>> With this infrastructure in place now the users have more control in
>> defining how there input and output will look like. Now we have to
>> upgrade the stubs to support these features.
>>
>> An important point to note is that if the user uses xs types as
>> annotations then the data passed to or from the function should conform
>> to the specified data type used. for e.g
>>
>> foo.inputTypes = "xs:int";
>> function foo(param) {
>> return param;
>> }
>>
>> payload :
>>
>> <foo>
>>     <fooType>
>>        <param>10.0</param>
>>     </fooType>
>> </foo>
>>
>> would cause an error to be thrown. I didn't try to do any type
>> conversions in cases like this but throw an error. The behavior used is
>> consistent throughout the dataBinding framework. If the user wanted
>> flexibility in the data been passed he could have used number as the
>> annotation.
>>
>> I will write this up in the WIKI so that we cal draw from it when doing
>> the documentation.
>>
>> Thanks,
>> Keith.
>>
>> _______________________________________________
>> Mashup-dev mailing list
>> Mashup-dev at wso2.org
>> http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
>>     
>
>
>   





More information about the Mashup-dev mailing list