- From: Paul Downey via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 12 Aug 2005 16:29:20 +0000
- To: public-ws-desc-eds@w3.org
Update of /sources/public/2002/ws/desc/schema-patterns In directory hutz:/tmp/cvs-serv19896/2002/ws/desc/schema-patterns Modified Files: xml-schema-patterns.xml xml-schema-patterns.html Log Message: changes following comments from JAXB Index: xml-schema-patterns.xml =================================================================== RCS file: /sources/public/2002/ws/desc/schema-patterns/xml-schema-patterns.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** xml-schema-patterns.xml 16 Jul 2005 11:07:38 -0000 1.6 --- xml-schema-patterns.xml 12 Aug 2005 16:29:18 -0000 1.7 *************** *** 27,32 **** </publoc> <prevlocs> ! <loc href="http://dev.w3.org/cvsweb/2002/ws/desc/schema-patterns/xml-schema-patterns.html" ! >http://dev.w3.org/cvsweb/2002/ws/desc/schema-patterns/xml-schema-patterns.html</loc> </prevlocs> <latestloc> --- 27,32 ---- </publoc> <prevlocs> ! <loc href="http://www.w3.org/2005/07/xml-schema-patterns.html" ! >http://www.w3.org/2005/07/xml-schema-patterns.html</loc> </prevlocs> <latestloc> *************** *** 53,58 **** the mapping of XML Schemas into programming language structures</emph> [<loc href="http://www.w3.org/2005/07/ws-databinding-charter.html" ! >http://www.w3.org/2005/07/ws-databinding-charter.html</loc>]. This note may ! provide useful input to such a Working Group. </p> <p> <emph>The WSD Working Group has yet to review or approve this document.</emph> --- 53,58 ---- the mapping of XML Schemas into programming language structures</emph> [<loc href="http://www.w3.org/2005/07/ws-databinding-charter.html" ! >http://www.w3.org/2005/07/ws-databinding-charter.html</loc>]. This note may provide ! useful input to such a Working Group. </p> <p> <emph>The WSD Working Group has yet to review or approve this document.</emph> *************** *** 140,144 **** <p>The name of a schema type, attribute or element may be any valid XML non-colonized name including names which may be reserved or not directly representable in some programming ! languages, such as "object", "static", "final", "class", "Customer-Profile", etc.</p> </div2> <div2 id="Enumerated"> --- 140,150 ---- <p>The name of a schema type, attribute or element may be any valid XML non-colonized name including names which may be reserved or not directly representable in some programming ! languages, such as "object", "static", "final", "class", "Customer-Profile", etc. ! Conversely, publishers of schemas may reduce the mapping required by avoiding element, ! attribute and type names likely to clash with reserved words in many programming ! languages.</p> ! <p>Authors of tools which map or bind data structures to XML should be aware that the same ! name may be used in a number of different places within a single schema, as a global ! element name and as the name of a complexType, for example.</p> </div2> <div2 id="Enumerated"> *************** *** 177,181 **** <xs:simpleType name='Currency' > ! <xs:union memberTypes='tns:Currency xs:string' /> </xs:simpleType> ]]></eg> --- 183,187 ---- <xs:simpleType name='Currency' > ! <xs:union memberTypes='tns:KnownCurrency xs:string' /> </xs:simpleType> ]]></eg> *************** *** 193,200 **** <xs:simpleType name='Currency' > ! <xs:union memberTypes='tns:Currency xs:string' /> </xs:simpleType> ]]></eg> </example> </div3> </div2> --- 199,212 ---- <xs:simpleType name='Currency' > ! <xs:union memberTypes='tns:KnownCurrency xs:string' /> </xs:simpleType> ]]></eg> </example> + <ednote> + <name>PaulD</name> + <date>2005-08-12</date> + <edtext>The extensible enumeration isn't well supported by many toolkits, however it is + a very common schema pattern.</edtext> + </ednote> </div3> </div2> *************** *** 241,244 **** --- 253,258 ---- containing an <code>any</code> element wildcard, being incorporated in a substitution group or derived using extension or restriction. </p> + <p>Attributes may appear in any order and are therefore well suited to representing a + collection, although attributes may only contain simpleTypes.</p> <div3 id="Collection-Extending-Attributes"> <head>Extending A Collection With Attributes</head> *************** *** 399,402 **** --- 413,431 ---- ]]></eg> </example> + <p>The schema list construct may be used to define a simple type where the repeated values + are themselves a simple type.</p> + <example id="eg-list-type"> + <head>Simple Type List</head> + <eg xml:space="preserve"><![CDATA[ + <xs:simpleType name="xs:LanguageList"> + <xs:list itemType="xs:string"/> + </xs:simpleType> + + <xs:element name="languages" type="tns:LanguageList" /> + ]]></eg> + <eg xml:space="preserve"><![CDATA[ + <languages>en_GB en_IN en_ZA en_US fr_FR fr_CA</languages> + ]]></eg> + </example> <p>A multi-dimensional array may be built by composing collections and vectors which contain vectors. More complicated array structures such as a sparse or jagged matrices are beyond *************** *** 453,458 **** ]]></eg> </example> ! <p>For a tool to be able to recognise that a repeated item a map, it needs to be able to ! identify which of the repeated elements or attributes represents the unique key.</p> <div3 id="Map-ID"> <head>Map Keyed with xs:ID or xml:ID</head> --- 482,488 ---- ]]></eg> </example> ! <p>For a tool to be able to recognise that a repeated item can be bound to a map it needs to ! be able to identify which of the child elements or attributes of the repeated item ! represents the unique key.</p> <div3 id="Map-ID"> <head>Map Keyed with xs:ID or xml:ID</head> *************** *** 491,494 **** --- 521,527 ---- element with a cardinality of one constrained by <code>xs:unique</code> may be safely represented using a map, with the unique elements or attributes forming the key.</p> + <p>Maps differ from Vectors in that their contents are unordered. Therefore the + <code>sequence</code> and <code>all</code> model groups may be used interchangeably + following patterns and examples.</p> <ednote> <name>PaulD</name> *************** *** 561,567 **** <eg xml:space="preserve"><![CDATA[ <xs:complexType name="MapType"> ! <xs:sequence> <xs:element name="item" minOccurs="0" maxOccurs="unbounded" type="wsdli:MapItemType"/> ! </xs:sequence> </xs:complexType> ]]></eg> --- 594,600 ---- <eg xml:space="preserve"><![CDATA[ <xs:complexType name="MapType"> ! <xs:all> <xs:element name="item" minOccurs="0" maxOccurs="unbounded" type="wsdli:MapItemType"/> ! </xs:all> </xs:complexType> ]]></eg> Index: xml-schema-patterns.html =================================================================== RCS file: /sources/public/2002/ws/desc/schema-patterns/xml-schema-patterns.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** xml-schema-patterns.html 16 Jul 2005 11:07:38 -0000 1.6 --- xml-schema-patterns.html 12 Aug 2005 16:29:18 -0000 1.7 *************** *** 62,67 **** <dt>Previous version:</dt> <dd><a href= ! "http://dev.w3.org/cvsweb/2002/ws/desc/schema-patterns/xml-schema-patterns.html"> ! http://dev.w3.org/cvsweb/2002/ws/desc/schema-patterns/xml-schema-patterns.html</a></dd> <dt>Editor:</dt> <dd>Paul Downey, BT</dd> --- 62,66 ---- <dt>Previous version:</dt> <dd><a href= ! "http://www.w3.org/2005/07/xml-schema-patterns.html">http://www.w3.org/2005/07/xml-schema-patterns.html</a></dd> <dt>Editor:</dt> <dd>Paul Downey, BT</dd> *************** *** 238,242 **** XML non-colonized name including names which may be reserved or not directly representable in some programming languages, such as ! "object", "static", "final", "class", "Customer-Profile", etc.</p> </div> <div class="div2"> --- 237,248 ---- XML non-colonized name including names which may be reserved or not directly representable in some programming languages, such as ! "object", "static", "final", "class", "Customer-Profile", etc. ! Conversely, publishers of schemas may reduce the mapping required ! by avoiding element, attribute and type names likely to clash with ! reserved words in many programming languages.</p> ! <p>Authors of tools which map or bind data structures to XML should ! be aware that the same name may be used in a number of different ! places within a single schema, as a global element name and as the ! name of a complexType, for example.</p> </div> <div class="div2"> *************** *** 284,288 **** <xs:simpleType name='Currency' > ! <xs:union memberTypes='tns:Currency xs:string' /> </xs:simpleType> --- 290,294 ---- <xs:simpleType name='Currency' > ! <xs:union memberTypes='tns:KnownCurrency xs:string' /> </xs:simpleType> *************** *** 302,310 **** <xs:simpleType name='Currency' > ! <xs:union memberTypes='tns:Currency xs:string' /> </xs:simpleType> </pre></div> </div> </div> </div> --- 308,328 ---- <xs:simpleType name='Currency' > ! <xs:union memberTypes='tns:KnownCurrency xs:string' /> </xs:simpleType> </pre></div> </div> + <table border="1" summary="Editorial note: PaulD"> + <tr> + <td align="left" valign="top" width="50%"><b>Editorial note: + PaulD</b></td> + <td align="right" valign="top" width="50%">2005-08-12</td> + </tr> + <tr> + <td colspan="2" align="left" valign="top">The extensible + enumeration isn't well supported by many toolkits, however it is a + very common schema pattern.</td> + </tr> + </table> </div> </div> *************** *** 357,360 **** --- 375,381 ---- <code>any</code> element wildcard, being incorporated in a substitution group or derived using extension or restriction.</p> + <p>Attributes may appear in any order and are therefore well suited + to representing a collection, although attributes may only contain + simpleTypes.</p> <div class="div3"> <h4><a name="Collection-Extending-Attributes" id= *************** *** 558,561 **** --- 579,602 ---- </pre></div> </div> + <p>The schema list construct may be used to define a simple type + where the repeated values are themselves a simple type.</p> + <div class="exampleOuter"> + <div class="exampleHeader"><a name="eg-list-type" id= + "eg-list-type"></a>Example 10: Simple Type List</div> + <div class="exampleInner"> + <pre> + <xs:simpleType name="xs:LanguageList"> + <xs:list itemType="xs:string"/> + </xs:simpleType> + + <xs:element name="languages" type="tns:LanguageList" /> + + </pre></div> + <div class="exampleInner"> + <pre> + <languages>en_GB en_IN en_ZA en_US fr_FR fr_CA</languages> + + </pre></div> + </div> <p>A multi-dimensional array may be built by composing collections and vectors which contain vectors. More complicated array *************** *** 572,576 **** <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-example" id= ! "eg-map-example"></a>Example 10: Representing a Map</div> <p>The following Perl hash variable:</p> <div class="exampleInner"> --- 613,617 ---- <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-example" id= ! "eg-map-example"></a>Example 11: Representing a Map</div> <p>The following Perl hash variable:</p> <div class="exampleInner"> *************** *** 621,627 **** </pre></div> </div> ! <p>For a tool to be able to recognise that a repeated item a map, ! it needs to be able to identify which of the repeated elements or ! attributes represents the unique key.</p> <div class="div3"> <h4><a name="Map-ID" id="Map-ID"></a>2.5.1 Map Keyed with xs:ID or --- 662,669 ---- </pre></div> </div> ! <p>For a tool to be able to recognise that a repeated item can be ! bound to a map it needs to be able to identify which of the child ! elements or attributes of the repeated item represents the unique ! key.</p> <div class="div3"> <h4><a name="Map-ID" id="Map-ID"></a>2.5.1 Map Keyed with xs:ID or *************** *** 634,638 **** <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-xml-id" id= ! "eg-map-xml-id"></a>Example 11: Map Keyed Using xml:id</div> <div class="exampleInner"> <pre> --- 676,680 ---- <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-xml-id" id= ! "eg-map-xml-id"></a>Example 12: Map Keyed Using xml:id</div> <div class="exampleInner"> <pre> *************** *** 668,671 **** --- 710,717 ---- <code>xs:unique</code> may be safely represented using a map, with the unique elements or attributes forming the key.</p> + <p>Maps differ from Vectors in that their contents are unordered. + Therefore the <code>sequence</code> and <code>all</code> model + groups may be used interchangeably following patterns and + examples.</p> <table border="1" summary="Editorial note: PaulD"> <tr> *************** *** 684,688 **** <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-unique" id= ! "eg-map-unique"></a>Example 12: Map with xs:unique Key</div> <div class="exampleInner"> <pre> --- 730,734 ---- <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-unique" id= ! "eg-map-unique"></a>Example 13: Map with xs:unique Key</div> <div class="exampleInner"> <pre> *************** *** 737,741 **** <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-element" id= ! "eg-map-element"></a>Example 13: WSDL Instance Defined MapItemType</div> <div class="exampleInner"> --- 783,787 ---- <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-element" id= ! "eg-map-element"></a>Example 14: WSDL Instance Defined MapItemType</div> <div class="exampleInner"> *************** *** 758,768 **** <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-wsdli-use" id= ! "eg-map-wsdli-use"></a>Example 14: Use of the MapItemType</div> <div class="exampleInner"> <pre> <xs:complexType name="MapType"> ! <xs:sequence> <xs:element name="item" minOccurs="0" maxOccurs="unbounded" type="wsdli:MapItemType"/> ! </xs:sequence> </xs:complexType> --- 804,814 ---- <div class="exampleOuter"> <div class="exampleHeader"><a name="eg-map-wsdli-use" id= ! "eg-map-wsdli-use"></a>Example 15: Use of the MapItemType</div> <div class="exampleInner"> <pre> <xs:complexType name="MapType"> ! <xs:all> <xs:element name="item" minOccurs="0" maxOccurs="unbounded" type="wsdli:MapItemType"/> ! </xs:all> </xs:complexType>
Received on Friday, 12 August 2005 16:29:29 UTC