W3C home > Mailing lists > Public > public-xsd-databinding@w3.org > June 2006

Re: ISSUE-9: union pattern for pending document

From: Peter Hendry <peter.hendry@capeclear.com>
Date: Thu, 15 Jun 2006 23:36:58 +1200
Message-ID: <4491465A.2080306@capeclear.com>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 December 2010 18:20:37 GMT