xerces-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sandy...@ca.ibm.com
Subject Re: SubstitutionGroup & final attribute query
Date Mon, 10 Sep 2001 15:19:50 GMT
Hi Stuart,

In the declaration of "anyHead" element, no "final" is specified, so
"finalDefault" of the <schema> element is used, and {substitution group
exclusions} for "anyHead" is "restriction".

"Schema Component Constraint: Element Declaration Properties Correct",
point 3:
"3 If there is an {substitution group affiliation}, the {type definition}
of the element declaration must be validly derived from the {type
definition} of the {substitution group affiliation}, given the value of the
{substitution group exclusions} of the {substitution group affiliation}, as
defined in Type Derivation OK (Complex) (§3.4.6) (if the {type definition}
is complex) or as defined in Type Derivation OK (Simple) (§3.14.6) (if the
{type definition} is simple)."

That means, any element of a type that's derived by "restriction" from the
type of "anyHead" (anyType in this case) is not allowed to substitute
"anyHead". So the parser is correct to report an error on
"simpleSubstitute". For the same reason, the parser should also report an
error on "complexSubstitute", but it fails to, which is a bug. I'll look
into it, and fixed it if possible.

In the meantime, could you file a bug report in bugzilla
(http://nagoya.apache.org/bugzilla)? And how important is it for you to
have this fixed? Are you depending on this functionality, or just doing
some experiment? To tell you the truth, fixing this bug could be
time-consuming: the type derivation checking in Xerces1 is not so pretty.

Cheers,
Sandy Gao
Software Developer, IBM Canada
(1-416) 448-3255
sandygao@ca.ibm.com



                                                                                         
                               
                    <stuart.welham@vodaf                                              
                                  
                    one.co.uk>                 To:     xerces-j-user@xml.apache.org   
                                  
                                               cc:                                       
                               
                    09/10/2001 10:23 AM        Subject:     SubstitutionGroup & final
attribute query                    
                    Please respond to                                                    
                               
                    xerces-j-user                                                        
                               
                                                                                         
                               
                                                                                         
                               




Hi

I'm using a substitutionGroup with a head element of type xsd:anyType
together with two substitutable elements, one a simpletype
[simpleSubstitute] and the other a complexType [complexSubstitute] (see
attached XML Schema & instance files).

Xerces-J 1_4_3 using the Schema as attached gives the following validation
error 'Schema error: element simpleSubstitute cannot be part of the
substitution group headed by anyHead.'.

However if I remove the finalDefault="restriction" from the xsd:schema
element, xerces-J is able to validate Substitution.xml ok.

Am I correct in believing that it is ok to substitute either a simpleType
or
a complexType for a head element of type xsd:anyType regardless of the
value
of the final attribute and that the error stated above is caused by
incorrect handling of the finalDefault attribute or am I missing something
about how substitutionGroups function in the presence of
final="restriction".

Regards
Stu
--
Stuart Welham - Software Engineer, Vodafone Multimedia
--




---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org

#### Substitution.xml has been removed from this note on September 10 2001
by Sandy Gao
#### Substitution.xsd has been removed from this note on September 10 2001
by Sandy Gao



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Mime
View raw message