<?xml version="1.0" encoding="UTF-8"?>
<AnIML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xsi:noNamespaceSchemaLocation="http://animl.sourceforge.net/schema/animl-core.xsd" version="1.0">

<!--from Velocity template file for construction of AnIML XML file from JCAMP-DX file -->
<!--Based on JCAMP-DX, using IR protocol 4.24 but updated for 5.01 with LONGDATE  -->
<!--AniML UV-Vis Technique Definition (http://animl.sf.net/schema/techniques/UV%20base%20instance%20document.atid) dated 2004/08/30 -->
<!--AniML IR Technique Definition (http://animl.sf.net/schema/techniques/IR%20base%20instance%20document.atid) dated 2004/09/01 -->
<!--AniML Sample Schema (http://animl.sf.net/schema/techniques/Sample%20Parameters%20base%20instance%20document.atid) dated 2004/09/01 -->
<!--AniML Core Schema (http://animl.sourceforge.net/schema/animl-core.xsd) dated 2004/04/20 -->
<!--JCAMP-DX v4.24 (http://www.jcamp-dx.org/protocols/dxir01.pdf) accessed 2nd March 2012 -->
<!--JCAMP/AnIML crosswalk XL spreadsheet (http://animl.sourceforge.net/IUPAC/All%20JCAMP-DX%20and%20netCDF%20Labels%20version%2028%20August%202003.xls) 02/19/06 -->

<!--Stuart J. Chalk February 19, 2006 -->
<!--Robert J. Lancashire July 18, 2008 -->
<!--Version 0.3 -->

<!--Notes -->
<!--Originally used as an include file in jcamp2animl.php -->
<!--Originally written using a template AnIML file JCAMP_UV_Template.xml -->

<!-- SampleSet is defined in animl-core.xsd -->
    <SampleSet>
        <Sample sampleID="$file" derived="false" parameterType="String">
            <ParameterCategorySet>
                <ParameterCategory name="Description">
                    <ParameterSet>
                        <Parameter name="Name" parameterType="String">
                            <String>$title</String>
                        </Parameter>
#if($molform !="")
			<Parameter name="Molecular Formula" parameterType="String">
			    <String>$molform</String>
			</Parameter>
#end
#if($CASrn !="")
			<Parameter name="CAS Registry Number" parameterType="String">
			     <String>$CASrn</String>
			</Parameter>
#end
#if($CASn !="")
			<Parameter name="CAS Name" parameterType="String">
			     <String>$CASn</String>
			</Parameter>
#end
#if($state !="")
<!-- can be: solid | amorphous solid | crystalline solid | liquid | liquid crystal | gas | supercritical fluid | colloid | plasma | crystal -->
                        <Parameter name="State" parameterType="String">
                            <String>$state</String>
                        </Parameter>
#end
#if($samplingproc !="")
                        <Parameter name="Preparation Procedure" parameterType="String">
                            <String>$samplingproc</String>
                        </Parameter>
#end
                        <Parameter name="Owner" parameterType="String">
                            <String>$owner</String>
                        </Parameter>
#if($temp !="")
                        <Parameter name="Temperature" parameterType="Float32">
                            <Float32>$temp</Float32>
                        </Parameter>
#end
#if($bp !="")
                        <ParameterCategory name="BP">
                            <Parameter name="Max" parameterType="Float32">
                                <Float32>$bp</Float32>
                            </Parameter>
                            <Parameter name="Pressure" parameterType="Float32">
                                <Float32>101325.01</Float32>
                                <Unit label="Pa">
                                    <SIUnit exponent="-1">m</SIUnit>
                                    <SIUnit exponent="1">kg</SIUnit>
                                    <SIUnit exponent="-2">s</SIUnit>
                                </Unit>
                            </Parameter>
                        </ParameterCategory>
#end
#if($mp !="")
                        <ParameterCategory name="MP">
                            <Parameter name="Max" parameterType="Float32">
                                <Float32>$mp</Float32>
                            </Parameter>
                            <Parameter name="Pressure" parameterType="Float32">
                                <Float32>101325.01</Float32>
                                <Unit label="Pa">
                                    <SIUnit exponent="-1">m</SIUnit>
                                    <SIUnit exponent="1">kg</SIUnit>
                                    <SIUnit exponent="-2">s</SIUnit>
                                </Unit>
                            </Parameter>
                        </ParameterCategory>
#end
                    </ParameterSet>
                </ParameterCategory>
            </ParameterCategorySet>
        </Sample>
    </SampleSet>

    <!-- ExperimentStepSet is defined in animl-core.xsd -->
    <ExperimentStepSet>
        <ExperimentStep name="$DataType">
            <Author usertype="software">
                <Name>$origin</Name>
                <Location>$owner</Location>
            </Author>
	        <Timestamp>$timestamp</Timestamp>
            <SamplesUsed>
               <SampleRef sampleID="$file" role="SampleMeasurement" purpose="consumed"/>
            </SamplesUsed>
            <Technique name="$specinits" uri="http://animl.sf.net/schema/techniques/$specinits%20base%20instance%20document.atid"/>
            <ParameterCategorySet>
                <ParameterCategory name="Instrument Description">
                    <ParameterSet>
                        <Parameter name="Manufacturer" parameterType="String">
                            <String>$vendor</String>
                        </Parameter>
                        <Parameter name="Model Name" parameterType="String">
                            <String>$model</String>
                        </Parameter>
                    </ParameterSet>
                </ParameterCategory>
            </ParameterCategorySet>
            <PageSet>
                <Page name="spectrum">
                    <VectorSet length="$npoints">
                        <Vector name="Intensity" dependency="dependent" vectorID="Itensity_ID" plotUse="attribute" vectorType="$ydata_type">
#if($yencode=="ivs")
	                            <IndividualValueSet>
#foreach ($coord in $xyCoords)
<$ydata_type>$coord.getYString()</$ydata_type>
#end
	                            </IndividualValueSet>
 	                              <Unit label="$yUnitLabel">
                                     <SIUnit exponent="1" factor="1">1</SIUnit>
                                   </Unit>
                        </Vector>
                        <Vector name="Wavelength" dependency="independent" vectorID="Wavelength_ID" plotUse="dimension" vectorType="$xdata_type">
#if($xencode=="avs")
	                            <AutoIncrementedValueSet>
	                                <StartValue>
	                                    <$xdata_type>$firstX</$xdata_type>
	                                </StartValue>
	                                <Increment>
	                                    <$xdata_type>$deltaX</$xdata_type>
	                                </Increment>
	                            </AutoIncrementedValueSet>
#end
	                            <Unit label="$xUnitLabel">
#if($xUnitFactor != "")
	                                <SIUnit factor="$xUnitFactor" exponent="$xUnitExponent" offset="0">m</SIUnit>
#end
                                    </Unit>
                        </Vector>
                    </VectorSet>
                    <ParameterCategorySet>
                        <ParameterCategory name="Measurement Description">
                            <ParameterSet>
                                <Parameter name="Identifier" parameterType="String">
                                    <String>$title</String>
                                </Parameter>
                                <Parameter name="Sample Path Length" parameterType="Float32">
                                    <Float32>$pathlength</Float32>
                                    <Unit label="cm">
                                        <SIUnit exponent="1" factor="0.01">m</SIUnit>
                                    </Unit>
                                </Parameter>
                                <Parameter name="ScanMode" parameterType="String">
                                    <String>Spectrum</String>
                                </Parameter>
                            </ParameterSet>
                        </ParameterCategory>
                    </ParameterCategorySet>
                    <ParameterCategorySet>
                        <ParameterCategory name="Instrument Properties">
                            <ParameterSet>
                               <Parameter name="Resolution" parameterType="String">
                                 <String>$resolution</String>
                             </Parameter>
                         </ParameterSet>
                      </ParameterCategory>
                    </ParameterCategorySet>
                </Page>
            </PageSet>
        </ExperimentStep>
    </ExperimentStepSet>

    <!-- AuditTrial is defined in animl-core.xsd -->
    <AuditTrail>
        <LogEntry>
            <Timestamp>$currenttime</Timestamp>
            <User type="software">
                <Name>AnIML exporter 1.0 JSpecView http://jspecview.sf.net</Name>
            </User>
            <Action>created</Action>
            <Reason>Conversion from JCAMP-DX file to: $file</Reason>
            <Reference>There may be additional header items in the JCAMP-DX file that have not been converted to XML</Reference>
        </LogEntry>
    </AuditTrail>

    <!-- SignatureSet is defined in xmldsig-core-schema.xsd via animl-core.xsd -->
    <SignatureSet>
        <Signature>
            <SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
                <CanonicalizationMethod Algorithm=""/>
                <SignatureMethod Algorithm=""/>
                <Reference>
                    <DigestMethod Algorithm=""/>
                    <DigestValue/>
                </Reference>
            </SignedInfo>
            <SignatureValue xmlns="http://www.w3.org/2000/09/xmldsig#"/>
        </Signature>
    </SignatureSet>
</AnIML>
