[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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

  • From: "Arnold, Curt" <Curt.Arnold@h...>
  • To: "'www-xml-schema-comments@w...'" <www-xml-schema-comments@w...>
  • Date: Wed, 8 Dec 1999 11:35:24 -0700

svg schema
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"/>



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1
To unsubscribe, mailto:majordomo@i... the following message;
unsubscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)



PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.