<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            
            <xsd:include schemaLocation="NrOfStructures.xsd"/>
            <xsd:include schemaLocation="RenderingMode.xsd"/>
            <xsd:include schemaLocation="Color.xsd"/>
            <xsd:include schemaLocation="Atom.xsd"/>
            <xsd:include schemaLocation="Cell.xsd"/>
            
            <xsd:group name="StructuralComponent">
                <xsd:sequence>
                    <xsd:element name="structuralComponent" type="StructuralComponent"/>
                </xsd:sequence>
            </xsd:group>
            
            <xsd:complexType name="StructuralComponent">
                <xsd:annotation>
                    <xsd:documentation>
                        A structural component is a group of structures.
                        It is generally composed of cells, although it can be composed of atoms.
                        Note that a cell can also be considered as a structural component as it is 
                        defined by a set of atoms.
                        nrOfStructures is optional and is used for optimization.
                        Attribute mode indicates what is the default 3D graphic representation.
                    </xsd:documentation>
                </xsd:annotation>
                <xsd:sequence>
                    <xsd:element name="color" type="Color" minOccurs="0"/>
                    <xsd:element name="nrOfStructures" type="NrOfStructures" minOccurs="0"/>
                    <xsd:choice>
                        <xsd:element name="atom" type="Atom" minOccurs="0" maxOccurs="unbounded"/>
                        <xsd:element name="cell" type="Cell" minOccurs="0" maxOccurs="unbounded"/>
                        <xsd:element name="atomRef" type="AtomRef" minOccurs="0" maxOccurs="unbounded"/>
                    </xsd:choice>
                </xsd:sequence>        
                <xsd:attribute name="name" type="xsd:string"/>
                <xsd:attribute name="mode" type="RenderingMode"/>        
                <!-- adding any kind of attributes -->
                <xsd:anyAttribute namespace="##any" processContents="lax"/> 
            </xsd:complexType>
            
</xsd:schema>