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

    Copyright (C) 2012 JBoss Inc

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

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

    <!-- Simple types -->
    <xs:simpleType name="stringtype">
        <xs:restriction base="xs:string"/>
    </xs:simpleType>
    <xs:simpleType name="numerictype">
        <xs:restriction base="xs:long"/>
    </xs:simpleType>

    <!-- Type definition for texts -->
    <xs:complexType name="textType">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="lang" type="stringtype" use="required"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>

    <!-- Type definition for text containers -->
    <xs:complexType name="textcontainertype">
        <xs:sequence>
            <xs:element name="text" type="textType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <!-- Type definition for parameters -->
    <xs:complexType name="parametertype">
        <xs:sequence>
            <xs:element name="text" type="textType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="stringtype" use="required"/>
    </xs:complexType>

    <!-- Type definition for about -->
    <xs:complexType name="abouttype">
        <xs:sequence>
            <xs:element name="author" type="stringtype" minOccurs="1" maxOccurs="1"/>
            <xs:element name="company" type="stringtype" minOccurs="1" maxOccurs="1"/>
            <xs:element name="url" type="stringtype" minOccurs="0" maxOccurs="1"/>
            <xs:element name="license" type="stringtype" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
    </xs:complexType>

    <!-- Root declaration -->
    <xs:element name="phelp">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="about" type="abouttype" minOccurs="0" maxOccurs="1"/>
                <xs:element name="panel-id" type="stringtype" minOccurs="1" maxOccurs="unbounded"/>
                <xs:element name="usage" type="textcontainertype" minOccurs="1" maxOccurs="1"/>
                <xs:element name="edit-usage" type="textcontainertype" minOccurs="0" maxOccurs="1"/>
                <xs:element name="panel-parameter" type="parametertype" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>
