P
ProgrammierMan
Hi folks,
I don't know what the block attribute means. The final attribute looks
like to be simple: I can prevent derivations. Did I write
final="restriction" and I restrict it in another complexType XML Spy
said, that it's wrong - fine.
But my "block" examples don't work:
Schema:
<xs:complexType name="AA">
<xs:complexContent>
<xs:extension base="XXX">
<xs:sequence>
<xs:element name="AA" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="BB">
<xs:complexContent>
<xs:extension base="XXX">
<xs:sequence>
<xs:element name="BB" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="XXX" abstract="true" block="extension">
<xs:sequence>
<xs:element name="A" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="test" type="XXX"/>
Instance:
<ttt:test xmlns:ttt="http://Olli"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://Olli
C:\test.xsd" xsi:type="ttt:AA">
<A></A>
<AA></AA>
</ttt:test>
----
I expected, that the Validator give a message like: No you forbid it
-you said in the schema that you don't want! But Xml Spy means
everything is fine. Why? Maybe you've got a better example for me to
learn what "block" means.
tnx a lot,
Olli
I don't know what the block attribute means. The final attribute looks
like to be simple: I can prevent derivations. Did I write
final="restriction" and I restrict it in another complexType XML Spy
said, that it's wrong - fine.
But my "block" examples don't work:
Schema:
<xs:complexType name="AA">
<xs:complexContent>
<xs:extension base="XXX">
<xs:sequence>
<xs:element name="AA" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="BB">
<xs:complexContent>
<xs:extension base="XXX">
<xs:sequence>
<xs:element name="BB" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="XXX" abstract="true" block="extension">
<xs:sequence>
<xs:element name="A" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="test" type="XXX"/>
Instance:
<ttt:test xmlns:ttt="http://Olli"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://Olli
C:\test.xsd" xsi:type="ttt:AA">
<A></A>
<AA></AA>
</ttt:test>
----
I expected, that the Validator give a message like: No you forbid it
-you said in the schema that you don't want! But Xml Spy means
everything is fine. Why? Maybe you've got a better example for me to
learn what "block" means.
tnx a lot,
Olli