<?xml version="1.0" encoding="ISO-8859-1"?>
<!--

	/*
	 * @(#)doc-2-0.xsd
	 *
	 * @project    : org.fugerit.java.doc.base
	 * @creation   : 2023-01-07
	 * @version    : 2.0.0-rc.3 (2023-08-17)
	 *
	 * XSD for fugerit doc configuration
	 */

	WARNING!!! - DTD remains just for compatibility, but will not be mantained, use XSD       
	
	Sample doc : 	
	
<doc
	xmlns="http://javacoredoc.fugerit.org"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://javacoredoc.fugerit.org https://www.fugerit.org/data/java/doc/xsd/doc-2-0.xsd" > 	
</doc>	
		
	Change log details can be found at the url : https://github.com/fugerit-org/fj-doc/tree/main/fj-doc-base/DocXsdChangelog.md
	
-->
<xsd:schema xmlns='http://www.w3.org/2000/10/XMLSchema'
	targetNamespace='http://javacoredoc.fugerit.org'
	xmlns:doc='http://javacoredoc.fugerit.org' xmlns:xsd="http://www.w3.org/2001/XMLSchema">

	<xsd:element name='doc'>
		<xsd:annotation>
			<xsd:documentation>This is the root element of source doc</xsd:documentation>
			<xsd:documentation>(consisting in a 'metadata' and a 'body' section)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:choice>
					<xsd:element ref='doc:metadata' />
					<xsd:element ref='doc:meta' />
				</xsd:choice>
				<xsd:element ref='doc:body' />
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='metadata' type="doc:metaType">
	</xsd:element>

	<xsd:element name='meta' type="doc:metaType">
		<xsd:annotation>
			<xsd:documentation>Contains the meta informations of the document</xsd:documentation>
			<xsd:documentation>('meta' is kept for compatibility, better use 'metadata')</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name='body'>
		<xsd:annotation>
			<xsd:documentation>The body of the document</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'body' element)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:choice minOccurs='0' maxOccurs='unbounded'>
				<xsd:element ref='doc:para' />
				<xsd:element ref='doc:table' />
				<xsd:element ref='doc:list' />
				<xsd:element ref='doc:image' />
				<xsd:element ref='doc:phrase' />
				<xsd:element ref='doc:nbsp' />
				<xsd:element ref='doc:br' />
				<xsd:element ref='doc:barcode' />
				<xsd:element ref='doc:h' />
				<xsd:element ref='doc:page-break' />
			</xsd:choice>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='info'>
		<xsd:annotation>
			<xsd:documentation>This is a key/value element containing informations for document generations, the attribute 'name' is the key, while the text content is the value.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType mixed='true'>
			<xsd:attribute name='name' type='xsd:string' use='required'>
				<xsd:annotation>
					<xsd:documentation>Contains the value of this document information (see the link https://venusdocs.fugerit.org/docs/html/doc_meta_info.html for possible values)</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='header'>
		<xsd:annotation>
			<xsd:documentation>A header made of a complex elements (not includes tables)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:choice minOccurs='0' maxOccurs='unbounded'>
				<xsd:element ref='doc:para' />
				<xsd:element ref='doc:image' />
				<xsd:element ref='doc:phrase' />
				<xsd:element ref='doc:h' />
			</xsd:choice>
			<xsd:attribute name='align' type='doc:alignType' use='optional'>
				<xsd:annotation>
					<xsd:documentation>Header horizontal alignment</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='numbered' type='xsd:boolean' use='optional'>
				<xsd:annotation>
					<xsd:documentation>'true' is the header should add page number</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>					
			<xsd:attribute name='border-width' type='doc:borderWidthType' use='optional'/>
			<xsd:attribute name='expected-size' type="xsd:int" use='optional'>
				<xsd:annotation>
					<xsd:documentation>Expected header size</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='footer'>
		<xsd:annotation>
			<xsd:documentation>A footer made of  simple elements (not includes tables)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:choice minOccurs='0' maxOccurs='unbounded'>
				<xsd:element ref='doc:para' />
				<xsd:element ref='doc:image' />
				<xsd:element ref='doc:phrase' />
				<xsd:element ref='doc:h' />
			</xsd:choice>
			<xsd:attribute name='align' type='doc:alignType' use='optional'>
				<xsd:annotation>
					<xsd:documentation>Footer horizontal alignment</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='numbered' type='xsd:boolean' use='optional'>
				<xsd:annotation>
					<xsd:documentation>'true' is the footer should add page number</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>					
			<xsd:attribute name='border-width' type='doc:borderWidthType' use='optional'/>
			<xsd:attribute name='expected-size' type="xsd:int" use='optional'>
				<xsd:annotation>
					<xsd:documentation>Expected footer size</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='header-ext'>
		<xsd:annotation>
			<xsd:documentation>A header made of a complex elements (includes tables)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:choice minOccurs='0' maxOccurs='unbounded'>
				<xsd:element ref='doc:para' />
				<xsd:element ref='doc:table' />
				<xsd:element ref='doc:image' />
				<xsd:element ref='doc:phrase' />
				<xsd:element ref='doc:barcode' />
				<xsd:element ref='doc:h' />
			</xsd:choice>
			<xsd:attribute name='align' type='doc:alignType' use='optional'>
				<xsd:annotation>
					<xsd:documentation>Header horizontal alignment</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='numbered' type='xsd:boolean' use='optional'>
				<xsd:annotation>
					<xsd:documentation>'true' is the header should add page number</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>					
			<xsd:attribute name='border-width' type='doc:borderWidthType' use='optional'/>
			<xsd:attribute name='expected-size' type="xsd:int" use='optional'>
				<xsd:annotation>
					<xsd:documentation>Expected header size</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='footer-ext'>
		<xsd:annotation>
			<xsd:documentation>A footer made of complex elements (includes tables)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:choice minOccurs='0' maxOccurs='unbounded'>
				<xsd:element ref='doc:para' />
				<xsd:element ref='doc:table' />
				<xsd:element ref='doc:image' />
				<xsd:element ref='doc:phrase' />
				<xsd:element ref='doc:barcode' />
				<xsd:element ref='doc:h' />
			</xsd:choice>
			<xsd:attribute name='align' type='doc:alignType' use='optional'>
				<xsd:annotation>
					<xsd:documentation>Footer horizontal alignment</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='numbered' type='xsd:boolean' use='optional'>
				<xsd:annotation>
					<xsd:documentation>'true' is the footer should add page number</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>					
			<xsd:attribute name='border-width' type='doc:borderWidthType' use='optional'/>
			<xsd:attribute name='expected-size' type="xsd:int" use='optional'>
				<xsd:annotation>
					<xsd:documentation>Expected footer size</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='background'>
		<xsd:annotation>
			<xsd:documentation>A background image to use for the document</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence minOccurs='1' maxOccurs='1'>
				<xsd:element ref='doc:image' />
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='bookmark-tree' type="doc:bookmarkTreeType">
		<xsd:annotation>
			<xsd:documentation>The root of the bookmark tree for the document</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	
	<xsd:element name='bookmark' type="doc:bookmarkType">
		<xsd:annotation>
			<xsd:documentation>A bookmark for the document</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name='para' type="doc:paraType">
		<xsd:annotation>
			<xsd:documentation>A document paragraph</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'p' element)</xsd:documentation>
			<xsd:documentation>, Depending on type handler support it is possible to use some constants (usually in header or footer)</xsd:documentation>
			<xsd:documentation>, ${currentPage} to display the current page (starts at 1)</xsd:documentation>
			<xsd:documentation>, ${pageCount} to display the last page number</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name='table'>
		<xsd:annotation>
			<xsd:documentation>A document table</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'table' element)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref='doc:row' minOccurs='0' maxOccurs='unbounded' />
			</xsd:sequence>
			<xsd:attribute name='id' type='doc:idType' use='optional' />
			<xsd:attribute name='columns' type="doc:columnsType" use='optional' >
				<xsd:annotation>
					<xsd:documentation>Number of columns in a table</xsd:documentation>
				</xsd:annotation>			
			</xsd:attribute>
			<xsd:attribute name='width' type='doc:percentageType' use='optional'>
				<xsd:annotation>
					<xsd:documentation>The width in percentage of the table</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='back-color' type='doc:colorType' use='optional' />
			<xsd:attribute name='fore-color' type='doc:colorType' use='optional' />
			<xsd:attribute name='spacing' type="doc:spaceType" use='optional'>
				<xsd:annotation>
					<xsd:documentation>This should be a integer value representing the table cell spacing (for some format like fo/pdf and html, it represents the margin)</xsd:documentation>
					<xsd:documentation>(Is it possible to set a default for the document : https://venusdocs.fugerit.org/docs/html/doc_meta_info.html#default-table-spacing)</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='padding' type='doc:spaceType' use='optional'>
				<xsd:annotation>
					<xsd:documentation>This should be a integer value representing the table cell padding</xsd:documentation>
					<xsd:documentation>(Is it possible to set a default for the document : https://venusdocs.fugerit.org/docs/html/doc_meta_info.html#default-table-padding)</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='colwidths' type='xsd:string' use='optional'>
				<xsd:annotation>
					<xsd:documentation>The sizes of the columns of the table as percentages separated by semicolons</xsd:documentation>
					<xsd:documentation>(for instance '30;30;40' are three columns if size 30%, 30% and 40%)</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='space-before' type='doc:spaceType' use='optional' />
			<xsd:attribute name='space-after' type='doc:spaceType' use='optional' />
			<xsd:attribute name='render-mode' type='doc:tableRenderModeType' use='optional' />
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='row'>
		<xsd:annotation>
			<xsd:documentation>A table row</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'tr' element)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref='doc:cell' minOccurs='0' maxOccurs='unbounded' />
			</xsd:sequence>
			<xsd:attribute name='id' type='doc:idType' use='optional' />
			<xsd:attribute name='header' type="xsd:boolean" use='optional'>
				<xsd:annotation>
					<xsd:documentation>Set to 'true' if the row is a header for the table</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='cell'>
		<xsd:annotation>
			<xsd:documentation>A row cell</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'th' or 'td' element)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:choice minOccurs='1' maxOccurs='unbounded'>
				<xsd:element ref='doc:para' />
				<xsd:element ref='doc:table' />
				<xsd:element ref='doc:image' />
				<xsd:element ref='doc:phrase' />
				<xsd:element ref='doc:nbsp' />
				<xsd:element ref='doc:br' />
				<xsd:element ref='doc:barcode' />
				<xsd:element ref='doc:h' />
			</xsd:choice>
			<xsd:attribute name='id' type='doc:idType' use='optional' />
			<xsd:attribute name='colspan' type='doc:spanType' use='optional'>
				<xsd:annotation>
					<xsd:documentation>The column span size of the cell (default value is '1')</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='rowspan' type='doc:spanType' use='optional'>
				<xsd:annotation>
					<xsd:documentation>The row span size of the cell (default value is '1')</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='align' type='doc:alignType' use='optional' />
			<xsd:attribute name='valign' type='doc:valignType' use='optional' />
			<xsd:attribute name='header' type="xsd:boolean" use='optional'>
				<xsd:annotation>
					<xsd:documentation>Set to 'true' if the cell is a header for the table</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
			<xsd:attribute name='border-color' type='doc:colorType' use='optional' />
			<xsd:attribute name='border-color-top' type='doc:colorType' use='optional' />
			<xsd:attribute name='border-color-bottom' type='doc:colorType' use='optional' />
			<xsd:attribute name='border-color-left' type='doc:colorType' use='optional' />
			<xsd:attribute name='border-color-right' type='doc:colorType' use='optional' />
			<xsd:attribute name='border-width' type='doc:borderWidthType' use='optional' />
			<xsd:attribute name='border-width-top' type='doc:borderWidthType' use='optional' />
			<xsd:attribute name='border-width-bottom' type='doc:borderWidthType' use='optional' />
			<xsd:attribute name='border-width-left' type='doc:borderWidthType' use='optional' />
			<xsd:attribute name='border-width-right' type='doc:borderWidthType' use='optional' />	
			<xsd:attribute name='back-color' type='doc:colorType' use='optional' />
			<xsd:attribute name='fore-color' type='doc:colorType' use='optional' />
			<xsd:attribute name='type' type='doc:dataType' use='optional' />
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='list'>
		<xsd:annotation>
			<xsd:documentation>A list in the document</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'ul' pr 'ol' element)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element ref='doc:li' minOccurs='0' maxOccurs='unbounded' />
			</xsd:sequence>
			<xsd:attribute name='id' type='doc:idType' use='optional' />
			<xsd:attribute name='list-type' type='doc:listType' use='optional' />
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='li'>
		<xsd:annotation>
			<xsd:documentation>A item of a list</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'li' element)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:sequence minOccurs='1' maxOccurs='2'>
				<xsd:choice minOccurs='1' maxOccurs='1'>
					<xsd:element ref='doc:para' />
					<xsd:element ref='doc:h' />
					<xsd:element ref='doc:pl' />
				</xsd:choice>
				<xsd:element ref='doc:list' minOccurs="0" maxOccurs="1"/>
			</xsd:sequence>
			<xsd:attribute name='id' type='doc:idType' use='optional' />
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='pl' type="doc:plType">
		<xsd:annotation>
			<xsd:documentation>A phrase list contained in a list item</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name='image'>
		<xsd:annotation>
			<xsd:documentation>An image to include in the document</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'image' element)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name='url' type='doc:urlType' use='optional'/>
			<xsd:attribute name='type' type='doc:imageType' use='optional' />
			<xsd:attribute name='scaling' type='doc:scalingType' use='optional' />
			<xsd:attribute name='base64' type='doc:base64Type' use='optional' />
			<xsd:attribute name='alt' type='doc:altType' use='optional' />
			<xsd:attribute name='align' type='doc:alignType' use='optional' />
		</xsd:complexType>
	</xsd:element>

	<xsd:element name='phrase' type="doc:phraseType">
		<xsd:annotation>
			<xsd:documentation>A phrase of the document</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'span' element)</xsd:documentation>
		</xsd:annotation>
	</xsd:element>

	<xsd:element name='nbsp'>
		<xsd:annotation>
			<xsd:documentation>Simple spacing</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'nbsp' entity)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name='length' type='doc:lengthType' use='optional'>
				<xsd:annotation>
					<xsd:documentation>The length of the spacing</xsd:documentation>
				</xsd:annotation>
			</xsd:attribute>
		</xsd:complexType>
	</xsd:element>
	
	<xsd:element name='br'>
		<xsd:annotation>
			<xsd:documentation>A line break</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'br' element)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
		</xsd:complexType>
	</xsd:element>	

	<xsd:element name='barcode'>
		<xsd:annotation>
			<xsd:documentation>Create a barcode</xsd:documentation>
			<xsd:documentation>(this element is kept for compatibility, but it's better to generate barcode as images)</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:attribute name='size' type='doc:fontSize' use='optional' />
			<xsd:attribute name='type' type='xsd:string' use='optional' />
			<xsd:attribute name='text' type='doc:altType' use='optional' />
		</xsd:complexType>
	</xsd:element>
	
	<xsd:element name='h' type="doc:hType">
		<xsd:annotation>
			<xsd:documentation>A document heading</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'h1', 'h2' etc. element)</xsd:documentation>
		</xsd:annotation>
	</xsd:element>
	
	<xsd:element name='page-break'>
		<xsd:annotation>
			<xsd:documentation>A page break heading</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType />
	</xsd:element>
	
	<xsd:complexType name="paraType" mixed='true'>
		<xsd:choice minOccurs='0' maxOccurs="unbounded">
			<xsd:element ref="doc:phrase" />
			<xsd:element ref="doc:para" />
		</xsd:choice>	
		<xsd:attribute name='id' type='doc:idType' use='optional' />
		<xsd:attribute name='style' type='doc:styleType' use='optional' />
		<xsd:attribute name='align' type='doc:alignType' use='optional' />
		<xsd:attribute name='font-name' type='doc:fontNameType' use='optional' />
		<xsd:attribute name='leading' type='doc:leadingType' use='optional' />
		<xsd:attribute name='back-color' type='doc:colorType' use='optional' />
		<xsd:attribute name='fore-color' type='doc:colorType' use='optional' />
		<xsd:attribute name='type' type='doc:dataType' use='optional' />
		<xsd:attribute name='format' type="doc:formatType" use='optional'>
		</xsd:attribute>
		<xsd:attribute name='size' type='doc:fontSize' use='optional' />
		<xsd:attribute name='text-indent' type='doc:textIndentType' use='optional' />
		<xsd:attribute name='space-before' type='doc:spaceType' use='optional' />
		<xsd:attribute name='space-after' type="doc:spaceType" use='optional' />
		<xsd:attribute name='space-left' type='doc:spaceType' use='optional' />
		<xsd:attribute name='space-right' type='doc:spaceType' use='optional' />
		<xsd:attribute name='white-space-collapse' type='doc:whiteSpaceCollapsType' use='optional' />
	</xsd:complexType>
	
	<xsd:complexType name="hType" mixed='true'>
		<xsd:attribute name='id' type='doc:idType' use='optional' />
		<xsd:attribute name='style' type='doc:styleType' use='optional' />
		<xsd:attribute name='align' type='doc:alignType' use='optional' />
		<xsd:attribute name='font-name' type='doc:fontNameType' use='optional' />
		<xsd:attribute name='leading' type='doc:leadingType' use='optional' />
		<xsd:attribute name='back-color' type='doc:colorType' use='optional' />
		<xsd:attribute name='fore-color' type='doc:colorType' use='optional' />
		<xsd:attribute name='type' type='doc:dataType' use='optional' />
		<xsd:attribute name='format' type='doc:formatType' use='optional' />
		<xsd:attribute name='size' type='doc:fontSize' use='optional' />
		<xsd:attribute name='text-indent' type='doc:textIndentType' use='optional' />
		<xsd:attribute name='space-before' type='doc:spaceType' use='optional' />
		<xsd:attribute name='space-after' type="doc:spaceType" use='optional' />
		<xsd:attribute name='space-left' type='doc:spaceType' use='optional' />
		<xsd:attribute name='space-right' type='doc:spaceType' use='optional' />
		<xsd:attribute name='white-space-collapse' type='doc:whiteSpaceCollapsType' use='optional' />
		<xsd:attribute name='head-level' type="doc:headLevelType" use='optional' />
	</xsd:complexType>

	<xsd:complexType name="phraseType" mixed='true'>
		<xsd:attribute name='id' type='doc:idType' use='optional' />
		<xsd:attribute name='font-name' type='doc:fontNameType' use='optional' />
		<xsd:attribute name='style' type='doc:styleType' use='optional' />
		<xsd:attribute name='leading' type='doc:leadingType' use='optional' />
		<xsd:attribute name='size' type='doc:fontSize' use='optional' />
		<xsd:attribute name='link' type="xsd:string" use='optional' />
		<xsd:attribute name='white-space-collapse' type='doc:whiteSpaceCollapsType' use='optional' />
		<xsd:attribute name='anchor' type="xsd:string" use='optional' />				
	</xsd:complexType>

	<xsd:simpleType name="imageType">
		<xsd:annotation>
			<xsd:documentation>The type of the image</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="png"></xsd:enumeration>
			<xsd:enumeration value="jpg"></xsd:enumeration>
			<xsd:enumeration value="gif"></xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="tableRenderModeType">
		<xsd:annotation>
			<xsd:documentation>Table render mode (if 'inline' the handler will try to render the table as a flow of element)</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="normal"></xsd:enumeration>
			<xsd:enumeration value="inline"></xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="styleType">
		<xsd:annotation>
			<xsd:documentation>Font style of the element</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="normal"></xsd:enumeration>
			<xsd:enumeration value="bold"></xsd:enumeration>
			<xsd:enumeration value="underline"></xsd:enumeration>
			<xsd:enumeration value="italic"></xsd:enumeration>
			<xsd:enumeration value="bolditalic"></xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="alignType">
		<xsd:annotation>
			<xsd:documentation>Horizontal alignment of the element</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="center"></xsd:enumeration>
			<xsd:enumeration value="right"></xsd:enumeration>
			<xsd:enumeration value="left"></xsd:enumeration>
			<xsd:enumeration value="justify"></xsd:enumeration>
			<xsd:enumeration value="justifyall"></xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>	
	
	<xsd:simpleType name="valignType">
		<xsd:annotation>
			<xsd:documentation>Vertical alignment of the element</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="middle"></xsd:enumeration>
			<xsd:enumeration value="top"></xsd:enumeration>
			<xsd:enumeration value="bottom"></xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>		
	
	<xsd:simpleType name="colorType">
		<xsd:annotation>
			<xsd:documentation>A color representation in HTML RGB format</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:pattern value="#([A-Fa-f0-9]{6})"></xsd:pattern>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="dataType">
		<xsd:annotation>
			<xsd:documentation>Data type contained in the element</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="string"></xsd:enumeration>
			<xsd:enumeration value="number"></xsd:enumeration>
			<xsd:enumeration value="date"></xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="formatDateType">
		<xsd:restriction base="xsd:string">
			<xsd:enumeration value="yyyy-MM-dd"></xsd:enumeration>
			<xsd:enumeration value="yyyy-MM-dd hh:mm:ss"></xsd:enumeration>
			<xsd:enumeration value="yyyy-MM-dd'T'HH:mm:ss.SSSZ"></xsd:enumeration>
			<xsd:enumeration value="iso"></xsd:enumeration>
		</xsd:restriction>		
	</xsd:simpleType>
	
	<xsd:simpleType name="formatType">
		<xsd:annotation>
			<xsd:documentation>Data format</xsd:documentation>
		</xsd:annotation>
		<xsd:union memberTypes="doc:formatDateType">
  			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:minLength value="1"/>
					<xsd:maxLength value="128"/>
				</xsd:restriction>  			
  			</xsd:simpleType>  			
  		</xsd:union>
	</xsd:simpleType>	

	<xsd:complexType name="metaType">
		<xsd:annotation>
			<xsd:documentation>Contains the meta informations of the document</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'head' element)</xsd:documentation>
		</xsd:annotation>
		<xsd:sequence>
			<xsd:element ref='doc:info' minOccurs='0' maxOccurs='unbounded' />
			<xsd:element ref='doc:header' minOccurs='0' maxOccurs='1' />
			<xsd:element ref='doc:footer' minOccurs='0' maxOccurs='1' />
			<xsd:element ref='doc:header-ext' minOccurs='0' maxOccurs='1' />
			<xsd:element ref='doc:footer-ext' minOccurs='0' maxOccurs='1' />
			<xsd:element ref='doc:background' minOccurs='0' maxOccurs='1' />	
			<xsd:element ref='doc:bookmark-tree' minOccurs='0' maxOccurs='1' />
		</xsd:sequence>
	</xsd:complexType>	
		
	<xsd:simpleType name="headLevelType">
		<xsd:annotation>
			<xsd:documentation>The level of the headings, from 1 (most relevant) to 7 (less relevant)</xsd:documentation>
			<xsd:documentation>(roughly comparable to a HTML 'h1', 'h2' etc.)</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:int">
			<xsd:minInclusive value="1"></xsd:minInclusive>
			<xsd:maxInclusive value="7"></xsd:maxInclusive>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="idType">
		<xsd:annotation>
			<xsd:documentation>An element id (should be unique in the document)</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="64"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="base64Type">
		<xsd:annotation>
			<xsd:documentation>Base 64 representation of a resource</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:base64Binary">
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="altType">
		<xsd:annotation>
			<xsd:documentation>Alternate description of the element</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="0"/>
			<xsd:maxLength value="2048"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="urlType">
		<xsd:annotation>
			<xsd:documentation>
				Valid values are :
				cl://pathinjar (Path inside the class loader, safest way to load the image)
				http://imageurl (but generating machine should be able to access the url)
				file://imagepath (Path should be absolute, but you can use, for instance, free marker templating to make it more generic.)
				In case of base64 just provide the type (png,jpg etc.)
			</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="0"/>
			<xsd:maxLength value="2048"/>
		</xsd:restriction>
	</xsd:simpleType>	

	<xsd:simpleType name="fontNameType">
		<xsd:annotation>
			<xsd:documentation>The name of the font to use</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="64"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="fontSize">
		<xsd:annotation>
			<xsd:documentation>The size of the font to use</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:int">
			<xsd:minInclusive value="0"></xsd:minInclusive>
			<xsd:maxInclusive value="256"></xsd:maxInclusive>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="borderWidthType">
		<xsd:annotation>
			<xsd:documentation>The size of the border</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:int">
			<xsd:minInclusive value="0"/>
			<xsd:maxInclusive value="32"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="textIndentType">
		<xsd:annotation>
			<xsd:documentation>Text indentation (currently ignored)</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:decimal">
			<xsd:minInclusive value="0"/>
			<xsd:maxInclusive value="2048"/>
		</xsd:restriction>
	</xsd:simpleType>	
	
	<xsd:simpleType name="whiteSpaceCollapsType">
		<xsd:annotation>
			<xsd:documentation>Value is 'true' if the white spaces must be trimmed</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:boolean">
		</xsd:restriction>
	</xsd:simpleType>		
	
	<xsd:simpleType name="leadingType">
		<xsd:annotation>
			<xsd:documentation>The leading between lines</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:decimal">
			<xsd:minInclusive value="0"/>
			<xsd:maxInclusive value="2048"/>
		</xsd:restriction>
	</xsd:simpleType>	
	
	<xsd:simpleType name="spaceType">
		<xsd:annotation>
			<xsd:documentation>The spacing of the element (possibly in a given direction)</xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:decimal">
			<xsd:minInclusive value="0"/>
			<xsd:maxInclusive value="2048"/>
		</xsd:restriction>
	</xsd:simpleType>

	<xsd:simpleType name="spanType">
		<xsd:restriction base="xsd:int">
			<xsd:minInclusive value="1"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="lengthType">
		<xsd:restriction base="xsd:int">
			<xsd:minInclusive value="1"/>
		</xsd:restriction>
	</xsd:simpleType>	
	
	<xsd:simpleType name="columnsType">
		<xsd:restriction base="xsd:int">
			<xsd:minInclusive value="1"/>
			<xsd:maxInclusive value="2048"/>
		</xsd:restriction>
	</xsd:simpleType>	

	<xsd:simpleType name="percentageType">
		<xsd:restriction base="xsd:int">
			<xsd:minInclusive value="1"/>
			<xsd:maxInclusive value="100"/>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:simpleType name="scalingType">
			<xsd:annotation>
				<xsd:documentation>The scaling percentage (can be higher than 100)</xsd:documentation>
			</xsd:annotation>
		<xsd:restriction base="xsd:int">
			<xsd:minInclusive value="1"/>
		</xsd:restriction>
	</xsd:simpleType>	

	<xsd:complexType name="bookmarkTreeType">
		<xsd:sequence>
			<xsd:element ref='doc:bookmark' minOccurs='0' maxOccurs='unbounded' />
		</xsd:sequence>
	</xsd:complexType>	

	<xsd:complexType name="bookmarkType" mixed='true'>
		<xsd:attribute name='ref' type="doc:idType" use="required">
			<xsd:annotation>
				<xsd:documentation>The reference to the element id to link</xsd:documentation>
			</xsd:annotation>
		</xsd:attribute>
	</xsd:complexType>	
	
	<xsd:simpleType name="listType">
		<xsd:annotation>
			<xsd:documentation>The type fo the list</xsd:documentation>
			<xsd:documentation>( 'uld' - unordered with dots, 'ulm' - unordered with mius, 'oln' - ordered with numbers, 'uld' - ordered with letters ) </xsd:documentation>
		</xsd:annotation>
		<xsd:restriction base="xsd:string">
			<!-- default unordered list, same asd 'uld' -->
			<xsd:enumeration value="ul"></xsd:enumeration>
			<!-- unordered list, using dot -->
			<xsd:enumeration value="uld"></xsd:enumeration>
			<!-- unordered list, using minus -->
			<xsd:enumeration value="ulm"></xsd:enumeration>
			<!-- default ordered list, same asd 'oln' -->
			<xsd:enumeration value="ol"></xsd:enumeration>
			<!-- ordered list, using numbers -->
			<xsd:enumeration value="oln"></xsd:enumeration>
			<!-- ordered list, using letters -->
			<xsd:enumeration value="oll"></xsd:enumeration>
		</xsd:restriction>
	</xsd:simpleType>
	
	<xsd:complexType name="plType">
		<xsd:sequence minOccurs='1' maxOccurs="unbounded">
			<xsd:element ref="doc:phrase" />
		</xsd:sequence>
	</xsd:complexType>

</xsd:schema>
