<?xml version="1.0" encoding="UTF-8"?>
<!--	This model is specific to the needs of the Bächli company and has been defined for pedagogic use only.
		It has been defined as a case study based on the Bächli Winter 2014/15 catalog.
		Made by LFT at comem+ / HEIG-VD in March 2015
 -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:include schemaLocation="baechli_product_typeDefinition.xsd"/>
	<xs:element name="product">
		<xs:annotation>
			<xs:documentation>This model is specific to the needs of the Bächli company and has been defined for pedagogic use only.
Used to describe any product sell by the Bächli company.</xs:documentation>
		</xs:annotation>
		<xs:complexType>
			<xs:sequence>
				<xs:element name="meta">
					<xs:annotation>
						<xs:documentation>General informations about where and when the product's description has been set.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="source">
								<xs:annotation>
									<xs:documentation>Informations about where the product's description is coming from.</xs:documentation>
								</xs:annotation>
								<xs:complexType>
									<xs:sequence>
										<xs:element name="lastName" type="stringNotEmpty">
											<xs:annotation>
												<xs:documentation>Used to define the family name of the author of the original product's description.</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="firstName" type="stringNotEmpty" maxOccurs="3">
											<xs:annotation>
												<xs:documentation>Used to define the first names of the author of the original product' description.</xs:documentation>
											</xs:annotation>
										</xs:element>
										<xs:element name="emailAddress" type="emailAddressType">
											<xs:annotation>
												<xs:documentation>Used to define the email address of the author of the original product's description.</xs:documentation>
											</xs:annotation>
										</xs:element>
									</xs:sequence>
									<xs:attribute name="groupeId" type="groupeIdType" use="required">
										<xs:annotation>
											<xs:documentation>Used to define from which group the product's description is coming.
Specific simpleType: see product_typeDefinition.xsd</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="editionDate" type="xs:date" use="required">
										<xs:annotation>
											<xs:documentation>Used to define when the original data have been set.</xs:documentation>
										</xs:annotation>
									</xs:attribute>
								</xs:complexType>
							</xs:element>
							<xs:element name="productionDate" type="xs:date">
								<xs:annotation>
									<xs:documentation>Used to know when this document has been produced (data coming from the XSLT processor).</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="productionTime" type="xs:time">
								<xs:annotation>
									<xs:documentation>Used to know when this document has been produced (data coming from the XSLT processor).</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
				<xs:element name="data">
					<xs:annotation>
						<xs:documentation>Specific informations about the product.</xs:documentation>
					</xs:annotation>
					<xs:complexType>
						<xs:sequence>
							<xs:element name="name" type="stringNotEmpty">
								<xs:annotation>
									<xs:documentation>Used to define the name of product.
This information is considered as a single data evenif its content could be more relevent</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="brand" type="stringNotEmpty">
								<xs:annotation>
									<xs:documentation>Used to define the brand (factory) of the product</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="category" type="stringNotEmpty">
								<xs:annotation>
									<xs:documentation>Used to define the category of the product. 
Every product belong to a single category </xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="description" type="stringNotEmpty">
								<xs:annotation>
									<xs:documentation>Used to define the description of the product </xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="imageId" type="filenameWithoutExtensionType">
								<xs:annotation>
									<xs:documentation>Used to identify the illustation related to the product.
Should be the XML file name without any extension, but could be something else.
Specific simpleType: see product_typeDefinition.xsd</xs:documentation>
								</xs:annotation>
							</xs:element>
							<xs:element name="variation" maxOccurs="unbounded">
								<xs:complexType>
									<xs:sequence>
										<xs:element name="weight" minOccurs="0">
											<xs:annotation>
												<xs:documentation>Can be used to define the weight of the product in gram (fixed value defined in the "unit" attribut)</xs:documentation>
											</xs:annotation>
											<xs:complexType>
												<xs:simpleContent>
													<xs:extension base="xs:positiveInteger">
														<xs:attribute name="unit" type="unitInGramType" use="required">
															<xs:annotation>
																<xs:documentation>Used to define the unit of the weight. Is set to the fixed value 'g' by the unitInGramType
Specific simpleType: see product_typeDefinition.xsd </xs:documentation>
															</xs:annotation>
														</xs:attribute>
														<xs:attribute name="weightComplement" type="stringNotEmpty">
															<xs:annotation>
																<xs:documentation>Can be used to add some specific information about the weight.
Exemple: weight given for a paar of shoses...</xs:documentation>
															</xs:annotation>
														</xs:attribute>
														<xs:attribute name="isAnEstimation" type="xs:boolean">
															<xs:annotation>
																<xs:documentation>Can be used to specify the the weight is not exact</xs:documentation>
															</xs:annotation>
														</xs:attribute>
														<xs:attribute name="referenceToASpecificSize">
															<xs:annotation>
																<xs:documentation>Can be used to specifiy that the given weight is for a specific size.
The size can have many pattern -> no resctriction </xs:documentation>
															</xs:annotation>
														</xs:attribute>
													</xs:extension>
												</xs:simpleContent>
											</xs:complexType>
										</xs:element>
										<xs:element name="size" minOccurs="0" maxOccurs="unbounded">
											<xs:annotation>
												<xs:documentation>Can be used to define any kind of size.
Some possible values:
- a letter (S, M, L, X)
- many letters (XS, XL, ...)
- letters and sign (S/M, ...)
- a number (42, 43, ...)
- a number with a unit (168 cm, ...)
- values between two numbers (22.5-27.0)
- letters and numbers (S 34-37)
- a string (one size, ...)
And any more!
-> no restriction</xs:documentation>
											</xs:annotation>
											<xs:complexType>
												<xs:simpleContent>
													<xs:extension base="xs:string">
														<xs:attribute name="system" type="stringNotEmpty">
															<xs:annotation>
																<xs:documentation>Can be used to define which system is used to express the size.
For shoes here are some possible values:
- US
- GB
- EU
And many more for other products!
-> no restriction
This element has NOT the same meaning than "unit" (see below)</xs:documentation>
															</xs:annotation>
														</xs:attribute>
														<xs:attribute name="unit" type="stringNotEmpty">
															<xs:annotation>
																<xs:documentation>Can be used to define the unit of the size.
Not every size has a unit (t-shirts).
Some possible values:
- cm (centimeter)
- m (meter)
- l (litre)
And many more!
-> no restriction
This element has NOT the same meaning than "system" (see above)</xs:documentation>
															</xs:annotation>
														</xs:attribute>
													</xs:extension>
												</xs:simpleContent>
											</xs:complexType>
										</xs:element>
										<xs:element name="colour" minOccurs="0" maxOccurs="unbounded">
											<xs:annotation>
												<xs:documentation>Can be used to define the product's color. A colour is always defined by an RGB value and a textual description.</xs:documentation>
											</xs:annotation>
											<xs:complexType>
												<xs:sequence>
													<xs:element name="rgbValue">
														<xs:annotation>
															<xs:documentation>Used to define the RGB value of the colour. If one single product has many colours, only the main one appear here</xs:documentation>
														</xs:annotation>
													</xs:element>
													<xs:element name="textValue">
														<xs:annotation>
															<xs:documentation>Used to define the textual description of the color. If one single product has many colours, they appear here (in a single element)</xs:documentation>
														</xs:annotation>
														<xs:complexType>
															<xs:simpleContent>
																<xs:extension base="xs:string">
																	<xs:attribute name="lang" type="mainLanguagesType">
																		<xs:annotation>
																			<xs:documentation>Can be used if the textual description of the colour is in a specific language.
Specific simpleType: see product_typeDefinition.xsd</xs:documentation>
																		</xs:annotation>
																	</xs:attribute>
																</xs:extension>
															</xs:simpleContent>
														</xs:complexType>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
										<xs:element name="price" minOccurs="0">
											<xs:annotation>
												<xs:documentation>Used to define the product's price.
Specific simpleType: see product_typeDefinition.xsd</xs:documentation>
											</xs:annotation>
											<xs:complexType>
												<xs:simpleContent>
													<xs:extension base="priceType">
														<xs:attribute name="currency" type="currencyType" use="required">
															<xs:annotation>
																<xs:documentation>Used to define the price's currency
Specific simpleType: see product_typeDefinition.xsd</xs:documentation>
															</xs:annotation>
														</xs:attribute>
													</xs:extension>
												</xs:simpleContent>
											</xs:complexType>
										</xs:element>
										<xs:element name="other" minOccurs="0" maxOccurs="unbounded">
											<xs:annotation>
												<xs:documentation>Can be used to stock data which can't be set in the predefined structure</xs:documentation>
											</xs:annotation>
											<xs:complexType>
												<xs:sequence>
													<xs:element name="value">
														<xs:annotation>
															<xs:documentation>Used to sock the data's value</xs:documentation>
														</xs:annotation>
														<xs:complexType>
															<xs:simpleContent>
																<xs:extension base="stringNotEmpty">
																	<xs:attribute name="unit" type="stringNotEmpty">
																		<xs:annotation>
																			<xs:documentation>Can be used to set a unit to the value</xs:documentation>
																		</xs:annotation>
																	</xs:attribute>
																</xs:extension>
															</xs:simpleContent>
														</xs:complexType>
													</xs:element>
													<xs:element name="name" type="stringNotEmpty">
														<xs:annotation>
															<xs:documentation>Used to stock the data's name (label) stocked in the "value" element</xs:documentation>
														</xs:annotation>
													</xs:element>
													<xs:element name="type" type="stringNotEmpty" minOccurs="0">
														<xs:annotation>
															<xs:documentation>Can be used to declare the  data's type stocked in the "value" element</xs:documentation>
														</xs:annotation>
													</xs:element>
													<xs:element name="description" type="stringNotEmpty">
														<xs:annotation>
															<xs:documentation>Used to discribe which kind of data is stocked in the "value" element</xs:documentation>
														</xs:annotation>
													</xs:element>
													<xs:element name="comment" type="stringNotEmpty" minOccurs="0">
														<xs:annotation>
															<xs:documentation>Can be used to explain why the data can't be set in the predefined structure</xs:documentation>
														</xs:annotation>
													</xs:element>
												</xs:sequence>
											</xs:complexType>
										</xs:element>
									</xs:sequence>
									<xs:attribute name="articleNumber" type="articleNumberType" use="required">
										<xs:annotation>
											<xs:documentation>Used to define the article's number
Specific simpleType: see product_typeDefinition.xsd</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="isForWomen" type="xs:boolean">
										<xs:annotation>
											<xs:documentation>Can be used to specify that the product if for women</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="isForKids" type="xs:boolean">
										<xs:annotation>
											<xs:documentation>Can be used to specify that the product is for kids</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="hasAGoreTexMembrane" type="xs:boolean">
										<xs:annotation>
											<xs:documentation>Can be used to specify that the product has a Gore-Tex membrane</xs:documentation>
										</xs:annotation>
									</xs:attribute>
									<xs:attribute name="isAvailableInSelectedStoresOnly" type="xs:boolean">
										<xs:annotation>
											<xs:documentation>Can be used to specify that the product is not available in every store</xs:documentation>
										</xs:annotation>
									</xs:attribute>
								</xs:complexType>
							</xs:element>
							<xs:element name="comment" type="stringNotEmpty" minOccurs="0">
								<xs:annotation>
									<xs:documentation>Can be used to set some extra raw information about the product</xs:documentation>
								</xs:annotation>
							</xs:element>
						</xs:sequence>
						<xs:attribute name="lang" type="mainLanguagesType" use="required">
							<xs:annotation>
								<xs:documentation>Used to define in which language is the document.
Specific simpleType: see product_typeDefinition.xsd</xs:documentation>
							</xs:annotation>
						</xs:attribute>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
