<?xml version="1.0"	encoding="UTF-8"?>

<!-- 
     CrossRef query output XSD.
     Developed for CrossRef (www.crossref.org) by:
        
     Atypon Systems
     Santa Clara, CA
     http://www.atypon.com
     info@atypon.com
-->	 

 
<!-- 
     =============================================================        
     This file contains the XML schema definition (XSD) for the XML output generated by
     CrossRef's query engine.
     
     Each field in the output XML result is associated with an attribute which specifies how
     the field was matched:
      - optional : means the field was not used in query resolution.
      - fuzzy    : means the field was fuzzy matched.
      - exact    : means the field was exactly matched (null value matches fall under exact)
    
     Please look at crossref_query_input.xsd for the XML schema definition of query XML input.     
	 ============================================================= 
-->
	 
<xsd:schema	xmlns:xsd =	"http://www.w3.org/2001/XMLSchema"
			targetNamespace	= "http://www.crossref.org/qrschema/1.0"
			xmlns =	"http://www.crossref.org/qrschema/1.0">
			
   <!--	================== Common attribute	and	elements ============ -->
   <xsd:simpleType name="qfield_t">
	  <xsd:restriction base="xsd:string">
		 <xsd:maxLength	value="256"/>
		 <xsd:minLength	value="0"/>
	  </xsd:restriction>   
   </xsd:simpleType>
   
   <xsd:simpleType name	= "xrefYear">
	<xsd:restriction base =	"xsd:positiveInteger">
		<xsd:maxInclusive value	= "2200"/>
		<xsd:minInclusive value	= "1400"/>
		<xsd:totalDigits value = "4"/>
	</xsd:restriction>
   </xsd:simpleType>

	<xsd:simpleType	name = "pubType">
			<xsd:restriction base =	"xsd:NMTOKEN">
				  <xsd:enumeration value = "abstract_only"/>
				  <xsd:enumeration value = "full_text"/>
				  <xsd:enumeration value = "bibliographic_record"/>
			</xsd:restriction>
	</xsd:simpleType>

   <!--	============= End of common	attribute and elements ============	-->
			
   <!--	
   ================================================================
   XSD schema for CrossRef XML based queries.
   Developed for CrossRef by Atypon	Systems	(http://www.atypon.com)
   ================================================================
   -->	 
	  
   <!--	
   Values that might appear	in the match attribute of a	query field:
   optional: The field is allowed to be	dropped	from the query to try and match	it.
   fuzzy:	 The field will	be fuzzy matched.	
   -->		   
							 
   <xsd:element	name="query_batch">
	  <xsd:complexType>
		 <xsd:sequence>
			<xsd:element ref="head"/>
			<xsd:element ref="body"/>
		 </xsd:sequence>
		 <xsd:attribute	name="version" fixed="1.0" type	= "xsd:string"/>		 
	  </xsd:complexType>
   </xsd:element>
	  
   <xsd:element	name="head">
	  <xsd:complexType>
		 <xsd:sequence>
			<xsd:element ref="email_address" minOccurs="0" maxOccurs="1" />
			<xsd:element ref="doi_batch_id"	/>			  
		 </xsd:sequence>
	  </xsd:complexType>
   </xsd:element>
	  
   <xsd:element	name="body">
	  <xsd:complexType>
		 <xsd:sequence>
			<xsd:element ref="query" minOccurs="1" maxOccurs="unbounded" />
		 </xsd:sequence>
	  </xsd:complexType>
   </xsd:element>
	  
   <!--	
	  The presense of any of the following elements	makes this a book/conf.	query:
	  1. isbn
	  2. series_title
	  3. volume_title
	  4. edition_number
	  5. component_number
   -->
   <xsd:element	name="query">
	  <xsd:complexType>
		 <xsd:all>
			<xsd:element ref="issn"			    minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="journal_title"	minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="author"			minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="volume"			minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="issue"			minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="first_page"		minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="year"				minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="publication_type"	minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="doi"				minOccurs="0" maxOccurs="1"/>

			<!-- book/conf.	specific elements -->			 
			<xsd:element ref="isbn"				minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="series_title"		minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="volume_title"		minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="edition_number"	minOccurs="0" maxOccurs="1"/>
			<xsd:element ref="component_number"	minOccurs="0" maxOccurs="1"/>
			
			<!-- msg holds verious information about the query (such as error msg if it malformed) -->
			<xsd:element ref="msg"				minOccurs="0" maxOccurs="1"/>
		 </xsd:all>
		 
		 <!-- 
			The	combination	of (SubmitterID,doi_batch_id,key) must be unique
			if the attribute 'forward-match' is set to true
		 -->
		 <xsd:attribute	name="key" use="optional">
			<xsd:simpleType>
		   <xsd:restriction	base="xsd:string">
			<xsd:maxLength value="128"/>
			<xsd:minLength value="1"/>
		   </xsd:restriction>
		  </xsd:simpleType>
		 </xsd:attribute>
				  
		 <xsd:attribute	name="enable-multiple-hits"	default="false">
			<xsd:simpleType>
			   <xsd:restriction	base="xsd:boolean" />
			</xsd:simpleType>
		 </xsd:attribute>
			
		 <xsd:attribute	name="forward-match" default="false">
			<xsd:simpleType>
			   <xsd:restriction	base="xsd:boolean" />
			</xsd:simpleType>
		 </xsd:attribute>

         <xsd:attribute name="status">
            <xsd:simpleType>
                <xsd:restriction base = "xsd:NMTOKEN">
                    <xsd:enumeration value = "resolved"/>
                    <xsd:enumeration value = "unresolved"/>              		
                    <xsd:enumeration value = "multiresolved"/>
                    <xsd:enumeration value = "malformed"/>	                    
                </xsd:restriction>
            </xsd:simpleType>				  
        </xsd:attribute>			   		 		 
	  </xsd:complexType>
   </xsd:element>
	  
   <!--	 
     contains the original doi_batch_id supplied by the publisher.
   -->
   <xsd:element	name = "doi_batch_id">
	<xsd:simpleType>
		<xsd:restriction base =	"xsd:string">
			<xsd:maxLength value = "100"/>
			<xsd:minLength value = "4"/>
		</xsd:restriction>
	</xsd:simpleType>
   </xsd:element>
	
   <!--	The	email address results are sent to -->
   <xsd:element	name = "email_address">
	<xsd:simpleType>
		<xsd:restriction base =	"xsd:string">
			<xsd:pattern value="[\p{L}\p{N}!/+-_]+(\.[\p{L}\p{N}!/+-_]+)*@[\p{L}\p{N}!/+-_]+(\.[\p{L}_]+)+"/>
			<xsd:maxLength value = "200"/>
			<xsd:minLength value = "6"/>
		</xsd:restriction>
	</xsd:simpleType>
   </xsd:element>	
	
   <!--	 
      Match attributes: 
      ISSNs are never fuzzy matched. However, they might be dropped from the query.
   -->
   <xsd:simpleType name="issn_t">
	  <xsd:restriction base="xsd:string">
		 <xsd:pattern value="\d{4}-?\d{3}[\dX]"/>
		 <xsd:maxLength	value="9"/>
		 <xsd:minLength	value="8"/>
	  </xsd:restriction>   
   </xsd:simpleType>
   <xsd:element	name="issn">
	  <xsd:complexType>
         <xsd:simpleContent>
		    <xsd:extension base="issn_t">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "optional"/>
	                    <xsd:enumeration value = "exact"/>	                		
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>			   
   </xsd:element>
   
   <!--	
	Match Attributes:	
	ISBNs are never fuzzy matched. However, they might be dropped from the query
   -->
	<xsd:simpleType	name = "isbn_t">
		<xsd:restriction base =	"xsd:string">
			<xsd:pattern value="\d[\d -]+[\dX]"/>
			<xsd:maxLength value = "13"/>
			<xsd:minLength value = "10"/>
		</xsd:restriction>
	</xsd:simpleType>
   <xsd:element	name="isbn">
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="isbn_t">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "optional"/>
	                    <xsd:enumeration value = "exact"/>	                		
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>			   
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>	
   
   <!--	
   Match Attributes:
   Journal title might be fuzzy matched and might be dropped from the query.
   -->
   <xsd:element	name="journal_title">
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="qfield_t">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "optional"/>
	                    <xsd:enumeration value = "fuzzy"/>
	                    <xsd:enumeration value = "exact"/>
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>			   
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>
   

   <!--
   Match Attributes:
   Series titles might be fuzzy matched and might be dropped from the query.
   -->		
   <xsd:element	name="series_title">   
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="qfield_t">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "optional"/>
	                    <xsd:enumeration value = "fuzzy"/>
	                    <xsd:enumeration value = "exact"/>
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>			   
		    </xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>				

   <!--
   Match Attributes:
   Volume titles might be fuzzy matched and might be dropped from the query
   -->
   <xsd:element	name="volume_title">   
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="qfield_t">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "optional"/>
	                    <xsd:enumeration value = "fuzzy"/>
	                    <xsd:enumeration value = "exact"/>
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>			   
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>				
   
   <!--
   Match Attributes:
   Authors might be fuzzy matched and might be dropped from the query.
   -->									 
   <xsd:element	name="author">	 
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="qfield_t">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "optional"/>
	                    <xsd:enumeration value = "fuzzy"/>
	                    <xsd:enumeration value = "exact"/>
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>			   
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>			 

   <!--
   Match Attributes:
   Volumes might be fuzzy matched and might be dropped from the query
   -->											
   <xsd:element	name="volume">
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="qfield_t">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "optional"/>
	                    <xsd:enumeration value = "fuzzy"/>
	                    <xsd:enumeration value = "exact"/>
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>			   
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>			 

   <!--
   Match Attributes:
   issue might be fuzzy matched.
   -->
   <xsd:element	name="issue">
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="qfield_t">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "fuzzy"/>
	                    <xsd:enumeration value = "exact"/>
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>			   
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>	

   <!--
   Match Attributes:
   Pages are not fuzzy matched but they might be dropped from the query.
   -->		
   <xsd:element	name="first_page">	 
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="qfield_t">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "optional"/>	                    
	                    <xsd:enumeration value = "exact"/>
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>			   
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>			 
	
   <!--
   Match Attributes:
   year is not fuzzy matched but might be dropped from the query
   -->
   <xsd:element	name="year">   
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="xrefYear">
		       <xsd:attribute name="match">
	              <xsd:simpleType>
	                 <xsd:restriction base = "xsd:NMTOKEN">
	                    <xsd:enumeration value = "optional"/>
	                    <xsd:enumeration value = "exact"/>
	                  </xsd:restriction>
	              </xsd:simpleType>				  
			   </xsd:attribute>			   
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>	

   <!--
   Match Attributes
   Edition number can be dropped from the query.
   -->	 
   <xsd:element	name="edition_number">	 
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="qfield_t">
				  <xsd:attribute name="match" default="optional">
	                <xsd:simpleType>
	                    <xsd:restriction base =	"xsd:NMTOKEN">
	                	    <xsd:enumeration value = "optional"/>
	                		<xsd:enumeration value = "exact"/>	                		
	                    </xsd:restriction>
	              </xsd:simpleType>				  
			    </xsd:attribute>
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>	

   <!--
   Match Attributes
   component numbers can be	dropped from the query.
   -->		
   <xsd:element	name="component_number">
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="qfield_t">
				  <xsd:attribute name="match" default="optional">
	                <xsd:simpleType>
	                    <xsd:restriction base =	"xsd:NMTOKEN">
	                	    <xsd:enumeration value = "optional"/>
	                		<xsd:enumeration value = "exact"/>	                		
	                    </xsd:restriction>
	              </xsd:simpleType>				  
			    </xsd:attribute>
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>	
   

   <xsd:element	name="publication_type">
	  <xsd:complexType>
		 <xsd:simpleContent>
			<xsd:extension base="pubType">
			</xsd:extension>
		 </xsd:simpleContent>
	  </xsd:complexType>
   </xsd:element>	   

   <xsd:element	name = "doi">
	<xsd:simpleType>
		<xsd:restriction base =	"xsd:anyURI">
			<xsd:maxLength value = "2048"/>
			<xsd:minLength value = "6"/>
		</xsd:restriction>
	</xsd:simpleType>
   </xsd:element>
   
   <xsd:element	name = "msg">
	<xsd:simpleType>
		<xsd:restriction base =	"xsd:string">
			<xsd:maxLength value = "5012"/>
			<xsd:minLength value = "10"/>
		</xsd:restriction>
	</xsd:simpleType>
   </xsd:element>   
</xsd:schema>

