<?xml version="1.0" encoding="UTF-8"?>
<!--
// Description : simpleTypes.xsd
// Author: The SPIRIT Consortium Schema Working Group
// 
// Revision:    $Revision: 1235 $
// Date:        $Date: 2008-04-03 12:08:47 -0500 (Thu, 03 Apr 2008) $
// 
// Copyright (c) 2005, 2006, 2007, 2008 The SPIRIT Consortium.
// 
// This work forms part of a deliverable of The SPIRIT Consortium.
// 
// Use of these materials are governed by the legal terms and conditions
// outlined in the disclaimer available from www.spiritconsortium.org.
// 
// This source file is provided on an AS IS basis.  The SPIRIT
// Consortium disclaims any warranty express or implied including
// any warranty of merchantability and fitness for use for a
// particular purpose.
// 
// The user of the source file shall indemnify and hold The SPIRIT
// Consortium and its members harmless from any damages or liability.
// Users are requested to provide feedback to The SPIRIT Consortium
// using either mailto:feedback@lists.spiritconsortium.org or the forms at 
// http://www.spiritconsortium.org/about/contact_us/
// 
// This file may be copied, and distributed, WITHOUT
// modifications; this notice must be included on any copy.
-->
<xs:schema xmlns:spirit="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.5" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.5" elementFormDefault="qualified" attributeFormDefault="qualified">
    <xs:simpleType name="scaledInteger">
        <xs:annotation>
            <xs:documentation>A scaled integer.  It supports any string recognized by java.lang.Long.decode().  It also supports a magnitude scale suffix of upper or lower case K (kilo=2^10), M (mega=2^20), G (giga=2^30) or T (tera=2^40).</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:pattern value="[+\-]?(0x|0X|#)?[0-9a-fA-F]+[kmgtKMGT]?"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="scaledNonNegativeInteger">
        <xs:annotation>
            <xs:documentation>A scaled nonnegative integer that consists of the value set {0, 1, ...}.  It is derived from scaledInteger and it supports a magnitude scale suffix of upper or lower case K (kilo=2^10), M (mega=2^20), G (giga=2^30) or T (tera=2^40).</xs:documentation>
        </xs:annotation>
        <xs:restriction base="spirit:scaledInteger">
            <xs:pattern value="[+]?(0x|0X|#)?[0-9a-fA-F]+[kmgtKMGT]?"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="scaledPositiveInteger">
        <xs:annotation>
            <xs:documentation>A scaled positive integer that consists of the value set {1, 2, ...}.  It is derived from scaledNonNegativeInteger and it supports a magnitude scale suffix of upper or lower case K (kilo=2^10), M (mega=2^20), G (giga=2^30) or T (tera=2^40).</xs:documentation>
        </xs:annotation>
        <xs:restriction base="spirit:scaledNonNegativeInteger">
            <xs:pattern value="[+]?(0x|0X|#)?[0]*[1-9a-fA-F][0-9a-fA-F]*[kmgtKMGT]?"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="doubleList">
        <xs:annotation>
            <xs:documentation>List of doubles.  Used to build configurableDouble type.</xs:documentation>
        </xs:annotation>
        <xs:list itemType="xs:double"/>
    </xs:simpleType>
    <xs:simpleType name="configurableDouble">
        <xs:annotation>
            <xs:documentation>Can be a double or an empty string.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="spirit:doubleList">
            <xs:minLength value="0"/>
            <xs:maxLength value="1"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="portName">
        <xs:annotation>
            <xs:documentation>A type for a port name string, allows letters, digits, dash, colon, underscore and period</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:pattern value="\i[\p{L}\p{N}\.\-:_]*"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="instancePath">
        <xs:annotation>
            <xs:documentation>A type for a instance name path string, allows letters, digits, dash, colon, underscore, period and slash</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:whiteSpace value="collapse"/>
            <xs:pattern value="\i[\p{L}\p{N}\.\-:_]*"/>
            <xs:pattern value="\i[\p{L}\p{N}\.\-:_]*/\i[\p{L}\p{N}\.\-:_]*"/>
            <xs:pattern value="(\i[\p{L}\p{N}\.\-:_]*/)+[\i\p{L}\p{N}\.\-:_]*"/>
        </xs:restriction>
    </xs:simpleType>
</xs:schema>
