<?xml version="1.0" encoding="UTF-8"?>
<schema 
  targetNamespace="http://docs.oasis-open.org/ns/xri/xrd-1.0"
  xmlns="http://www.w3.org/2001/XMLSchema"
  xmlns:xrd="http://docs.oasis-open.org/ns/xri/xrd-1.0"
  elementFormDefault="unqualified"
  attributeFormDefault="unqualified"
  blockDefault="substitution"
  version="1.0">

	<import namespace="http://www.w3.org/XML/1998/namespace"
	  schemaLocation="http://www.w3.org/2001/xml.xsd"/>

	<annotation>
		<documentation>
			Document identifier: xrd-schema-1.0
			Location: http://docs.oasis-open.org/xri/xrd/v1.0/
		</documentation>
	</annotation>

	<complexType name="anyURI">
		<simpleContent>
			<extension base="anyURI">
				<anyAttribute namespace="##other" processContents="lax"/>
			</extension>
		</simpleContent>
	</complexType>

	<complexType name="string">
		<simpleContent>
			<extension base="string">
				<anyAttribute namespace="##other" processContents="lax"/>
			</extension>
		</simpleContent>
	</complexType>

	<element name="XRDS" type="xrd:XRDSType"/>
	<complexType name="XRDSType">
		<sequence>
			<element ref="xrd:XRD" minOccurs="0" maxOccurs="unbounded"/>
		</sequence>
		<attribute name="ref" type="anyURI"/>
	</complexType>

	<element name="XRD" type="xrd:XRDType"/>
	<complexType name="XRDType">
		<sequence>
			<element ref="xrd:Expires" minOccurs="0"/>
			<element ref="xrd:Subject" minOccurs="0"/>
			<choice minOccurs="0" maxOccurs="unbounded">
				<element ref="xrd:Alias"/>
				<element ref="xrd:Type"/>
				<element ref="xrd:Link"/>
				<any namespace="##other" processContents="lax"/>
			</choice>
		</sequence>
		<attribute ref="xml:id" use="optional"/>
		<anyAttribute namespace="##other" processContents="lax"/>
	</complexType>

	<element name="Expires" type="xrd:ExpiresType"/>
	<complexType name="ExpiresType">
		<simpleContent>
			<extension base="dateTime">
				<anyAttribute namespace="##other" processContents="lax"/>
			</extension>
		</simpleContent>
	</complexType>

	<element name="Subject" type="xrd:anyURI"/>
	<element name="Alias" type="xrd:anyURI"/>

	<element name="Type" type="xrd:TypeType"/>
	<complexType name="TypeType">
		<simpleContent>
			<extension base="xrd:anyURI">
				<attribute name="required" type="boolean" use="optional"/>
			</extension>
		</simpleContent>
	</complexType>

	<element name="Link" type="xrd:LinkType"/>
	<complexType name="LinkType">
		<sequence>
			<element ref="xrd:Rel" minOccurs="0"/>
			<element ref="xrd:MediaType" minOccurs="0"/>
			<choice minOccurs="0">
				<element ref="xrd:URI"/>
				<element ref="xrd:URITemplate"/>
			</choice>
			<choice minOccurs="0" maxOccurs="unbounded">
				<element ref="xrd:Title"/>
				<any namespace="##other" processContents="lax"/>
			</choice>
		</sequence>
		<anyAttribute namespace="##other" processContents="lax"/>
	</complexType>

	<element name="Title" type="xrd:TitleType"/>
	<complexType name="TitleType">
		<simpleContent>
			<extension base="xrd:string">
				<attribute ref="xml:lang" use="optional"/>
			</extension>
		</simpleContent>
	</complexType>

	<element name="Rel" type="xrd:anyURI"/>
	<element name="MediaType" type="xrd:string"/>
	<element name="URI" type="xrd:anyURI"/>
	<element name="URITemplate" type="xrd:string"/>

</schema>

