<?xml version="1.0" encoding="UTF-8"?>
<structure version="14" html-doctype="HTML4 Transitional" compatibility-view="IE9" relativeto="*SPS" encodinghtml="UTF-8" encodingrtf="ISO-8859-1" encodingpdf="UTF-8" useimportschema="1" embed-images="1" pastemode="xml" enable-authentic-scripts="1" authentic-scripts-in-debug-mode-external="0" generated-file-location="DEFAULT">
	<parameters/>
	<schemasources>
		<namespaces>
			<nspair prefix="f" uri="http://www.xmlspy.com/schemas/formatting"/>
		</namespaces>
		<schemasources>
			<xsdschemasource name="XML" main="1" schemafile="Book.xsd" workingxmlfile="Book.xml"/>
		</schemasources>
	</schemasources>
	<modules/>
	<flags>
		<scripts/>
		<globalparts/>
		<designfragments/>
		<pagelayouts/>
		<xpath-functions/>
	</flags>
	<scripts>
		<script language="javascript"/>
	</scripts>
	<script-project>
		<Project version="2" app="AuthenticView"/>
	</script-project>
	<importedxslt/>
	<globalstyles>
		<rules selector=".info">
			<media>
				<media value="all"/>
			</media>
			<rule background-color="#f6f6ff" border="1px solid navy" color="navy" font-weight="bold" margin-bottom="12px" margin-top="12px" padding="2px"/>
		</rules>
		<rules selector=".explanation">
			<media>
				<media value="all"/>
			</media>
			<rule color="blue" font-style="italic" margin-bottom="6px"/>
		</rules>
	</globalstyles>
	<mainparts>
		<children>
			<globaltemplate subtype="main" match="/">
				<document-properties/>
				<children>
					<documentsection>
						<properties columncount="1" columngap="48px" headerfooterheight="variable" pagemultiplepages="0" pagenumberingformat="1" pagenumberingstartat="auto" pagestart="next" paperheight="11.69in" papermarginbottom="0.79in" papermarginfooter="0.5in" papermarginheader="0.5in" papermarginleft="0.6in" papermarginright="0.6in" papermargintop="0.79in" paperwidth="8.27in"/>
					</documentsection>
					<paragraph paragraphtag="h2">
						<styles border-bottom="2px solid navy" color="navy"/>
						<children>
							<text fixtext="Example: Table-of-Contents"/>
						</children>
					</paragraph>
					<paragraph paragraphtag="p">
						<properties class="info"/>
						<children>
							<text fixtext="This example highlights the use of document levels in conjunction with table-of-contents and text references."/>
						</children>
					</paragraph>
					<template subtype="source" match="XML">
						<children>
							<toc name="toc">
								<children>
									<paragraph paragraphtag="h2">
										<children>
											<text fixtext="Table of Contents"/>
										</children>
									</paragraph>
									<reflevel>
										<children>
											<paragraph>
												<children>
													<ref name="toc" createhyperlink="1">
														<children>
															<field type="ref-entrytext">
																<styles font-size="14pt" font-weight="bold"/>
															</field>
															<field type="ref-leader">
																<styles font-size="14pt" font-weight="bold"/>
															</field>
															<field type="ref-pageref">
																<styles font-size="14pt" font-weight="bold"/>
															</field>
														</children>
													</ref>
												</children>
											</paragraph>
											<reflevel>
												<children>
													<paragraph>
														<styles margin-left="1cm"/>
														<children>
															<ref name="toc" createhyperlink="1">
																<children>
																	<field type="ref-entrytext"/>
																	<field type="ref-leader"/>
																	<field type="ref-pageref"/>
																</children>
															</ref>
														</children>
													</paragraph>
												</children>
											</reflevel>
										</children>
									</reflevel>
								</children>
							</toc>
							<newline/>
							<newline break="page"/>
							<level>
								<children>
									<paragraph paragraphtag="h2">
										<children>
											<marker name="toc">
												<children>
													<num-lvl format="1.1.1"/>
													<text fixtext=" Foreword"/>
												</children>
											</marker>
										</children>
									</paragraph>
									<paragraph paragraphtag="p">
										<properties class="explanation"/>
										<children>
											<text fixtext="Note that the foreword here is statically defined by the design, i.e., not dependent on the XML. From the document structure, the foreword is at the same level as a chapter, so we wrap everything with a Level indicator (yellow markups). "/>
										</children>
									</paragraph>
									<paragraph paragraphtag="p">
										<properties class="explanation"/>
										<children>
											<text fixtext="The heading of the foreword should also become part of the table-of-contents and be properly numbered, so its text is contained within a marker."/>
										</children>
									</paragraph>
								</children>
							</level>
							<newline/>
							<newline break="page"/>
							<paragraph paragraphtag="p">
								<properties class="explanation"/>
								<children>
									<text fixtext="Here the main matter of the document is generated from the provided XML file."/>
								</children>
							</paragraph>
							<template subtype="element" match="book">
								<children>
									<content/>
								</children>
								<variables/>
							</template>
							<newline break="page"/>
							<level>
								<children>
									<paragraph paragraphtag="h2">
										<children>
											<marker xpath="." name="toc">
												<children>
													<num-lvl format="1.1.1"/>
													<text fixtext=" Appendix"/>
												</children>
											</marker>
										</children>
									</paragraph>
									<paragraph paragraphtag="p">
										<properties class="explanation"/>
										<children>
											<text fixtext="As with the foreword, the appendix here again is a static text that is written verbatim into every generated output document. As with the foreword, we wrap the appendix into a static level objects, and mark the header text for inclusion into the table-of-contents."/>
										</children>
									</paragraph>
								</children>
							</level>
						</children>
						<variables/>
					</template>
				</children>
			</globaltemplate>
		</children>
	</mainparts>
	<globalparts>
		<children>
			<globaltemplate subtype="element" match="chapter" schema-tree-path="chapter">
				<children>
					<template subtype="element" levelflag="1" match="chapter">
						<children>
							<condition>
								<children>
									<conditionbranch xpath="preceding::chapter">
										<children>
											<newline break="page"/>
										</children>
									</conditionbranch>
								</children>
							</condition>
							<template subtype="element" match="heading">
								<children>
									<paragraph paragraphtag="h2">
										<children>
											<marker xpath="." name="toc">
												<children>
													<num-lvl format="1.1.1"/>
													<text fixtext=" "/>
													<content/>
												</children>
											</marker>
										</children>
									</paragraph>
								</children>
								<variables/>
							</template>
							<content restofcontents="1"/>
						</children>
						<variables/>
					</template>
				</children>
			</globaltemplate>
			<globaltemplate subtype="element" match="subchapter" schema-tree-path="subchapter">
				<children>
					<template subtype="element" levelflag="1" match="subchapter">
						<children>
							<template subtype="element" match="heading">
								<children>
									<paragraph paragraphtag="h3">
										<children>
											<marker xpath="." name="toc">
												<children>
													<num-lvl format="1.1.1"/>
													<text fixtext=" "/>
													<content/>
												</children>
											</marker>
										</children>
									</paragraph>
								</children>
								<variables/>
							</template>
							<content restofcontents="1"/>
						</children>
						<variables/>
					</template>
				</children>
			</globaltemplate>
			<globaltemplate subtype="element" match="p" schema-tree-path="p">
				<children>
					<template subtype="element" match="p">
						<children>
							<paragraph paragraphtag="p">
								<children>
									<content/>
								</children>
							</paragraph>
						</children>
						<variables/>
					</template>
				</children>
			</globaltemplate>
		</children>
	</globalparts>
	<designfragments/>
	<xmltables/>
	<authentic-custom-toolbar-buttons/>
</structure>
