<?xml version="1.0" encoding="UTF-8"?>
<!-- ==========================================================================

   This is the schema definition for an update file (extension .upd) of the 
   netUpdate project. In the update file a product is defined in terms of all
   resources (files and subfile entities) that build the product. The supplied
   information for one resource is given in terms of version, size, modified date
   etc. This file is always fetched directly via internet from the URL given in
   the netUpdate definition file (extension .def).


   This is normative for the netUpdate project (c) by TMR AG, Switzerland

   For further information and the documenation about the netUpdate definition
   file structure, see:  
            http://www.netupdate.ch/en/misc/netupdate/
            
            
   Permission to use, and distribute this schema and its accompanying
   documentation for any purpose and without fee is hereby granted in perpetuity,
   provided that the above copyright notice and this paragraph appear in all copies
   and this schema file is not altered.
   The copyright holders make no representation about the suitability of the schema
   for any purpose.
   
   It is provided "as is" without expressed or implied warranty.

   
   Copyright (c) 2001 TMR AG,
   All Rights Reserved. 
========================================================================== -->
<schema xmlns="http://www.w3.org/2001/XMLSchema" 
	targetNamespace="http://www.netupdate.ch/xsd/netupdate"
	xmlns:netupdate="http://www.netupdate.ch/xsd/netupdate" 
	elementFormDefault="qualified"
	attributeFormDefault="unqualified"
>		    

<!-- ======================================
main structure built of one product that are in turn defined as a collection of resources 
						
  valid	        [optional]
		a timestamp defining the start of validity of the update of that product. That is,
		when given then any update process prior to the given time is not performed!
==================================== -->
	<element name="update">
		<complexType>
			<sequence>
				<element name="parameter" type="netupdate:parameterType" minOccurs="0" maxOccurs="unbounded"/>
				<element name="definition" type="netupdate:definitionResourceType"/>
				<element name="uses" type="netupdate:usesType" minOccurs="0" maxOccurs="unbounded"/>
				<choice maxOccurs="unbounded">
					<element name="resource" type="netupdate:resourceType"/>
					<element name="collection" type="netupdate:collectionType"/>
				</choice>
			</sequence>
			<attribute name="valid" type="dateTime"/>
		</complexType>
	</element>			
		
<!-- ======================================
parameter information [optional]:

  symbol	[mandatory]	
		the name of the parameter as all uppercase token name
						
  value	        [mandatory]	
		the expansion of the symbol.
==================================== -->
	<complexType name="parameterType">
		<attribute name="symbol" use="required">
			<simpleType>
				<restriction base="NMTOKEN">
					<pattern value="[A-Z][A-Z0-9_-]{0,}"/>
				</restriction>
			</simpleType>
		</attribute>
		<attribute name="value" use="required">
			<simpleType>
				<restriction base="string">
					<pattern value="[^\\]+"/>
				</restriction>
			</simpleType>
		</attribute>
	</complexType>	

<!-- ======================================
resource information of the definition file for that product.
Note that only the file name not the absolute path name is allowed 
in the local_name attribute!

  remote_name   [mandatory]	
	        is the absolute URL of the resource 

  local_name    [mandatory]	
		is the name of the definition file. Note the parameter ${NETUPDATE_DATA} 
		must be prepended before the file name and the extension must be .def

  last_modified [mandatory]
		the last modified date of the file or subfile entity given as an C time
		(epoque time - seconds since 1.1.70)
						
  size	        [mandatory]
		the size in bytes of the file or subfile entity

  flag	        [fixed=mightUpdate]

==================================== -->
	<complexType name="definitionResourceType">
		<attribute name="remote_name" use="required">
			<simpleType>
				<restriction base="anyURI">
					<minLength value="1"/>
				</restriction>
			</simpleType>
		</attribute>
		<attribute name="local_name" use="required">
			<simpleType>
				<restriction base="string">
					<pattern value="^\$\{NETUPDATE_DATA\}[A-Za-z0-9_-]+\.def"/>
				</restriction>
			</simpleType>
		</attribute>
		<attribute name="last_modified" type="unsignedLong" use="required"/>
		<attribute name="size" type="positiveInteger" use="required"/>
		<attribute name="flag" fixed="mightUpdate"/>
	</complexType>

<!-- ======================================
uses (dependency) information [optional]:

  definition	[mandatory]	
		is the name of a definition file. Note the parameter ${NETUPDATE_DATA} 
		must be prepended before the file name and the extension must be .def
                the name of the definition filw of a netUpdate project that is used by this 
		project/product


						
 post_processor [optional]	
		resource of a post processor that will be launched after the used product
		has been updated. Note that the post-processor will be launched only if
		any of the resources of the used product was updated!
==================================== -->
	<complexType name="usesType">
		<sequence>
			<element name="post_processor" type="netupdate:resourceType" minOccurs="0" maxOccurs="1"/>
		</sequence>
		<attribute name="definition" use="required">
			<simpleType>
				<restriction base="string">
					<pattern value="^\$\{NETUPDATE_DATA\}[A-Za-z0-9_-]+\.def"/>
				</restriction>
			</simpleType>
		</attribute>		
		<attribute name="post_processor" type="string"/>
	</complexType>
	
<!-- ======================================
resource information [mandatory]:

  remote_name	[mandatory]	
		is the absolute URL of the resource 

  local_name	[mandatory]	
		is the full local path of the file. Note that the path declaration can include
		expandable parameters of the kind ${SYMBOL} that are expanded based on the
		methode given in the expansion element of that product.

  last_modified [mandatory]
		the last modified date of the file or subfile entity given as an C time
		(epoque time - seconds since 1.1.70)
						
  size	        [mandatory]
		the size in bytes of the file or subfile entity

  flag	        [optional, default=mightUpdate]
		one flag for the update process.
==================================== -->
	<complexType name="resourceType">
		<attribute name="remote_name" use="required">
			<simpleType>
				<restriction base="anyURI">
					<minLength value="1"/>
				</restriction>
			</simpleType>
		</attribute>
		<attribute name="local_name" use="required">
			<simpleType>
				<restriction base="string">
					<pattern value="[^\\]+"/>
				</restriction>
			</simpleType>
		</attribute>
		<attribute name="last_modified" type="unsignedLong" use="required"/>
		<attribute name="size" type="positiveInteger" use="required"/>
		<attribute name="flag" use="optional" default="mightUpdate">
			<simpleType>
				<restriction base="NMTOKEN">
					<enumeration value="mustUpdateWithPathGeneration"/>
					<enumeration value="mustUpdateIfPathExist"/>
					<enumeration value="mustInstallWithPathGeneration"/>
					<enumeration value="mustInstallIfPathExist"/>
					<enumeration value="mightInstallWithPathGeneration"/>
					<enumeration value="mightInstallIfPathExist"/>
					<enumeration value="mightUpdate"/>
				</restriction>
			</simpleType>
		</attribute>
	</complexType>

<!-- ======================================
collection information [optional]:

  increment_basedate      [optional]
			  start date of the first increment
==================================== -->
	<complexType name="collectionType">
		<choice>
			<sequence>
				<element name="increment" type="netupdate:resourceType" minOccurs="1" maxOccurs="unbounded"/>
				<element name="handler" type="netupdate:resourceType"/>
				<element name="fallback" type="netupdate:resourceType"/>
			</sequence>
			<sequence>
				<element name="fallback" type="netupdate:resourceType"/>
			</sequence>
		</choice>
		<attribute name="increment_basedate" type="dateTime"/>
	</complexType>

</schema>

<!-- ==========================================================================
$Workfile:: netUpdate_upd.xsd                                                 $
$Revision: 7 $
$Modtime: 24/03/03 2:24p $
$History:: netUpdate_upd.xsd                                                  $

============================================================================ -->

