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

Schema validation of XSLT, SVG, XPath: Part 2: Multiple Lexical R epresentation

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Wed, 8 Dec 1999 11:35:24 -0700
Message-ID: <61DAD58E8F4ED211AC8400A0C9B46873415565@THOR>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
Cc: "'xml-dev@ic.ac.uk'" <xml-dev@ic.ac.uk>
Sorry about the duplicate (or near duplicate) Part 1 messages.  I'm not
really sure how that happened.

This part makes some simple modifications that greatly simplify specifying
the lexical represention of data types that have several forms.

Here are some productions that would be difficult to enforce without the
suggested modifications.:

NameTest from XPath:

NameTest ::= '*' 
	         |  NCName ':' '*' 
                     | QName

NCName from XML Namespaces:
4] NCName ::= (Letter | '_') (NCNameChar)

The SVG path data datatype (datatype of the d attribute)
<path d="M 100 100 L 140 100 L 120 140 z"/> 
Proposal:
After reviewing the current datatypes doc, I'm a little confused with what
happened with the previous lexicalRepresentation element.  The
interpretation of pattern and lexical are not adequately discussed.  I'm
moving more things around than I thought that I would need to, but here
goes.  Here are what I think would be reasonable renderings of the previous
production patterns.
<datatype name="nameTest">
	<basetype name="string"/>
	<!-- this is using the lexical element to represent all legal string
encodings of nameTest 
		for a string to be a valid nameTest one of the exclosed
patterns must match and
                       must conform to the lexical representation of the
base type
		-->
	<lexical>
		<!--  could be just an asterisk   -->
		<pattern>\*</pattern>
		<!--  matching this pattern means that it matches the
namespaceWildcard datatype and the 
			   default pattern of ".*"   -->
		<pattern datatype="namespaceWildcard"/>
		<pattern datatype="qname"/>
	</lexical>
</datatype>
<datatype name="namespaceWildcardFragments">
	<basetype name="string"/>
	<lexical>
		<pattern datatype="ncname"/>
		<pattern>:</pattern>
		<pattern>\*</pattern>
	</lexical>
</datatype>
</datatype name="namespaceWildcard">
	<basetype name="namespaceWildcardFragments"/>
	<list minOccur="3" maxOccur="3"/>
	<!--  regex constraint on entire list, making sure that the last two
characters are :*  ->
	<lexical><pattern>.*:\*</pattern></lexical>
</datatype>

<datatype name="qnameFragments">
	<lexical>
		<pattern datatype="ncname"/>
		<pattern>:</pattern>
	</lexical>
</datatype>
<datatype name="qname">
	<basetype name="qnameFragments"/>
	<list minOccur="1" maxOccur="3"/>
	<lexical>
		<!--  matches any two character or longer string that
doesn't have an initial or final colon  -->
		<pattern>[^:].*[^:]</pattern>
		<!--  matches any non-colon single character string   -->
		<pattern>[^:]</pattern>
	</lexical>
</datatype>
<datatype name="ncname">
	<basetype name="nmtoken"/>
	<!--  disallow colon from nmtoken  -->
	<lexical><pattern>[^:]*</pattern>
</datatype>

<!--  SVG example    -->
<datatype name="svgcoord">
	<basetype name="real"/>
	<list minOccur="2" maxOccur="2"/>
</datatype>
<datatype name="moveCommandFragment">
	<basetype name="string"/>
	<lexical>
		<pattern>[Mm]</pattern>
		<pattern datatype="svgcoord"/>
	</lexical>
</datatype>
<datatype name="moveCommand">
	<basetype name="moveCommandFragment"/>
	<list minOccur="2"/>
	<lexical>
		<pattern>[Mm][^Mm]*</pattern>
	</lexical>
</datatype>
...   omited for  other SVG productions

<datatype name="pathdataItem">
	<basetype name="string"/>
	<lexical>
		<pattern datatype="moveCommand"/>
		<pattern datatype="curvetoCommand"/>
		<pattern datatype="smoothCommand"/>
		<pattern datatype="arcCommand"/>
		...
	</lexical>
</datatype>
<datatype name="pathdata">
	<basetype="pathdataItem"/>
	<list/>
</datatype>
<attribute name="d" datatype="pathdata"/>
Received on Wednesday, 8 December 1999 13:38:06 UTC

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