<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

	<xs:annotation>
    	<xs:documentation>
      		This schema describes a format for describing the collection
      		of projects and packages tagged by a given tag in the openSUSE build
      		service.
    	</xs:documentation>
 	</xs:annotation>

 
	<xs:attribute name="name" type="xs:string"/>
	<xs:attribute name="project" type="xs:string"/> 
	<xs:attribute name="package" type="xs:string"/> 
	<xs:attribute name="user" type="xs:string"/>
	
	<xs:element name="tag">
		<xs:complexType>
			<xs:attribute ref="name" use="required"/>
		</xs:complexType>
	</xs:element> 
	

	<xs:element name="project">
		<xs:complexType>
			<xs:sequence>
				<xs:element maxOccurs="unbounded" minOccurs="1" ref="tag"/>
			</xs:sequence>
			<xs:attribute ref="name" use="required"/>
		</xs:complexType>
	</xs:element>
	
	<xs:element name="package">
		<xs:complexType>
		<xs:sequence>
			<xs:element maxOccurs="unbounded" minOccurs="1" ref="tag"/>
		</xs:sequence>
			<xs:attribute ref="project" use="required"/>
			<xs:attribute ref="name" use="required"/>
		</xs:complexType>
	</xs:element>
	
	
	<xs:element name="collection">
		<xs:annotation>
      		<xs:documentation>
        		Top level element for the list of packages and projects tagged
        		by a given tag.
      		</xs:documentation>
      	</xs:annotation>	
		<xs:complexType>	
			<xs:sequence>
					<xs:element maxOccurs="unbounded" minOccurs="0" ref="project"/>
					<xs:element maxOccurs="unbounded" minOccurs="0" ref="package"/>
			</xs:sequence>
			<xs:attribute ref="user" use="required"/>
    	</xs:complexType>
  </xs:element>
</xs:schema>
