Hi Dane,
It seems all errors are caused by the same reason: you are trying to have a
complexType derived from a simpleType by restriction. For example:
<xs:complexType name="phone">
<xs:simpleContent>
<xs:restriction base="xs:string">
<xs:minLength value="12"/>
<xs:maxLength value="12"/>
<xs:attribute ref="eid" use="required"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
Bullet 2 of "Complex Type Definition Representation OK" [1] makes it clear
that for simpleContent + simpleType base, the derivation method must be
"extension".
So I believe Xerces is right. To make it work for you, there are two ways:
(1)
<xs:complexType name="phone_base">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="eid" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="phone">
<xs:simpleContent>
<xs:restriction base="phone_base">
<xs:minLength value="12"/>
<xs:maxLength value="12"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
(2)
<xs:simpleType name="myString">
<xs:restriction base="xs:string">
<xs:minLength value="12"/>
<xs:maxLength value="12"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="phone">
<xs:simpleContent>
<xs:extension base="myString">
<xs:attribute ref="eid" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
[1] http://www.w3.org/TR/xmlschema-1/#src-ct
Hope this helps,
Sandy Gao
Software Developer, IBM Canada
(1-416) 448-3255
[EMAIL PROTECTED]
"Dane Foster"
<dfoster@equit To: <[EMAIL PROTECTED]>
ytg.com> cc:
Subject: Schema errors
08/09/2001
06:45 PM
Please respond
to
xerces-j-dev
Hello all. I'm having a problem that I need some help with. I have a
Schema that validates without errors using XML Spy 4 beta 2. I've also
validated it using the W3C's web based validator without errors. But when
I
try to validate an XML instance against the Schema using Xerces-J v1.4.2,
Xerces reports Schema errors. Based on the cause of the errors either
Xerces is right and the other validators are wrong or vice-versa.
If it turns out that Xerces's Schema evaluation is correct could someone
suggest replacement language for the content-models that are causing the
errors.
The Schema is located at:
http://www.equitytg.com/XML/Schema/SB2Questionnaire.xsd
The errors are:
<Error>
Schema error: Anonymous complexType: ct-props-correct.2: The type
'xs:string' is a simple type. It cannot be used in a derivation by
RESTRICTION for a complexType.
line 2
column 262</Error>
<Error>
Schema error: Anonymous complexType: ct-props-correct.2: The type
'xs:positiveInteger' is a simple type. It cannot be used in a derivation
by
RESTRICTION for a complexType.
line 2
column 262</Error>
<Error>
Schema error: ComplexType 'extended-integer': ct-props-correct.2: The type
'xs:positiveInteger' is a simple type. It cannot be used in a derivation
by
RESTRICTION for a complexType.
line 2
column 262</Error>
<Error>
Schema error: ComplexType 'phone': ct-props-correct.2: The type 'xs:string'
is a simple type. It cannot be used in a derivation by RESTRICTION for a
complexType.
line 2
column 262</Error>
<Error>
Schema error: ComplexType 'month-type': ct-props-correct.2: The type
'xs:positiveInteger' is a simple type. It cannot be used in a derivation
by
RESTRICTION for a complexType.
line 2
column 262</Error>
<Error>
Schema error: ComplexType 'year-type': ct-props-correct.2: The type
'xs:positiveInteger' is a simple type. It cannot be used in a derivation
by
RESTRICTION for a complexType.
line 2
column 262</Error>
<Error>
Schema error: ComplexType 'yes-no': ct-props-correct.2: The type
'xs:string'
is a simple type. It cannot be used in a derivation by RESTRICTION for a
complexType.
line 2
column 262</Error>
<Error>
Schema error: Anonymous complexType: ct-props-correct.2: The type
'xs:string' is a simple type. It cannot be used in a derivation by
RESTRICTION for a complexType.
line 2
column 262</Error>
<Error>
Schema error: Anonymous complexType: cos-all-limited.1.2: An "all" model
group that is part of a complex type definition must constitute the entire
{content type} of the definition..
line 2
column 262</Error>
<Error>
Schema error: Anonymous complexType: ct-props-correct.2: The type
'xs:string' is a simple type. It cannot be used in a derivation by
RESTRICTION for a complexType.
line 2
column 262</Error>
<Error>
Schema error: Anonymous complexType: ct-props-correct.2: The type
'xs:string' is a simple type. It cannot be used in a derivation by
RESTRICTION for a complexType.
line 2
column 262</Error>
Dane Foster
Equity Technology Group, Inc
http://www.equitytg.com.
954.360.9800
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]