<?xml version="1.0" encoding="UTF-8"?>
<!--
Notice 
DSP0228 
Document: Message Registry XML Schema Specification
Version: 1.0.0
Status: Draft
Date: 04/18/2006
Author: Steve Hand and Linda Martinez
Description: XML schema specification for standard message registries.

Copyright © 2007 Distributed Management Task Force, Inc. (DMTF). All rights reserved. DMTF is a not-for-profit association of industry members dedicated to promoting enterprise and systems management and interoperability. Members and non-members may reproduce DMTF specifications and documents for uses consistent with this purpose, provided that correct attribution is given. As DMTF specifications may be revised from time to time, the particular version and release date should always be noted. Implementation of certain elements of this standard or proposed standard may be subject to third party patent rights, including provisional patent rights (herein "patent rights"). DMTF makes no representations to users of the standard as to the existence of such rights, and is not responsible to recognize, disclose, or identify any or all such third party patent right, owners or claimants, nor for any incomplete or inaccurate identification or disclosure of such rights, owners or claimants. DMTF shall have no liability to any party, in any manner or circumstance, under any legal theory whatsoever, for failure to recognize, disclose, or identify any such third party patent rights, or for such party’s reliance on the standard or incorporation thereof in its product, protocols or testing procedures. DMTF shall have no liability to any party implementing such standard, whether such implementation is foreseeable or not, nor to any patent owner or claimant, and shall have no liability or responsibility for costs or losses incurred if a standard is withdrawn or modified after publication, and shall be indemnified and held harmless by any party implementing the standard from any and all claims of infringement by a patent owner for such implementations. For information about patents held by third-parties which have notified the DMTF that, in their opinion, such patent may relate to or impact implementations of DMTF standards, visit http://www.dmtf.org/about/policies/disclosures.php.

Change Requests: 
	<change cr="WIPCR00273.001" type ="remove" description="ACCREDITATION_DATE attribute."/> 
	<change cr="WIPCR00273.001" type ="update" description="Updated Version attributes to use RegEx, OWNING_ENTITY and MESSAGE_ID documentation elements."/> 
	<change cr="WIPCR00273.002" type ="update" description="allow multiple SPECIFICATION elements, make CIM_SCHEMA optional and fix regEx, type of OWNING_ENTITY@NAME to string"/> 
	<change cr="WIPCR00273.002" type ="update" description="REGISTRY, IDENTIFICATION,  OWNING_ENTITY, EDITOR, FIXED_MESSAGE_INSTANCE_VALUES, MESSAGE_ID, MESSAGE_DESCRIPTION, MESSAGE_COMPONENTS, DYNAMIC_ELEMENT, and REPEAT_DYNAMIC_ELEMENT, and STATIC_ELEMENT descriptions."/> 
	<change cr="WIPCR00273.002" type ="add" description="attribute IDENTIFICATION@LANGUAGE, OWNING_ENTITY@CONTACT_GROUP, DYNAMIC_ELEMENT@SOURCE_PROPERTY"/> 
	<change cr="WIPCR00273.002" type ="add" description="string type to SPECIFICATION@NAME, EDITOR@EMAIL, EDITOR@NAME, EDITOR@ORGANIZATION, MESSAGE@NAME, DYNAMIC_ELEMENT@NAME, REPEAT_DYNAMIC_ELEMENT@NAME"/>
	<change cr="WIPCR00273.002" type ="update" description="changed MESSAGE_ID@WORKING_GROUP to MESSAGE_ID@PREFIX, made max 4 chars, made MESSAGE_ID@SEQUENCE_NUMBER max 4 digits and recommend leading 0's for format."/> 
	<change cr="WIPCR00273.002" type ="change" description="Updated to Draft 1.0.0"/> 
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:element name="DESCRIPTION" type="xs:string" nillable="false"/>
	<xs:element name="REGISTRY">
		<xs:annotation>
			<xs:documentation> A message registry is a normative expression of the CIM Errors and
				CIM AlertIndications. A registry consists of a list of values for the properties
				which define message CIM Instances. It is recommended that a message registry be
				created in a single source language; the DMTF will publish English registries only.
				It is not recommended that the dynamic elements contain translatable text because it
				would make localization of the message registry difficult. It is also not
				recommended that the CIM Message string property be used for localization.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="REGISTRY_DECLARATION"/>
				<xs:element ref="REGISTRY_ENTRIES"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="REGISTRY_DECLARATION">
		<xs:annotation>
			<xs:documentation> List of details about the registry </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="IDENTIFICATION"/>
				<xs:element ref="SPECIFICATION" maxOccurs="unbounded"/>
				<xs:element ref="CIM_SCHEMA" minOccurs="0"/>
				<xs:element ref="OWNING_ENTITY"/>
				<xs:element ref="EDITOR" maxOccurs="unbounded"/>
				<xs:element ref="DESCRIPTION"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="IDENTIFICATION">
		<xs:annotation>
			<xs:documentation> The name, version, and language of the registry. The name must be
				unique within the name of the owning entity (value of the NAME attribute of
				OWNING_ENTITY element).</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="NAME" type="xs:string" use="required"/>
			<xs:attribute name="VERSION" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[0-9]*\.[0-9]*(\.[0-9]*)?([a-zA-Z])?"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="LANGUAGE" type="xs:string" use="optional" default="en">
				<xs:annotation>
					<xs:documentation>The value for language shall follow the HTTP/1.1 Specification
						description of Language Tags ftp://ftp.isi.edu/in-notes/rfc2616.txt.
					</xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="SPECIFICATION">
		<xs:annotation>
			<xs:documentation> The name and version of the specification document that the registry
				was created for</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="NAME" type="xs:string" use="required"/>
			<xs:attribute name="VERSION" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[0-9]*\.[0-9]*(\.[0-9]*)?([a-zA-Z])?"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="CIM_SCHEMA">
		<xs:annotation>
			<xs:documentation> The version of the cim schema that the registry is dependent
			on</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="VERSION" use="required">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[0-9]*\.[0-9]*(\.[0-9]*)?"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="OWNING_ENTITY">
		<xs:annotation>
			<xs:documentation>The name of the entity that maintains and owns the message registry
				and the name of the group within the owning organization to contact about the
				message registry. For registries owned by the DMTF, the NAME must be 'DMTF' and the
				CONTACT_GROUP shall be the name of the official working group that has developed the
				registry. The NAME must be unique within all message registries since it is used as
				a scoping entity for other elements. If the NAME and CONTACT_GROUP are the same, the
				CONTACT_GROUP is not necessary. These attributes shall be used to construct the CIM
				OwningEntity property value in the form "@NAME@CONTACT_GROUP". </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="NAME" type="xs:string" use="required"/>
			<xs:attribute name="CONTACT_GROUP" type="xs:string" use="optional"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="EDITOR">
		<xs:annotation>
			<xs:documentation> The name, email, and organization of the message registry
			editor(s).</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="EMAIL" type="xs:string" use="required"/>
			<xs:attribute name="NAME" type="xs:string" use="required"/>
			<xs:attribute name="ORGANIZATION" type="xs:string" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="REGISTRY_ENTRIES">
		<xs:annotation>
			<xs:documentation> The list of messages defined in this registry </xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="MESSAGE" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="MESSAGE">
		<xs:annotation>
			<xs:documentation> The normative expression of what values define the message.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element ref="MESSAGE_ID"/>
				<xs:element ref="MESSAGE_DESCRIPTION" minOccurs="0">
					<xs:annotation>
						<xs:documentation> The description provides general guidelines for the
							purpose of the standard message, what information it is designed to
							convey, and its general usage. A profile may further define or
							constraint the usage of the message within the domain of the profile.
						</xs:documentation>
					</xs:annotation>
				</xs:element>
				<xs:element ref="MESSAGE_COMPONENTS"/>
				<xs:element ref="FIXED_MESSAGE_INSTANCE_VALUES" minOccurs="0" maxOccurs="2">
					<xs:annotation>
						<xs:documentation> There can be at most two FIXED_MESSAGE_INSTANCE_VALUES
							elements defined, one for an ERROR and one for an ALERT. There may be no
							FIXED_MESSAGE_INSTANCE_VALUES elements defined. </xs:documentation>
					</xs:annotation>
				</xs:element>
			</xs:sequence>
			<xs:attribute name="NAME" type="xs:string" use="required">
				<xs:annotation>
					<xs:documentation> A moniker used as a short description of the message. The
						name does not have to unique for all message, only the message ID does. But
						the name proves useful for any discussion about the message. For this
						purpose, the name should be as unique and descriptive as possible. For
						example, "HTTP Header malformed in POST Operation" is a better name that
						simply "protocol error". </xs:documentation>
				</xs:annotation>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="MESSAGE_ID">
		<xs:annotation>
			<xs:documentation>The MESSAGE_ID consists of a PREFIX and SEQUENCE_NUMBER attribute that
				shall be used as a unique identifier for the message amongst all message registries
				owned by a particular OWNING_ENTITY. If the OWNING_ENTITY NAME attribute is DMTF,
				then the PREFIX should be the abbreviation of the official working group name that
				has developed the message registry. The attributes shall be used to construct the
				CIM MessageID property value by concatenating the PREFIXand SEQUENCE_NUMBER
				attribute values as they are specified. It is recommended that the SEQUENCE_NUMBER
				is padded with leading zeros to a total length of at least four digits.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:attribute name="PREFIX" type="xs:NCName" use="required"/>
			<xs:attribute name="SEQUENCE_NUMBER" type="xs:nonNegativeInteger" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="MESSAGE_DESCRIPTION" type="xs:string">
		<xs:annotation>
			<xs:documentation> The description provides general guidelines for the purpose of the
				standard message, what information it is designed to convey, and its general usage.
				A profile may further define or constraint the usage of the message within the
				domain of the profile. </xs:documentation>
		</xs:annotation>
	</xs:element>
	<!-- Schema for message properties -->
	<xs:element name="MESSAGE_COMPONENTS">
		<xs:annotation>
			<xs:documentation> The combination of the static element values and the dynamic element
				values shall be used to produce the CIM Message string property. The elements shall
				be used to create the CIM Message property in the order that they appear in the
				MESSAGE_COMPONENTS entity, top to bottom. See the description of each static and
				dynamic element type for more information about how to construct each element.
				Dynamic elements shall contain not translated text because it would make
				localization of the message registry difficult.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:choice maxOccurs="unbounded">
				<xs:element ref="DYNAMIC_ELEMENT"/>
				<xs:element ref="STATIC_ELEMENT"/>
				<xs:element ref="REPEAT_DYNAMIC_ELEMENT"/>
			</xs:choice>
		</xs:complexType>
	</xs:element>
	<xs:element name="DYNAMIC_ELEMENT">
		<xs:annotation>
			<xs:documentation> Each dynamic element is an element in the CIM MessageArguments string
				array. The elements shall be used to create the CIM MessageArguments string array
				property in the order that they appear in the MESSAGE_COMPONENTS entity, top to
				bottom. The value of this element changes based on circumstances. There shall be
				only one dynamic element of a particular name for a particular message. It is not
				recommended that the dynamic element contain translatable text because it would make
				localization of the message registry difficult.</xs:documentation>
		</xs:annotation>
		<xs:complexType mixed="false">
			<xs:sequence>
				<xs:element ref="DESCRIPTION" minOccurs="0"/>
				<xs:element ref="POSSIBLE_VALUE" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:attribute name="NAME" type="xs:string" use="required"/>
			<xs:attribute name="SOURCE_PROPERTY" type="xs:string" use="optional">
				<xs:annotation>
					<xs:documentation>Used to indicate a CIM Schema property that must be used as
						the source for the value of the dynamic element. The format shall be CIM
						Class.Property for example CIM_Fan.ElementName </xs:documentation>
				</xs:annotation>
			</xs:attribute>
			<xs:attribute name="DATATYPE" use="required">
				<xs:annotation>
					<xs:documentation> The DATATYPE defines what data type the element of the
						MessageArgument property shall be coercible into. Even though the
						MessageArgument elements of type string, this attribute constrains the
						contents of that string. For example, if the DATATYPE is set to 'sint8', the
						value of the dynamic element or the value of one of the element of the
						dynamic element if that dynamic element is an array shall be a positive
						integer of appropriate number of digits. Another example, if the DATATYPE is
						set to 'reference', then the value of the dynamic element ought to contain
						the appropriate elements for a reference property.</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:NMTOKEN">
						<xs:enumeration value="sint8"/>
						<xs:enumeration value="uint16"/>
						<xs:enumeration value="sint16"/>
						<xs:enumeration value="uint32"/>
						<xs:enumeration value="sint32"/>
						<xs:enumeration value="uint64"/>
						<xs:enumeration value="sint64"/>
						<xs:enumeration value="string"/>
						<xs:enumeration value="boolean"/>
						<xs:enumeration value="real32"/>
						<xs:enumeration value="real64"/>
						<xs:enumeration value="datetime"/>
						<xs:enumeration value="reference"/>
						<xs:enumeration value="char16"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="IS_ARRAY" use="optional" default="false">
				<xs:annotation>
					<xs:documentation> This attribute defines whether this dynamic element is itself
						an array. The type of each element of this array is of the type defined in
						the DATATYPE attribute. The value of this dynamic element within the
						MessageArgument array shall contain elements delimited by commas, The
						presentation of the value of this dynamic element within the Message
						property should to have the elements of the dynamic element delimited by
						commas and surrounded by curly brackets. </xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:boolean"/>
				</xs:simpleType>
			</xs:attribute>
			<xs:attribute name="EXPECTED_IN_MESSAGE" use="optional" default="true">
				<xs:annotation>
					<xs:documentation> This attribute defines whether this dynamic element should
						appear in the Message property. If the attribute is false, the purpose of
						this dynamic element is to convey additional details about the message that
						are not intended for the end user reading the message. </xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:boolean"/>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="REPEAT_DYNAMIC_ELEMENT">
		<xs:annotation>
			<xs:documentation> This element is used to have the same dynamic element repeated in the
				MessageArguments property again after this dynamic element is used in this message
				once. Simply, this element refers to the previously defined dynamic element by
				referring to the NAME attribute so that it does not have to be redefined. This
				element has the same characteristics as the dynamic element of the same, including
				whether it is expected in the Message property. </xs:documentation>
		</xs:annotation>
		<xs:complexType mixed="false">
			<xs:attribute name="NAME" type="xs:string" use="required"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="POSSIBLE_VALUE">
		<xs:annotation>
			<xs:documentation> A possible value defines what values a DYMANIC_ELEMENT can take on.
			</xs:documentation>
		</xs:annotation>
		<xs:complexType mixed="true">
			<xs:sequence>
				<xs:element ref="DESCRIPTION" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:element name="STATIC_ELEMENT" type="xs:string" nillable="false">
		<xs:annotation>
			<xs:documentation> Each static element may be used literally along with the
				DYNAMIC_ELEMENTS to create the CIM Message string property or different static text
				may be used as long as the same meaning is conveyed. The value of this element does
				not change based on circumstances. </xs:documentation>
		</xs:annotation>
	</xs:element>
	<!-- Schema for declared message instance properties -->
	<xs:attributeGroup name="STANDARD_ELEMENT_ATTRIBUTES">
		<xs:attribute name="EXISTENCE_IS" default="required">
			<xs:simpleType>
				<xs:restriction base="xs:NMTOKEN">
					<xs:enumeration value="required"/>
					<xs:enumeration value="optional"/>
					<xs:enumeration value="discouraged"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:attributeGroup>
	<xs:group name="STANDARD_ELEMENTS">
		<xs:sequence>
			<xs:element ref="DESCRIPTION"/>
		</xs:sequence>
	</xs:group>
	<xs:element name="FIXED_MESSAGE_INSTANCE_VALUES">
		<xs:annotation>
			<xs:documentation> This entity lists the properties of the message CIM instance that
				must take on a particular value and have a particular, specified meaning. The
				messages can have other properties set, but this message declaration makes no
				assertions as to their nature. </xs:documentation>
		</xs:annotation>
		<xs:complexType mixed="false">
			<xs:sequence>
				<xs:choice id="ERROR_OR_ALERT_PROPERTIES">
					<xs:sequence>
						<xs:element ref="CIMSTATUSCODE"/>
						<xs:element ref="ERROR_TYPE"/>
						<xs:element ref="ERROR_SOURCE"/>
					</xs:sequence>
					<xs:sequence>
						<xs:element ref="ALERTING_MANAGED_ELEMENT"/>
						<xs:element ref="ALERT_TYPE"/>
					</xs:sequence>
				</xs:choice>
				<xs:element ref="PERCEIVED_SEVERITY"/>
			</xs:sequence>
			<xs:attribute name="TYPE" use="required">
				<xs:annotation>
					<xs:documentation> The type is used to define the class type of the instances
						whose values are being constrained. ERROR means that the
						FIXED_MESSAGE_INSTANCE_VALUES element is constraining CIM_Error properties.
						ALERT means that the FIXED_MESSAGE_INSTANCE_VALUES element is constraining
						CIM_AlertIndication properties. Because there is a
						FIXED_MESSAGE_INSTANCE_VALUES of one type does not mean that messages of
						another type can not be produced. Such a situation simply means that no
						assertions are made about message properties of the unspecified type.
					</xs:documentation>
				</xs:annotation>
				<xs:simpleType>
					<xs:restriction base="xs:NMTOKEN">
						<xs:enumeration value="ERROR"/>
						<xs:enumeration value="ALERT"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="CIMSTATUSCODE">
		<xs:complexType mixed="true">
			<xs:group ref="STANDARD_ELEMENTS"/>
			<xs:attributeGroup ref="STANDARD_ELEMENT_ATTRIBUTES"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="ERROR_TYPE">
		<xs:complexType mixed="true">
			<xs:group ref="STANDARD_ELEMENTS"/>
			<xs:attributeGroup ref="STANDARD_ELEMENT_ATTRIBUTES"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="ERROR_SOURCE">
		<xs:complexType mixed="true">
			<xs:group ref="STANDARD_ELEMENTS"/>
			<xs:attributeGroup ref="STANDARD_ELEMENT_ATTRIBUTES"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="ALERTING_MANAGED_ELEMENT">
		<xs:complexType mixed="true">
			<xs:group ref="STANDARD_ELEMENTS"/>
			<xs:attributeGroup ref="STANDARD_ELEMENT_ATTRIBUTES"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="ALERT_TYPE">
		<xs:complexType mixed="true">
			<xs:group ref="STANDARD_ELEMENTS"/>
			<xs:attributeGroup ref="STANDARD_ELEMENT_ATTRIBUTES"/>
		</xs:complexType>
	</xs:element>
	<xs:element name="PERCEIVED_SEVERITY">
		<xs:annotation>
			<xs:documentation>PERCEIVED_SEVERITY is one of the values of the PerceivedSeverity
				property of CIM_AlertIndication. When it appears in a Message Registry,
				PERCEIVED_SEVERITY is advisory. Implementations may use another value in instances
				of CIM_AlertIndication.</xs:documentation>
		</xs:annotation>
		<xs:complexType mixed="true">
			<xs:group ref="STANDARD_ELEMENTS"/>
			<xs:attributeGroup ref="STANDARD_ELEMENT_ATTRIBUTES"/>
		</xs:complexType>
	</xs:element>
</xs:schema>
