W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2001

Re: The <Value>_<Unit> problem

From: Martin Duerst <duerst@w3.org>
Date: Thu, 02 Aug 2001 16:50:52 +0900
Message-Id: <4.2.0.58.J.20010802164911.02dccf00@sh.w3.mag.keio.ac.jp>
To: Eddie Robertsson <eddie@allette.com.au>, XSD <xmlschema-dev@w3.org>
At 17:15 01/08/02 +1000, Eddie Robertsson wrote:

>So, the productCostType would be:
>
>  <xsd:simpleType name="productCostType">
>   <xsd:restriction>
>    <xsd:simpleType>
>     <xsd:list itemType="myUnion"/>
>    </xsd:simpleType>
>    <xsd:length value="2"/>
>    <xs:pattern value="/d+ .+"/>
>   </xsd:restriction>
>  </xsd:simpleType>
>
>The only validator that seems to support this is MSXML4 July release but
>according to my reading of the spec this should be allowed.

Probably it is. But at least you have to change
    <xs:pattern value="/d+ .+"/>
to something more specific to avoid allowing values such as
    <productCost>20 50</productCost>

Anyway, using a complex type and a bit more of markup seems
to be the better solution.


Regards,    Martin.
Received on Thursday, 2 August 2001 04:10:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:23 GMT