W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2003

block-attribute and XSV

From: Rainer Becker <w3cschema@rbecker.de>
Date: Fri, 14 Mar 2003 12:58:00 +0100
Message-ID: <3E71C3C8.C92F488@rbecker.de>
To: xmlschema-dev@w3.org

Hallo,

sorry if this question is too simple ,

Please consider the following documents:

Instance:
#########

<List xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="4.xsd"
      xsi:type="ct_derivedList">

 <A>test</A>
 <B>test</B>
 <C>test</C>

</List>

Schema
######
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

   <xs:complexType name="ct_List">
      <xs:sequence>
         <xs:element name="A" type="xs:string" />
         <xs:element name="B" type="xs:string" />
       </xs:sequence>
   </xs:complexType>

   <xs:complexType name="ct_derivedList">
      <xs:complexContent>
         <xs:extension base="ct_List">
            <xs:sequence>
               <xs:element name="C" type="xs:string" />
            </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:element name="List" type="ct_List" block="#all" />

</xs:schema>

Please note the the block-attribute on the element declaration
of List.

Question:

No matter if I put in extension, oder #all as a value of block.
XSV does not complain.

What I expected was something like: "use of type ct_derivedList is
blocked"
because "ct_derivedList" is derived by extension from "ct_List". I thnk
that the value of the block-attribute is evaluated at valididation time.
Because
there is a value of #all, the derivation should be blocked.

As you can see from the following snippet, XSV is satisfied with it.
I can not find any mistake in this, why doesn´t XSV complain.....?


Here is a snippet of what xsv tells me...
-----------------------------------------

Schema validating with XSV 2.2-4 of 2003/01/21 23:23:04
Target: file:///C:/WINDOWS/Desktop/4.xml
docElt: {None}List
Validation was strict, starting with type {None}:ct_derivedList
schemaLocs: None -> 4.xsd
The schema(s) used for schema-validation had no errors
No schema-validity problems were found in the target

--------------------------------------------------------------------------------

Schema resources involved
Attempt to load a schema document from
file:///C:/WINDOWS/Desktop/4.xsd (source: schemaLoc)
for no namespace, succeeded


Thank you,

Rainer
Received on Friday, 14 March 2003 06:59:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT