[Home] [By Thread] [By Date] [Recent Entries]

  • To: "'xml-dev@l...'" <xml-dev@l...>
  • Subject: patterns and restrictions
  • From: Max Chappell <max@m...>
  • Date: Wed, 17 Dec 2003 15:29:23 +0000
  • Organization: Maxxml Limited
  • Reply-to: max@m...
  • User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Hi,

Does the following allow 'abc' as a valid value?

<xs:simpleType name="MyDouble">
        <xs:restriction base="xs:double">
            <xs:pattern value="[^N].*"/>
        </xs:restriction>
</xs:simpleType>

We had been working under the belief that, via restriction - patterns 
from both the new datatype and the original one are 'And'ed together. 
i.e - the above datatype would only allow values valid for a double - 
with the exception of NaN.

However, we've read somewhere today that whenever a pattern facet is 
evaluated - it is evaluated against a string.  Though XMLSpy and Xerces 
both reject 'abc', is this an added bonus? Should we rely on this, or 
should we define patterns in these instances to be tighter?

My suspiscion is that our original belief was correct, patterns are 
inherited also, but we would appreciate some confirmation of this.

thanks

Max




Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member