diff options
Diffstat (limited to 'xsd/examples/cxx/tree/polymorphism/supermen.xsd')
-rw-r--r-- | xsd/examples/cxx/tree/polymorphism/supermen.xsd | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/xsd/examples/cxx/tree/polymorphism/supermen.xsd b/xsd/examples/cxx/tree/polymorphism/supermen.xsd new file mode 100644 index 0000000..ffdd21c --- /dev/null +++ b/xsd/examples/cxx/tree/polymorphism/supermen.xsd @@ -0,0 +1,49 @@ +<?xml version="1.0"?> + +<!-- + +file : examples/cxx/tree/polymorphism/supermen.xsd +author : Boris Kolpackov <boris@codesynthesis.com> +copyright : not copyrighted - public domain + +--> + +<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + + <xsd:complexType name="person"> + <xsd:sequence> + <xsd:element name="name" type="xsd:string"/> + </xsd:sequence> + </xsd:complexType> + + <!-- substitution group root --> + <xsd:element name="person" type="person"/> + + + <xsd:complexType name="superman"> + <xsd:complexContent> + <xsd:extension base="person"> + <xsd:attribute name="can-fly" type="xsd:boolean" use="required"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:element name="superman" type="superman" substitutionGroup="person"/> + + <xsd:complexType name="batman"> + <xsd:complexContent> + <xsd:extension base="superman"> + <xsd:attribute name="wing-span" type="xsd:unsignedInt" use="required"/> + </xsd:extension> + </xsd:complexContent> + </xsd:complexType> + + <xsd:complexType name="supermen"> + <xsd:sequence> + <xsd:element ref="person" maxOccurs="unbounded"/> + </xsd:sequence> + </xsd:complexType> + + <xsd:element name="supermen" type="supermen"/> + +</xsd:schema> |