<?xml version='1.0'?>

<!--
This document provides an XML Schema for xdt:dayTimeDuration and
xdt:yearMonthDuration.

The other xdt: types are not described here because xdt:untyped and
xdt:anyAtomicType are special types that cannot be properly defined
using XML Schema itself and because xdt:untypedAtomic should not be
used for validation, but only used for unvalidated elements and
attributes.
-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
	   targetNamespace="http://www.w3.org/2005/xpath-datatypes"
	   xmlns:xdt="http://www.w3.org/2005/xpath-datatypes"
	   elementFormDefault="qualified"
	   blockDefault="#all"
	   xml:lang="en">

<xs:simpleType name='dayTimeDuration'>
  <xs:annotation>
    <xs:documentation
	source="http://www.w3.org/TR/xpath-datamodel/#xdt-dayTimeDuration"/>
  </xs:annotation>
  <xs:restriction base='xs:duration'>
    <xs:pattern value="[^YM]*[DT].*"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name='yearMonthDuration'>
  <xs:annotation>
    <xs:documentation
	source="http://www.w3.org/TR/xpath-datamodel/#xdt-yearMonthDuration"/>
  </xs:annotation>
  <xs:restriction base='xs:duration'>
    <xs:pattern value="[^DT]*"/>
  </xs:restriction>
</xs:simpleType>

</xs:schema>
