W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 1999

More thoughts on XML Schema Datatypes (lexical representation)

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Fri, 25 Jun 1999 10:37:06 -0600
Message-ID: <61DAD58E8F4ED211AC8400A0C9B468731AADD8@THOR>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
It seems like trying to determine the nature of the lexical element from the
datatype (or its base datatype) is troublesome.  Wouldn't it be better to
have the lexical element contain child element of specific types.   (I know
that the presence of regex is debatable, it's inclusion here is not an
opinion on that debate)

Say something like

<datatype name="postalcode" basetype="string">
	<lexicalRepresentation>
		<regex>some regular expression</regex>
	</lexicalRepresentation>
</datatype>

<datatype name="F6.2" basetype="real">
	<!--  lexical rep allows any string that passes one of the inclosed
lexical tests  -->
	<lexicalRepresentation>
		<!--    to match this lexical form then it must pass all
tests -->
		<lexical>
			<regex>[0-9+-][0-9][0-9]\.[0-9][0-9]</regex>
			<numeric digitGroupSymbol="," digitGroupEvery="0"
decimalSepSymbol="."/>
		</lexical>
	</lexicalRepresentation>
<datatype>

<datatype name="mydate" basetype="date">
	<lexicalRepresentation>
		<!-- this would allow the 12/25/1999 format described in the
document  
			(though wouldn't fail on a 15th month or a 35th day)
-->
		<regex>[0-1][0-9]/[0-3][0-9]/[0-9][0-9][0-9][0-9]</regex>
		<!--  I made this an attribute so that the DTD could
validate it as an enumeration  -->
		<dateLexical Form="YY-MM-DD" Separators=" /-" />
	</lexicalRepresentation>
</datatype>
Received on Friday, 25 June 1999 12:39:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:46 GMT