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

RE: Intuition and XML Schema restriction (was: XML Schema to r


schema restriction pattern
> So true. Type derivation involving anonymous types is another example 
> where the derivation looks fine but is in fact incorrect.

And the funny thing is, I would have sworn that 6 mos. ago most validators
handled restrictions of anonymous types just fine.  Maybe I'm
misremembering. I know that XML Spy 4.3  doesn't complain. 

I still don't  know which validators can now correctly determine value space
subsets from pattern expressions, though (it may be a terrifically hard
problem to solve for all cases).  I can do a quick check (incorrectly
restricting pattern "[a-m]*" to "[a-z]*") with the three validators I have
here (all probably out of date by now):

XSV 1.203.2.37:  Nope, doesn't catch it.

SchemaQualityChecker version 2.0:  Nope.

XML Spy 4.3: Nada.

Anybody want to try the following with Xerces or MSXML?:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:qux="http://www.example.com/foobar"
targetNamespace="http://www.example.com/foobar"
elementFormDefault="qualified"  attributeFormDefault="unqualified">
	
	<xs:simpleType name="name_t">
		<xs:restriction base="xs:string">
			<xs:pattern value="[a-m]*"/>
		</xs:restriction>
	</xs:simpleType>
	
	<xs:complexType name="foo">
		<xs:sequence>
			<xs:element name="firstName" type="qux:name_t"/>
		</xs:sequence>
	</xs:complexType>
	
	<xs:complexType name="bar">
		<xs:complexContent>
			<xs:restriction base="qux:foo">
				<xs:sequence>
					<xs:element name="firstName">
						<xs:simpleType>
							<xs:restriction
base="qux:name_t">
								<xs:pattern
value="[a-z]*"/>
							</xs:restriction>
						</xs:simpleType>
					</xs:element>
				</xs:sequence>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
</xs:schema>



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.