diff -BburN --exclude=generator.rb soap4r-1.5.5.20061022/lib/soap/baseData.rb soap4r-1.5.5.latest/lib/soap/baseData.rb --- soap4r-1.5.5.20061022/lib/soap/baseData.rb 2007-01-16 02:14:28.000000000 +0100 +++ soap4r-1.5.5.latest/lib/soap/baseData.rb 2007-01-16 16:49:39.000000000 +0100 @@ -238,6 +238,24 @@ SOAPENCType = QName.new(EncodingNamespace, StringLiteral) end +class SOAPNormalizedString < XSD::XSDNormalizedString + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, NormalizedStringLiteral) +end + +class SOAPToken < XSD::XSDToken + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, TokenLiteral) +end + +class SOAPLanguage < XSD::XSDLanguage + include SOAPBasetype + extend SOAPModuleUtils + SOAPENCType = QName.new(EncodingNamespace, LanguageLiteral) +end + class SOAPBoolean < XSD::XSDBoolean include SOAPBasetype extend SOAPModuleUtils diff -BburN --exclude=generator.rb soap4r-1.5.5.20061022/lib/soap/mapping/encodedregistry.rb soap4r-1.5.5.latest/lib/soap/mapping/encodedregistry.rb --- soap4r-1.5.5.20061022/lib/soap/mapping/encodedregistry.rb 2007-01-16 02:14:28.000000000 +0100 +++ soap4r-1.5.5.latest/lib/soap/mapping/encodedregistry.rb 2007-01-16 17:08:58.000000000 +0100 @@ -141,6 +141,14 @@ [::FalseClass, ::SOAP::SOAPBoolean, BasetypeFactory], [::String, ::SOAP::SOAPString, StringFactory, {:derived_class => true}], + + [::String, ::SOAP::SOAPNormalizedString, BasetypeFactory, + {:derived_class => true}], + [::String, ::SOAP::SOAPToken, BasetypeFactory, + {:derived_class => true}], + [::String, ::SOAP::SOAPLanguage, BasetypeFactory, + {:derived_class => true}], + [::DateTime, ::SOAP::SOAPDateTime, DateTimeFactory], [::Date, ::SOAP::SOAPDate, DateTimeFactory], [::Time, ::SOAP::SOAPDateTime, DateTimeFactory], @@ -204,6 +212,9 @@ [::TrueClass, ::SOAP::SOAPBoolean, BasetypeFactory], [::FalseClass, ::SOAP::SOAPBoolean, BasetypeFactory], [::String, ::SOAP::SOAPString, StringFactory], + [::String, ::SOAP::SOAPNormalizedString, BasetypeFactory], + [::String, ::SOAP::SOAPToken, BasetypeFactory], + [::String, ::SOAP::SOAPLanguage, BasetypeFactory], [::DateTime, ::SOAP::SOAPDateTime, DateTimeFactory], [::Date, ::SOAP::SOAPDate, DateTimeFactory], [::Time, ::SOAP::SOAPDateTime, DateTimeFactory], diff -BburN --exclude=generator.rb soap4r-1.5.5.20061022/lib/soap/mapping/rubytypeFactory.rb soap4r-1.5.5.latest/lib/soap/mapping/rubytypeFactory.rb --- soap4r-1.5.5.20061022/lib/soap/mapping/rubytypeFactory.rb 2007-01-16 02:14:28.000000000 +0100 +++ soap4r-1.5.5.latest/lib/soap/mapping/rubytypeFactory.rb 2007-01-16 16:50:45.000000000 +0100 @@ -12,6 +12,13 @@ class RubytypeFactory < Factory TYPE_STRING = XSD::QName.new(RubyTypeNamespace, 'String') + + # this should be replaced + TYPE_NORMALIZEDSTRING = XSD::QName.new(RubyTypeNamespace, 'String') + TYPE_TOKEN = XSD::QName.new(RubyTypeNamespace, 'String') + TYPE_LANGUAGE = XSD::QName.new(RubyTypeNamespace, 'String') + + TYPE_TIME = XSD::QName.new(RubyTypeNamespace, 'Time') TYPE_ARRAY = XSD::QName.new(RubyTypeNamespace, 'Array') TYPE_REGEXP = XSD::QName.new(RubyTypeNamespace, 'Regexp') diff -BburN --exclude=generator.rb soap4r-1.5.5.20061022/lib/soap/mapping/typeMap.rb soap4r-1.5.5.latest/lib/soap/mapping/typeMap.rb --- soap4r-1.5.5.20061022/lib/soap/mapping/typeMap.rb 2007-01-16 15:43:03.000000000 +0100 +++ soap4r-1.5.5.latest/lib/soap/mapping/typeMap.rb 2007-01-16 16:51:41.000000000 +0100 @@ -13,6 +13,12 @@ XSD::XSDAnySimpleType::Type => SOAPAnySimpleType, XSD::XSDString::Type => SOAPString, + + # not finished here + XSD::XSDNormalizedString::Type => SOAPNormalizedString, + XSD::XSDToken::Type => SOAPToken, + XSD::XSDLanguage::Type => SOAPLanguage, + XSD::XSDBoolean::Type => SOAPBoolean, XSD::XSDDecimal::Type => SOAPDecimal, XSD::XSDFloat::Type => SOAPFloat, @@ -46,6 +52,9 @@ # soap4r does not use soapenc types actively but it should be accepted. SOAP::SOAPString::SOAPENCType => SOAPString, + SOAP::SOAPNormalizedString::SOAPENCType => SOAPNormalizedString, + SOAP::SOAPToken::SOAPENCType => SOAPToken, + SOAP::SOAPLanguage::SOAPENCType => SOAPLanguage, SOAP::SOAPBoolean::SOAPENCType => SOAPBoolean, SOAP::SOAPDecimal::SOAPENCType => SOAPDecimal, SOAP::SOAPFloat::SOAPENCType => SOAPFloat, diff -BburN --exclude=generator.rb soap4r-1.5.5.20061022/lib/xsd/datatypes.rb soap4r-1.5.5.latest/lib/xsd/datatypes.rb --- soap4r-1.5.5.20061022/lib/xsd/datatypes.rb 2007-01-16 02:14:28.000000000 +0100 +++ soap4r-1.5.5.latest/lib/xsd/datatypes.rb 2007-01-16 17:22:22.000000000 +0100 @@ -46,8 +46,8 @@ QNameLiteral = 'QName' NormalizedStringLiteral = 'normalizedString' -#3.3.2 token -#3.3.3 language +TokenLiteral = 'token' +LanguageLiteral = 'language' #3.3.4 NMTOKEN #3.3.5 NMTOKENS #3.3.6 Name @@ -255,7 +255,7 @@ def screen_data(d) if d.is_a?(String) # Integer("00012") => 10 in Ruby. - d.sub!(/^([+\-]?)0*(?=\d)/, "\\1") + d = d.sub(/^([+\-]?)0*(?=\d)/, "\\1") unless d.frozen? end screen_data_str(d) end @@ -1013,6 +1013,40 @@ end end +class XSDToken < XSDNormalizedString + Type = QName.new(Namespace, TokenLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + if /[\t\n]|^\ |\ $|\ \ / =~ value + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }'.") + end + super + end +end + +class XSDLanguage < XSDToken + Type = QName.new(Namespace, LanguageLiteral) + + def initialize(value = nil) + init(Type, value) + end + +private + + def screen_data(value) + if /^((aa)|(ab)|(ae)|(af)|(ak)|(am)|(an)|(ar)|(as)|(av)|(ay)|(az)|(ba)|(be)|(bg)|(bh)|(bi)|(bm)|(bn)|(bo)|(br)|(bs)|(ca)|(ce)|(ch)|(co)|(cr)|(cs)|(cu)|(cv)|(cy)|(da)|(de)|(dv)|(dz)|(ee)|(el)|(en)|(eo)|(es)|(et)|(eu)|(fa)|(ff)|(fi)|(fj)|(fo)|(fr)|(fy)|(ga)|(gd)|(gl)|(gn)|(gu)|(gv)|(ha)|(he)|(hi)|(ho)|(hr)|(ht)|(hu)|(hy)|(hz)|(ia)|(id)|(ie)|(ig)|(ii)|(ik)|(io)|(is)|(it)|(iu)|(ja)|(jv)|(ka)|(kg)|(ki)|(kj)|(kk)|(kl)|(km)|(kn)|(ko)|(kr)|(ks)|(ku)|(kv)|(kw)|(ky)|(la)|(lb)|(lg)|(li)|(ln)|(lo)|(lt)|(lu)|(lv)|(mg)|(mh)|(mi)|(mk)|(ml)|(mn)|(mo)|(mr)|(ms)|(mt)|(my)|(na)|(nb)|(nd)|(ne)|(ng)|(nl)|(nn)|(no)|(nr)|(nv)|(ny)|(oc)|(oj)|(om)|(or)|(os)|(pa)|(pi)|(pl)|(ps)|(pt)|(qu)|(rm)|(rn)|(ro)|(ru)|(rw)|(sa)|(sc)|(sd)|(se)|(sg)|(sh)|(si)|(sk)|(sl)|(sm)|(sn)|(so)|(sq)|(sr)|(ss)|(st)|(su)|(sv)|(sw)|(ta)|(te)|(tg)|(th)|(ti)|(tk)|(tl)|(tn)|(to)|(tr)|(ts)|(tt)|(tw)|(ty)|(ug)|(uk)|(ur)|(uz)|(ve)|(vi)|(vo)|(wa)|(wo)|(xh)|(yi)|(yo)|(za)|(zh)|(zu))$/ =~ value + raise ValueSpaceError.new("#{ type }: cannot accept '#{ value }', see ISO 639 for more information.") + end + super + end +end + class XSDInteger < XSDDecimal Type = QName.new(Namespace, IntegerLiteral)