<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 2 U (http://www.xmlspy.com) by Architekt (Vienna University of Technology) -->
<xs:schema targetNamespace="http://studierstube.icg.tu-graz.ac.at/april" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://studierstube.icg.tu-graz.ac.at/april" xmlns:xsdoc="http://studierstube.icg.tu-graz.ac.at/xsdoc" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:annotation>
        <xs:documentation>
Author: Florian Ledermann (<a href="mailto:ledermann@ims.tuwien.ac.at">ledermann@ims.tuwien.ac.at</a>)
<p>
This is the schema documentation of the APRIL Components sub-schema. For the main APRIL Schema, see <a href="april-spec.html">the APRIL specification</a>.

To get an overview over this schema, you can also use its <a href="component-schema.png">graphical representation</a>.</p>
        </xs:documentation>
    </xs:annotation>
    <xs:element name="component">
        <xs:annotation>
            <xs:documentation>Specifiaction and implementation of an APRIL component</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="interface">
                    <xs:annotation>
                        <xs:documentation>Wrapper for the interface definition (i.e. field declarations) of the component.</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="field" type="fieldType" minOccurs="0" maxOccurs="unbounded">
                                <xs:annotation>
                                    <xs:documentation>A field of the component that can be used for input and output of information. Should be matched by a "in" and a "out" element in each implementation.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="input" type="fieldType" minOccurs="0" maxOccurs="unbounded">
                                <xs:annotation>
                                    <xs:documentation>An input field of the component. Has to be matched by an "in" marker element in the implementation.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                            <xs:element name="output" type="fieldType" minOccurs="0" maxOccurs="unbounded">
                                <xs:annotation>
                                    <xs:documentation>An output field of the component. Has to be matched by an "out" marker in each implementation.</xs:documentation>
                                </xs:annotation>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
                <xs:element name="implementation" maxOccurs="unbounded">
                    <xs:annotation>
                        <xs:documentation>Wrapper for an implementation (of possibly several) of the component. Put your code in here.</xs:documentation>
                    </xs:annotation>
                    <xs:complexType>
                        <xs:complexContent>
                            <xs:extension base="contentType">
                                <xs:attribute name="type" use="optional">
                                    <xs:annotation>
                                        <xs:documentation>The type (=host language) of this implementation. At the moment, the only possible value is "OpenInventor"</xs:documentation>
                                    </xs:annotation>
                                    <xs:simpleType>
                                        <xs:restriction base="xs:NMTOKEN">
                                            <xs:enumeration value="OpenInventor"/>
                                        </xs:restriction>
                                    </xs:simpleType>
                                </xs:attribute>
                                <xs:attribute name="requires" type="xs:string" use="optional">
                                    <xs:annotation>
                                        <xs:documentation>Additional requirements (libraries, files) to run this component. This is a list of space-seperated URLs. The exact meaning of it is language dependent. For OIV components, these are pointers to additional classes that are loaded form external dlls, specified by the syntax path_to_dll/dllName#className (please do not specify the extension .dll, as this is platform dependent)</xs:documentation>
                                    </xs:annotation>
                                </xs:attribute>
                            </xs:extension>
                        </xs:complexContent>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
            <xs:attribute name="id" type="xs:ID" use="required">
                <xs:annotation>
                    <xs:documentation>The id of the component. This should be unique.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="contentType" mixed="true">
        <xs:annotation>
            <xs:documentation>Type used for the implementation</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="id"/>
                <xs:element name="in" type="refType">
                    <xs:annotation>
                        <xs:documentation>A marker for the actual input in the implementation. The exact usage of this is language dependent. For OIV components, this is used instead of the field value of a field that you want to control, and must be empty.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="out" type="refType">
                    <xs:annotation>
                        <xs:documentation>A marker for the actual output in the implementation. The exact usage of this is language dependent. For OIV components, this can appear anywhere in your implementation and should contain the full reference name (DEFname.fieldname) of the field that is used for output, and can therefore also contain id markers.</xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:choice>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="fieldType">
        <xs:annotation>
            <xs:documentation>Type used for fields, inputs and outputs</xs:documentation>
        </xs:annotation>
        <xs:attribute name="id" type="xs:ID" use="required">
            <xs:annotation>
                <xs:documentation>The fields id/name. This is referenced by the in/out markers in the implementation and in the presentation file.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="type" use="required">
            <xs:annotation>
                <xs:documentation>Type of the field. One of the OIV basic types.</xs:documentation>
            </xs:annotation>
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="SFString"/>
                    <xs:enumeration value="MFString"/>
                    <xs:enumeration value="SFVec2f"/>
                    <xs:enumeration value="SFVec3f"/>
                    <xs:enumeration value="SFRotation"/>
                    <xs:enumeration value="SFFloat"/>
                    <xs:enumeration value="SFInt32"/>
                    <xs:enumeration value="SFBool"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
        <xs:attribute name="default" use="optional">
            <xs:annotation>
                <xs:documentation>Default value if no other value is specified.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="const" type="xs:boolean" use="optional" default="false">
            <xs:annotation>
                <xs:documentation>If this is true, the field may be initialized, but not changed afterwards. Only enforced for inputs.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="useconfig" type="xs:string" use="optional">
            <xs:annotation>
                <xs:documentation>NOT IMPLEMENTED. This will be used to read a configuration value from the setup file directly into a component to influence its behaviour independent from the actual presentation.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>
    <xs:complexType name="refType" mixed="true">
        <xs:annotation>
            <xs:documentation>Type used for the in and out markers inside the implementation</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="id" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:IDREF" use="required">
            <xs:annotation>
                <xs:documentation>The id of the field this marker refers to.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>
    <xs:element name="id">
        <xs:annotation>
            <xs:documentation>A marker that will be replaced by a unique id of the instance at APRIL compile time. Use this as a prefix for your internal names to guarantee unique identifiers even if multiple instances of the component are used.</xs:documentation>
        </xs:annotation>
    </xs:element>
</xs:schema>

