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

Arnold, Curt Curt.Arnold at
Wed Dec 8 18:38:02 GMT 1999

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"/> 
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
		<!--  could be just an asterisk   -->
		<!--  matching this pattern means that it matches the
namespaceWildcard datatype and the 
			   default pattern of ".*"   -->
		<pattern datatype="namespaceWildcard"/>
		<pattern datatype="qname"/>
<datatype name="namespaceWildcardFragments">
	<basetype name="string"/>
		<pattern datatype="ncname"/>
</datatype name="namespaceWildcard">
	<basetype name="namespaceWildcardFragments"/>
	<list minOccur="3" maxOccur="3"/>
	<!--  regex constraint on entire list, making sure that the last two
characters are :*  ->

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

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

<datatype name="pathdataItem">
	<basetype name="string"/>
		<pattern datatype="moveCommand"/>
		<pattern datatype="curvetoCommand"/>
		<pattern datatype="smoothCommand"/>
		<pattern datatype="arcCommand"/>
<datatype name="pathdata">
<attribute name="d" datatype="pathdata"/>

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at
Archived as: and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo at the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo at the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa at

More information about the Xml-dev mailing list