<?xml version = "1.0" encoding = "UTF-8"?>
<schema xmlns = "http://www.w3.org/2001/XMLSchema"
	 targetNamespace = "http://www.ipdr.org/namespaces/ipdr"
	 xmlns:ipdr = "http://www.ipdr.org/namespaces/ipdr"
	 version = "3.1">
	<element name = "IPDRDoc">
		<annotation>
			<documentation>
  The IPDRDoc element is the top-level container of a set of IPDRs. The document will also define the entity which recorded these IPDRs via the IPDRRec element.
                    </documentation>
		</annotation>
		<complexType>
			<sequence>
				<element ref = "ipdr:IPDR" maxOccurs = "unbounded"/>
				<element ref = "ipdr:IPDRDoc.End" minOccurs = "0"/>
			</sequence>
			<attribute name = "docId" use = "required" type = "string"/>
			<attribute name = "version" type = "string"/>
			<attribute name = "creationTime" type = "ipdr:dateTimeMsec"/>
			<attribute name = "IPDRRecorderInfo" type = "string"/>
		</complexType>
	</element>
	<element name = "IPDRDoc.End">
		<annotation>
			<documentation>
                    The IPDRDoc.End element optionally marks the end of the IPDR block. It may contain some check information like a count of IPDRs.
                       </documentation>
		</annotation>
		<complexType>
			<attribute name = "count" type = "integer"/>
			<attribute name = "endTime" type = "ipdr:dateTimeMsec"/>
		</complexType>
	</element>
	<element name = "IPDRCreationTime" type = "ipdr:dateTimeMsec"/>
	<element name = "seqNum" type = "integer"/>
	<complexType name = "IPDRType"
		 final = "restriction">
		<annotation>
			<documentation>
                       This is the base type for the IPDR element. The service-specific schema can extend this by deriving from it.
                    </documentation>
		</annotation>
		<sequence>
			<element ref = "IPDRCreationTime" minOccurs = "0"/>
			<element ref = "seqNum" minOccurs = "0"/>
		</sequence>
	</complexType>
	<element name = "IPDR" type = "ipdr:IPDRType">
		<annotation>
			<documentation> 
                         An IPDR describes an event between a service consumer and a service element. Details of the event are contained within this record.  All IPDR elements have a time    indicating when the event occurred.  
                      </documentation>
		</annotation>
	</element>
	<simpleType name = "dateTimeMsec">
		<annotation>
			<documentation>
 This type supports time resolution at the millisecond level It is further constrained to always use the timezone designator "Z" indicating GMT. Quantities of this type can optionally use 3 digits of fraction after the second to represent the milliseconds.  If absent, it is assumed the millisecond component is ".000".
Example:  1999-05-31T13:20:00.561Z
             </documentation>
		</annotation>
		<restriction base = "string">
			<pattern value = "[0-9]{4}\-[0-9]{2}\-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{3})?Z"/>
		</restriction>
	</simpleType>
	<simpleType name = "ipV4Addr">
		<annotation>
			<documentation>
    An IP version 4 address in dotted notation decimal. Example:  15.13.120.22
                    </documentation>
		</annotation>
		<restriction base = "string">
			<pattern value = "[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"/>
		</restriction>
	</simpleType>
	<simpleType name = "ipV6Addr">
		<annotation>
			<documentation>
                 An IP version 6 address in colon separated 2 byte block 
                 hexadecimal notation.
                 Example:  FEDC:AB19:12FE:0234:98EF:1178:8891:CAFF
             </documentation>
		</annotation>
		<restriction base = "string">
			<pattern value = "[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}"/>
		</restriction>
	</simpleType>
	<simpleType name = "UUID">
		<annotation>
			<documentation>
                 A universal unique id in hex dash notation.
                 Example:  f81d4fae-7dec-11d0-a765-00a0c91e6bf6
             </documentation>
		</annotation>
		<restriction base = "string">
			<pattern value = "[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}"/>
		</restriction>
	</simpleType>
</schema>

