- From: Peter Hendry <peter.hendry@capeclear.com>
- Date: Thu, 15 Jun 2006 23:36:58 +1200
- To: jon.calladine@bt.com
- CC: public-xsd-databinding@w3.org
This union will always assign values as xsd:string when binding XML to objects as xs:string will match any text value. The xs:date will never be used. At least that is my understanding of union processing. Pete jon.calladine@bt.com wrote: > Discharging Action-45 from last weeks call: > > here is the first pattern for xs:union in ready to use format for the > patterns doc: > > <div2 id="pattern-Union" class="pattern"><head>Union</head> > <glist> > <label>URI</label> > <def><eg > class="URI">http://www.w3.org/2002/ws/databinding/patterns/6/05/Union</e > g></def> > <label>Definition</label> > <def>-</def> > > <label>Examples</label> > <def> > <example id="eg-element-BasicUnion-meeting"> > <head>Basic Union</head> > <glist> > <def><eg xml:space="preserve" > class="schemaexample"><![CDATA[ > <xs:simpleType name="UnionType"> > <xs:union memberTypes="xs:string xs:date"/> > </xs:simpleType> > > <xs:element name="elementBasicUnionMeeting" > type="ex:UnionType"/> > ]]> > > </eg></def> > <label>Instance:</label> > <def><eg xml:space="preserve" > class="instanceexample"><![CDATA[ > <ex:elementBasicUnionMeeting>2006-06-06</ex:elementBasicUnionMeeting> > ]]></eg></def> > <label>Instance:</label> > <def><eg xml:space="preserve" > class="instanceexample"><![CDATA[ > <ex:elementBasicUnionMeeting>6th June 2006</ex:elementBasicUnionMeeting> > ]]></eg></def> > </glist> > </example> > </def> > </glist> > </div2> > > > The important bits here are of course: > > <xs:simpleType name="UnionType"> > <xs:union memberTypes="xs:string xs:date"/> > </xs:simpleType> > > <xs:element name="elementBasicUnionMeeting" > type="ex:UnionType"/> > > With the valid instance data > > <ex:elementBasicUnionMeeting>2006-06-06</ex:elementBasicUnionMeeting> > > And > > <ex:elementBasicUnionMeeting>6th June 2006</ex:elementBasicUnionMeeting> > > JonC > >
Received on Thursday, 15 June 2006 11:37:24 UTC