Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: block attribute and substitution groups

From: Sandy Gao <sandygao@--.---.--->
To: Tobias Koenig <tobias.koenig@---------.--->
Date: 1/7/2009 4:36:00 AM
The schema is valid, but if you have an instance like:

<root xmlns="ElemDecl/disallowedSubst">
  <Member1/>
</root>

Then you would get an error. And the error disappears if you remove the=

"block" attribute from the schema.

The "validly substitutable" rule is checked when the instance is valida=
ted,
and not when the schema is built.

Thanks,
Sandy Gao
XML Technologies, IBM Canada
Editor, W3C XML Schema WG
Member, W3C SML WG
(1-905) 413-3255 T/L 313-3255



                                                                       =
    
             Tobias Koenig                                             =
    
             <tobias.koenig@tr                                         =
    
             olltech.com>                                              =
 To 
             Sent by:                  xmlschema-dev@w...            =
    
             xmlschema-dev-req                                         =
 cc 
             uest@w...                                               =
    
                                                                   Subj=
ect 
                                       block attribute and substitution=
    
             07/01/2009 06:25          groups                          =
    
             AM                                                        =
    
                                                                       =
    
                                                                       =
    
                                                                       =
    
                                                                       =
    
                                                                       =
    





Hej,

today I have a question about the block attribute in conjunction with
substitution groups.

Let's assume the following schema
=========================
=================
<xsd:schema
  xmlns="ElemDecl/disallowedSubst"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  targetNamespace="ElemDecl/disallowedSubst"
  elementFormDefault="qualified"
  >

  <xsd:element name="root">
      <xsd:complexType>
          <xsd:sequence>
              <xsd:element ref="Head" maxOccurs="unbounded"/>
          </xsd:sequence>
      </xsd:complexType>
  </xsd:element>

  <xsd:element name="Head" type="Type"/>

  <xsd:complexType name="Type" block="restriction"/>

  <xsd:complexType name="derivedFromType">
      <xsd:complexContent>
          <xsd:restriction base="Type"/>
      </xsd:complexContent>
  </xsd:complexType>

  <xsd:element name="Member1" type="derivedFromType"
substitutionGroup="Head"/>

</xsd:schema>
=========================
==================
according to the test suite and some schema validators it is correct.

However I stumble about http://www.w3.org/TR/xmlschema11-1/#e-props-cor=
rect
4)
that defines
             For each member M of E.{substitution group affiliations},
E.{type definition}
             is =B7validly substitutable=B7 for M.{type definition}, su=
bject to
the blocking
             keywords in M.{substitution group exclusions}.

So when checking element Member1, derivedFromType must be validly
substitutable for Type, subject to the blocking keywords (empty set in =
this

case)

When checking =B7validly substitutable=B7, the first case (both are com=
plex
types)
is used, which means:
             derivedFromType is validly derived from Type subject to th=
e
blocking keywords
             in the union of {empty set} and {restriction}, as defined =
in
Type Derivation
             OK (Complex) (=A73.4.6.5)

Now when testing Type Derivation Ok (Complex) all rules from
http://www.w3.org/TR/xmlschema11-1/#cos-ct-derived-ok must be true, how=
ever
the first fails, as derivedFromType and Type are not the same type
but 'restriction' _is_ part of the constraint set.

Where is my error in reasoning? Any help is appreciated.

Ciao,
Tobias

=


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent