validator.xsd 4.5 KB
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://www.rcaap.pt/xsd/validator" elementFormDefault="qualified"
	xmlns="http://www.rcaap.pt/xsd/validator" xmlns:xlink="http://www.w3.org/1999/xlink">

	<xs:element name="configuration" type="Configuration" />

	<xs:complexType name="Configuration">
		<xs:sequence>
			<xs:element name="platforms" type="Platforms" minOccurs="1"
				maxOccurs="1" />
			<xs:element name="profiles" type="Profiles" minOccurs="1"
				maxOccurs="1" />
			<xs:element name="preConditions" type="PreConditions" minOccurs="1"
				maxOccurs="1" />
			<xs:element name="checks" type="Checks" minOccurs="1"
				maxOccurs="1" />
		</xs:sequence>
		<xs:attribute name="lastChangeDate" type="xs:dateTime"
			use="required" />
		<xs:attribute name="version" type="xs:string" />
	</xs:complexType>

	<xs:complexType name="Platforms">
		<xs:sequence>
			<xs:element name="platform" type="Platform" minOccurs="1"
				maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="Platform">
		<xs:sequence>
			<xs:element name="profile" type="ProfileRefId" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:ID" use="required" />
		<xs:attribute name="name" type="xs:string" use="required" />
	</xs:complexType>

	<xs:complexType name="Profiles">
		<xs:sequence>
			<xs:element name="profile" type="Profile" minOccurs="1"
				maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="Profile">
		<xs:sequence>
			<xs:element name="translation" type="Translation"
				minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="preCondition" type="PreConditionRefId" minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="check" type="CheckRefId" minOccurs="1" maxOccurs="unbounded" />
		</xs:sequence>
		<xs:attribute name="id" type="xs:ID" use="required" />
		<xs:attribute name="name" type="xs:string" />
	</xs:complexType>

	<xs:complexType name="PreConditions">
		<xs:sequence>
			<xs:element name="preCondition" type="PreCondition" minOccurs="1"
				maxOccurs="unbounded" />
		</xs:sequence>

	</xs:complexType>
	<xs:complexType name="Checks">
		<xs:sequence>
			<xs:element name="check" type="Check" minOccurs="1"
				maxOccurs="unbounded" />
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="ProfileRefId">
		<xs:attribute name="refid" type="xs:IDREF" use="required" />
	</xs:complexType>
	
	<xs:complexType name="PreConditionRefId">
		<xs:attribute name="refid" type="xs:IDREF" use="required" />
	</xs:complexType>

	<xs:complexType name="CheckRefId">
		<xs:attribute name="refid" type="xs:IDREF" use="required" />
	</xs:complexType>

	<xs:complexType name="PreCondition">
		<xs:sequence>
			<xs:element name="class" type="xs:string" minOccurs="1"
				maxOccurs="1" />
			<xs:element name="parameter" type="Parameter" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:ID" use="required" />
	</xs:complexType>

	<xs:complexType name="Check">
		<xs:sequence>
			<xs:element name="translation" type="Translation"
				minOccurs="0" maxOccurs="unbounded" />
			<xs:element name="class" type="xs:string" minOccurs="1"
				maxOccurs="1" />
			<xs:element name="parameter" type="Parameter" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:ID" use="required" />
		<xs:attribute name="severity" type="Severity" use="required" />
		<xs:attribute name="other_severity" type="xs:string" use="optional" />
	</xs:complexType>

	<xs:complexType name="Parameter">
		<xs:sequence>
			<xs:element name="value" type="xs:string" minOccurs="1"
				maxOccurs="unbounded" />
		</xs:sequence>
		<xs:attribute name="key" type="ParameterKeyType" use="required" />
	</xs:complexType>

	<xs:complexType name="Translation">
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="element" type="xs:string" use="required" />
				<xs:attribute name="lang" type="xs:string" use="required" />
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:simpleType name="Severity">
		<xs:restriction base="xs:string">
			<xs:enumeration value="OTHER" />
			<xs:enumeration value="WARNING" />
			<xs:enumeration value="ERROR" />
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="ParameterKeyType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="field" />
			<xs:enumeration value="fields" />
			<xs:enumeration value="operator" />
			<xs:enumeration value="value" />
		</xs:restriction>
	</xs:simpleType>
</xs:schema>