Re: schema parser limitations

Lindsey McNerney <lindzer1@yahoo.com> writes:

> I'm attempting to validate some sample XML documents
> against schemas using both the Oracle schema processor
> 0.9 and Apache's Xerces-J parser v1.1.1 and am not
> getting the expected results...When I validate the
> following XML document and supporting schema using the
> Apache parser, errors are not being detected e.g. the
> schema defines the element order and a set of
> enumerated values for the "StoreLocation" element,
> however the elements are out of order in the sample
> document and contains an incorrect enumerated value.
> 
> sample XML****
> <?xml version="1.0" encoding="UTF-8"?>
> <StoreName
> xmlns:xsi =
> "http://www.w3.org/1999/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation = "DevListApache.xsd">
>     <StoreLocation>NorthAmerica</StoreLocation>
>     <StoreId>1234</StoreId>
> </StoreName>
> 
> 
> sample schema****
> <?xml version="1.0" encoding="UTF-8"?>
> <schema>
>   <element name="StoreName">
>      <complexType>
>         <sequence>
>            <element name="StoreId" type="string"/>
> 	   <element name="StoreLocation" type="string">
> 	     <simpleType base="string">
> 	        <enumeration value = "USA"/>
> 		<enumeration value = "Europe"/>
> 	     </simpleType>
> 	    </element>
> 	 </sequence>		
>       </complexType>
>    </element>
> </schema>

I can't comment on the Oracle or Xerces schema validators.

There are two bugs with the above schema which might impact on your
ability to use them successfully:

1) the schema is not in the XML Schema namespace;
2) the element declaration for StoreLocation is not acceptable: you
have both a 'type' attribute and a nested simpleType.  XSV didn't
use to catch this, but it does now :-).  Result was to detect a typo
in the schema for datatypes :-(, also now fixed.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 22 June 2000 08:47:42 UTC