(2) the typing system is not implemented (I have a naive object wrapper on them - XSDSimpleType and XSDComplexType + XSDRestriction).
- I gave a look at Brenda Larcom implementation of XSD (X Files project on squeaksource - it's MIT even if not specified yet)
- I think I need a (clever) way to link XSDSimpleType/XSDComplexType with both my "wsdl" model and the soap implementation and of course map them back and forth with Smalltalk classes.
Any comments/idea here would be greatly appreciated ;-) - The "typing system" seems really important to me in term of interoperability with the outside world, but I'd like a clever way to have them mapped to smalltalk class/objects
What do you need exactly do you have an example?
There are several datatypes systems, but in xml world, xml schema seems to be the norm.
I'd like to map them back and forth to smalltalk.
<naiveThought>would it be possible to make magritte xml schema compliant ?</naiveThought >
- There is also the notion of restriction/facets that apply to type instance [2].
- Then there are complex type for Arrays, Structure likes, etc...
- And last, there are encoded types (for whatever cannot be easily represented I guess)
********
To give an idea, here is what's done in SOAPOpera and some references at the end:
***For simple types (use of a typeDict):
-- simpleTypes
[#Boolean] : 'xsd:boolean'
[#ByteString] : 'xsd:string'
[#Double] : 'xsd:double'
[#Float] : 'xsd:float'
[#Integer] : 'xsd:integer'
[#LargeNegativeInteger] : 'xsd:negativeInteger'
[#LargePositiveInteger] : 'xsd:positiveInteger'
[#SmallInteger] : 'xsd:integer'
[#String] : 'xsd:string'
...
***For complexTypes
there's a complexType dict that is populated by the encoder
***For encoded (during encoding, if the type is not defined, it's encoded):
self typeDict at: type ifAbsent:[ ^self encodeObjectSoapVariable: aSoapVariable].
with for instance self encodeObjectSoapVariable: aSoapVariable = |
<auau xsi:type="Squeak-ENC:ReferenceStream">CAAAAAQEAAAAAQQAAAACCAAAAAIGBWhlbGxvEQlTbWFsbHRhbGsEAAAAAw==</auau>
****************************
In SoapEncoder 's (with Masashi Umezawa comments - :-) )
initTypeDict
"Apparently this mapping is not so sophisticted. "
"##TODO: Implement more serious mapping method "
| pref |
typeDict := super initTypeDict.
pref := SoapConstants xsdPrefixColon.
#(
#(#double #Float)
#(#decimal #ScaledDecimal)
#(#base64Binary #ByteArray)
#(#long #LargePositiveInteger)
#(#dateTime #DateAndTime)
) do:[:each | typeDict at: (pref, each first) asSymbol put: each last]. "for Poor Squeak!"
^typeDict
*********************References (w3c)

| {base type definition} | applicable {facets} |
|---|
| If {variety} is list, then |
|---|
| [all datatypes] | length, minLength, maxLength, pattern, enumeration, whiteSpace |
| If {variety} is union, then |
|---|
| [all datatypes] | pattern, enumeration |
| else if {variety} is atomic, then |
|---|
| string | length, minLength, maxLength, pattern, enumeration, whiteSpace |
| boolean | pattern, whiteSpace |
| float | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| double | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| decimal | totalDigits, fractionDigits, pattern, whiteSpace, enumeration, maxInclusive, maxExclusive, minInclusive,minExclusive |
| duration | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| dateTime | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| time | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| date | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| gYearMonth | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| gYear | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| gMonthDay | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| gDay | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| gMonth | pattern, enumeration, whiteSpace, maxInclusive, maxExclusive, minInclusive, minExclusive |
| hexBinary | length, minLength, maxLength, pattern, enumeration, whiteSpace |
| base64Binary | length, minLength, maxLength, pattern, enumeration, whiteSpace |
| anyURI | length, minLength, maxLength, pattern, enumeration, whiteSpace |
| QName | length, minLength, maxLength, pattern, enumeration, whiteSpace |
| NOTATION | length, minLength, maxLength, pattern, enumeration, whiteSpace |