﻿<?xml version="1.0" encoding="utf-8" ?>
<!-- Mapping definitions must use the namespace shown in the next line. -->
<MappingDefinition xmlns="http://www.qdabra.com/XLStoXML">
	<GeneralSettings>
		<!-- The path to the Excel file where the data should come from-->
		<!-- This must be an XLS file (not XLSX) -->
		<ExcelFileName>./Apps/apps.xls</ExcelFileName>
		<!-- The path where the XML files created should be stored -->
		<OutputDirectoryPath>./Apps/Output/</OutputDirectoryPath>
		<!-- The row of the Excel file where processing should start -->
		<!-- This only applies to the main spreadsheet specified in the top-level mapping-->
		<StartingRow>2</StartingRow>
		<!-- The XML file to use as a base for generated XML files -->
		<!-- Typically this can be obtained just by extracting the XSN as its source files-->
		<TemplateXMLFile>./Apps/ExtractedFiles/template.xml</TemplateXMLFile>
	</GeneralSettings>
	<!-- The DbxlSubmitOptions section is only relevant if LocalOutputOnly is set to false
	     in the main App.config file -->
	<!-- This section can be omitted if not submitting to DBXL -->
	<DbxlSubmitOptions>
		<!-- The document where generated forms will be submitted -->
		<DocumentType>CompanyContactInfo</DocumentType>
		<!-- The name of the column in the main spreadsheet whose values will be 
			  used as the Name metadata for each row-->
		<FormNameColumn>Company Name</FormNameColumn>
		<!-- Set this to true to use doctype indexes (configured in DAT) to identify forms
			 that have already been submitted to DBXL.
			 If this is false, this tool will use a slower method that doesn't require indexes
		     to be configured.  -->
		<UseIndexes>false</UseIndexes>
		
		<!-- The following value is required if UseIndexes is false.  It is an XPath to
			 identify documents that have already been submitted, and produce no match for
	         those that haven't. The columnname= values specified in the <KeyParamsInfo> 
		     section will be substituted for the {0} [,{1},{2},...] placeholder(s)
		<DocumentFilterXPath>/my:myFields[my:OriginalId = '{0}']</DocumentFilterXPath>
			  	  -->

		<!-- The following two settings are optional
		     (Same as the <FormNameColumn> setting, except for the Author metadata value)
		<FormAuthorColumn>Author</FormAuthorColumn>
		     (Same as the <FormNameColumn> setting, except for the Description metadata value)
		<FormDescriptionColumn>PhoneNumber</FormDescriptionColumn>
		-->
	</DbxlSubmitOptions>
	<!-- This section defines how filenames for the generated files are generated.
	     This section should be configured in a way that the filenames generated are unique for each form -->
	<FileNameInfo>
		<!-- This section may contain one or more <FieldName> fields.  Each should indicate the name of
			 a column in the main spreadsheet.
	         The values from these columns will be joined together with underscores (_) to produce the file
		     names for each form -->
		<FieldName>PackageID</FieldName>
		<FieldName>Vendor</FieldName>
	</FileNameInfo>
	<!-- This section defines how forms are located in DBXL, to check whether they have been submitted
	     already. -->
	<KeyParamsInfo>
		<!-- This section can contain one or more <KeyInfo> nodes. -->
		<!-- If <UseIndexes> is true, indexname= should indicate the name of one of the target doctype's
			 indexes, and columnname= should indicate the name of a column in the main spreadsheeet that
			 corresponds to the field stored in that index. -->
		<!-- If <UseIndexes> is false, columnname= should indicate a column in the main spreadsheet whose
			 value will be used in the <DocumentFilterXPath> format string.  indexname= can be blank in this
		     case. -->
		<KeyInfo indexname="" columnname="PackageID"/>
	</KeyParamsInfo>
	<!-- The main mapping sheetname= should indicate the main (top level) spreadsheet of the Excel file.
	     root= is the XPath of a node in the target XML, relative to which all other XPaths will be 
	     evaluated. -->
	<!-- One form will be generated for each row of data in this main spreadsheet. -->
	<Mapping root="/my:myFields" sheetname="apps_Applications">
		<Fields>
			<!-- The list of fields from the main spreadsheet that should be inserted into the generated
			     xml forms.  name= is the name of a column in the main spreadsheet, and 
				 xpath is the path to the corresponding XML field (relative to the root= attribute of this
				 <Mapping> node). -->
			<Field name="PackageID" xpath="/my:myFields/my:PackageDetails1/my:PackageID"/>
			<Field name="Vendor" xpath="/my:myFields/my:PackageDetails1/my:Vendor"/>
			<Field name="Product" xpath="/my:myFields/my:PackageDetails1/my:Product"/>
		</Fields>
	</Mapping>
</MappingDefinition>
