- From: Lindsey McNerney <lindzer1@yahoo.com>
- Date: Tue, 20 Jun 2000 08:10:40 -0700 (PDT)
- To: xerces-j-dev@xml.apache.org, xmlschema-dev@w3.org
Below you will find a copy of a sample XML file with
errors and the schema I am trying to validate using
xerces 1.1.1. I initially validated the files using
XMLSpy and all my errors were recognized. I know that
there are some bugs surrounding enumerated values and
minLength and maxLength in Apache that should be fixed
for the 1.1.1 release. But I am getting some
additional parser failures...
Limitations of Finite Occurrences:
StoreName, the schema defines StoreName with a max
occurrence of 2, however the sample has 3 occurrences
and the file still validates.
Limitations of Facet Constraints:
The parser does not validate the values defined by the
min/maxInclusive facets.
Limitations of "Sequence" default for elements:
In this instance the parser does recognize if my
element order is out of sequence, however if there is
a schema with only two elements defined the parser
does not validate sequence, in other words three or
more elements must be defined in a schema for the
parser to validate the content model correctly.
Limitations of Data Typing:
The parser does not catch the incorrect value for
CreationDate? Has any one gotten a type of "date" to
work?
Has any on encountered similar problems? Are these
also bugs in the current release?
sample file***
<?xml version="1.0" encoding="ISO-8859-1"?>
<Store
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="Store.xsd"
StoreId="1232">
<StoreNumber CreationDate="abcdef"
>abcd</StoreNumber>
<StoreLocation>anywhere</StoreLocation>
<StoreName>My Store Incorporated</StoreName>
<StoreName>My Store Incorporated</StoreName>
<StoreName>My Store Incorporated</StoreName>
<NumberOfEmployees>2002</NumberOfEmployees>
<StoreOwner>Jim Smith</StoreOwner>
<NumberOfEmployees>2002</NumberOfEmployees>
</Store>
sample schema***
<?xml version="1.0" encoding="ISO-8859-1"?>
<schema xmlns="http://www.w3.org/1999/XMLSchema">
<element name="Store">
<complexType>
<element name="StoreNumber">
<complexType base="decimal"
derivedBy="extension">
<attribute name="CreationDate" type="date"/>
</complexType>
</element
<element name="StoreLocation">
<simpleType base="string">
<enumeration value = "USA"/>
<enumeration value = "Canada"/>
</simpleType>
</element>
<element name="StoreName" minOccurs="0"
maxOccurs="2">
<simpleType base="string">
<minLength value = "1"/>
<maxLength value = "10"/>
</simpleType>
</element>
<element name="StoreOwner">
<complexType content="mixed">
<attribute name="YearsOwned" type="integer"
use="required"/>
<attribute name="OriginalOwner" type="string"
use="optional"/>
</complexType>
</element>
<element name="NumberOfEmployees">
<simpleType base="integer">
<minInclusive value="1"/>
<maxInclusive value="2001"/>
</simpleType>
</element>
<attribute name="StoreId">
<simpleType base="string">
<enumeration value = "1234"/>
<enumeration value = "5678"/>
</simpleType>
</attribute>
</complexType>
</element>
</schema>
__________________________________________________
Do You Yahoo!?
Send instant messages with Yahoo! Messenger.
http://im.yahoo.com/
Received on Tuesday, 20 June 2000 11:10:43 UTC