<?xml version="1.0" encoding="iso-8859-1"?>
<!--
  Constraints for an XPath file enumerating all of the possible
  elements and attributes described by a W3C Schema expression.

Copyright (C) OASIS Open (2005). All Rights Reserved.

This document and translations of it may be copied and furnished 
to others, and derivative works that comment on or otherwise 
explain it or assist in its implementation may be prepared, 
copied, published and distributed, in whole or in part, without 
restriction of any kind, provided that the above copyright notice 
and this paragraph are included on all such copies and derivative 
works. However, this document itself may not be modified in any 
way, such as by removing the copyright notice or references to 
OASIS, except as needed for the purpose of developing OASIS 
specifications, in which case the procedures for copyrights 
defined in the OASIS Intellectual Property Rights document must 
be followed, or as required to translate it into languages other 
than English.

The limited permissions granted above are perpetual and will not 
be revoked by OASIS or its successors or assigns.

This document and the information contained herein is provided 
on an "AS IS" basis and OASIS DISCLAIMS ALL WARRANTIES, EXPRESS 
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE 
USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY 
IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
PURPOSE.

-->
<!-- $Id: xpath.xsd,v 1.7 2005/05/31 02:24:57 G. Ken Holman Exp $ -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           targetNamespace="urn:oasis:names:tc:ubl:schema:XPath-1.0"
           xmlns="urn:oasis:names:tc:ubl:schema:XPath-1.0"
           elementFormDefault="unqualified">

<xs:element name="XPath">
  <xs:complexType>
    <!--container for all XPath information-->
    <xs:sequence>
      <xs:element ref="Element"/>
    </xs:sequence>
    <!--identification of instance as a resource-->
    <xs:attribute name="id" type="xs:string"/>
  </xs:complexType>
</xs:element>

<xs:element name="Element">
  <xs:complexType>
    <!--the content of the element (may be empty)-->
    <xs:sequence>
      <xs:element minOccurs="0" maxOccurs="unbounded" ref="Attribute"/>
      <xs:choice minOccurs="0">
        <xs:element maxOccurs="unbounded" ref="Element"/>
      </xs:choice>
    </xs:sequence>
    <!--name infomration-->
    <xs:attribute name="name" use="required" type="xs:Name"/>
    <xs:attribute name="prefix"/>
    <xs:attribute name="uri" type="xs:anyURI"/>
    <!--data type-->
    <xs:attribute name="type" use="required" type="xs:Name"/>
    <!--cardinality-->
    <xs:attribute name="minOccurs" use="required" type="xs:integer"/>
    <xs:attribute name="maxOccurs" use="required">
      <xs:simpleType>
        <xs:union memberTypes="xs:integer">
          <xs:simpleType>
            <xs:restriction base="xs:token">
              <xs:enumeration value="unbounded"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:union>
      </xs:simpleType>
    </xs:attribute>
    <!--mixed content-->
    <xs:attribute name="text" use="optional">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value=""/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <!--this only exists if the named element is already in the ancestry-->
    <xs:attribute name="loop" use="optional" type="xs:Name"/>
  </xs:complexType>
</xs:element>

<!--attributes attached to the element-->
<xs:element name="Attribute">
  <xs:complexType>
    <xs:attribute name="name" use="required" type="xs:Name"/>
    <xs:attribute name="use" use="required">
      <xs:simpleType>
        <xs:restriction base="xs:token">
          <xs:enumeration value="optional"/>
          <xs:enumeration value="required"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
    <xs:attribute name="type" use="required" type="xs:Name"/>
  </xs:complexType>
</xs:element>

</xs:schema>

