(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 are a list of simple types (see here for an overview - http://books.xmlschemata.org/relaxng/relax-CHP-19.html) [1]. - 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) http://www.w3.org/TR/xmlschema-2/#built-in-datatypes http://www.w3.org/TR/xmlschema-2/#dt-facet Facets Fundamental Facets (http://www.w3.org/TR/xmlschema-2/#rf-fund-facets) 4.2.1 equal 4.2.2 ordered 4.2.3 bounded 4.2.4 cardinality 4.2.5 numeric Constraining Facets (http://www.w3.org/TR/xmlschema-2/#rf-facets) 4.3.1 length 4.3.2 minLength 4.3.3 maxLength 4.3.4 pattern 4.3.5 enumeration 4.3.6 whiteSpace 4.3.7 maxInclusive 4.3.8 maxExclusive 4.3.9 minExclusive 4.3.10 minInclusive 4.3.11 totalDigits 4.3.12 fractionDigits {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