LC-136: symbolic constants

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:annotation>
			<xsd:documentation>Length in meters</xsd:documentation>
		</xsd:annotation>
	</xsd:simpleType>
	<xsd:simpleType name="expression" base="string">
		<xsd:pattern value="$.*"/>
	</xsd:simpleType>
	<xsd:simpleType name="lengthExpr" base="string">
		<xsd:or>
			<xsd:conform type="myschema:length"/>
			<xsd:comform base="myschema:expression"/>
		</xsd:or>
	</xsd:simpleType>

	<xsd:element name="box">
		<xsd:complexType>
			<xsd:attribute name="X" type="myschema:lengthExpr"/>
		</xsd:compleType>
		...
	</xsd:element>
	...
</xsd:schema>

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>
		</xsd:enumeration>
	</xsd:simpleType>
...
</xsd:schema>

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