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

LC-136: symbolic constants

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Wed, 21 Jun 2000 12:52:54 -0600
Message-ID: <B2C1451A181BD411B88A00E018C1C19C08A683@THOR>
To: "'Steven.Goldfarb@cern.ch'" <Steven.Goldfarb@cern.ch>, "'olken@lbl.gov'" <olken@lbl.gov>, "'marting@develop.com'" <marting@develop.com>
Cc: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
Re: http://www.w3.org/2000/05/12-xmlschema-lcissues.xml#constants

I think the actual resolution of the symbolic constants is outside what you could expect from a generic XML processor, however a resolution of LC-2 conjunction types
(http://www.w3.org/2000/05/12-xmlschema-lcissues.xml#conjunction-types) and/or open enumerations (http://lists.w3.org/Archives/Public/www-xml-schema-comments/1999OctDec/0022.html and
http://lists.w3.org/Archives/Public/www-xml-schema-comments/1999OctDec/0023.html)  might enable the behavior that you desire.

For example, using conjunction types:

<xsd:schema ...>
	<xsd:simpleType name="length" base="double">
			<xsd:documentation>Length in meters</xsd:documentation>
	<xsd:simpleType name="expression" base="string">
		<xsd:pattern value="$.*"/>
	<xsd:simpleType name="lengthExpr" base="string">
			<xsd:conform type="myschema:length"/>
			<xsd:comform base="myschema:expression"/>

	<xsd:element name="box">
			<xsd:attribute name="X" type="myschema:lengthExpr"/>

This would allow the X attribute of box to be either a double interpreted as length in meters or a string starting with a $ that would be interpreted as an expression that would have to be resolved by
the application.

Open enumerations (which is referenced in LC-191 and I think is worthy of its own issue number with or without the substitution feature mentioned here) would allow you to have the equivalent of schema
defined symbolic constants.  Not quite what you example was doing, but similar.   For example:

<xsd:schema ...>
	<xsd:simpleType name="length" base="double">
		<xsd:enumeration open="true">
			<xsd:literal value="1000">1Km</xsd:literal>

This would allow the length datatype to accept any legal double and in addition if the value matched any listed literal, the value would be substituted.
Received on Wednesday, 21 June 2000 15:06:30 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:47 UTC