Re: The <Value>_<Unit> problem

> >  <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>

Your correct. Something like:

    <xs:pattern value="/d+ [A-Z]+"/>

would be better.

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

Again, I completely agree. Someone asked for this functionality a couple of
weeks ago where I suggested a solution lacking the pattern declaration. I was
just providing a better solution to the problem. However I do think it's
better to use a solution as suggested by Simon:

<productCost currency="AUD">20</productCost>

Cheers,
/Eddie

Received on Thursday, 2 August 2001 04:27:55 UTC