<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="mim_cris_v32">
  <xsl:for-each select="*">
	<xsl:text>INSERT INTO </xsl:text>
	<xsl:value-of select="name()"/>
	<xsl:text>(</xsl:text>
	<xsl:for-each select="@*">
		<xsl:if test="position()>1"><xsl:text>,</xsl:text></xsl:if>
		<xsl:value-of select="name()"/>
	</xsl:for-each>
	<xsl:text>) VALUES(</xsl:text>
	<xsl:for-each select="@*">
		<xsl:if test="position()>1"><xsl:text>,</xsl:text></xsl:if>
		<xsl:choose>
 		 <xsl:when test="name(.)='gmt_last_updated'"> 
			<xsl:text>timestamp'</xsl:text>
			<xsl:value-of select="substring-before(.,'T')"/>
			<xsl:text> </xsl:text>
	    	<xsl:value-of select="substring-after(.,'T')"/>
 		 </xsl:when>
    	 <xsl:otherwise>
		    <xsl:text>'</xsl:text>
		    <xsl:value-of select="."/> 
	     </xsl:otherwise>
        </xsl:choose>
		<xsl:text>'</xsl:text>
	</xsl:for-each>
	<xsl:text>);
</xsl:text>
  </xsl:for-each>
	
</xsl:template>



</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2008. Progress Software Corporation. All rights reserved.

<metaInformation>
	<scenarios>
		<scenario default="yes" name="test3" userelativepaths="yes" externalpreview="no" url="Cris.xml" htmlbaseurl="" outputurl="sql_serv_insert_statements.sql" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength=""
		          urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal"
		          customvalidator="">
			<advancedProp name="sInitialMode" value=""/>
			<advancedProp name="bXsltOneIsOkay" value="true"/>
			<advancedProp name="bSchemaAware" value="true"/>
			<advancedProp name="bXml11" value="false"/>
			<advancedProp name="iValidation" value="0"/>
			<advancedProp name="bExtensions" value="true"/>
			<advancedProp name="iWhitespace" value="0"/>
			<advancedProp name="sInitialTemplate" value=""/>
			<advancedProp name="bTinyTree" value="true"/>
			<advancedProp name="bWarnings" value="true"/>
			<advancedProp name="bUseDTD" value="false"/>
			<advancedProp name="iErrorHandling" value="fatal"/>
		</scenario>
	</scenarios>
	<MapperMetaTag>
		<MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no">
			<SourceSchema srcSchemaPath="..\Working_MIMOSA_Data_Dictionaries_and_Data_Sets\MIMOSA Data Dictionaries\01-MIMOSA CRIS Reference Data Dictionary\[OSA-EAI-CRIS-REF-XML-V03-2]CRIS_Reference_Library_V3-2-1[31-Dec-2008].xml"
			              srcSchemaRoot="mim_cris_v32" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/>
		</MapperInfo>
		<MapperBlockPosition>
			<template match="/"></template>
			<template match="sg_as_event_type">
				<block path="" x="242" y="0"/>
				<block path="xsl:value-of" x="282" y="0"/>
				<block path="xsl:value-of[1]" x="202" y="0"/>
				<block path="xsl:value-of[2]" x="162" y="0"/>
				<block path="xsl:value-of[3]" x="122" y="0"/>
				<block path="xsl:value-of[4]" x="82" y="0"/>
				<block path="xsl:value-of[5]" x="42" y="0"/>
				<block path="xsl:value-of[6]" x="242" y="40"/>
				<block path="xsl:value-of[7]" x="282" y="40"/>
				<block path="xsl:value-of[8]" x="202" y="40"/>
			</template>
			<template match="mim_cris_v32">
				<block path="xsl:for-each" x="371" y="0"/>
				<block path="" x="161" y="80"/>
				<block path="xsl:for-each/xsl:value-of" x="281" y="0"/>
				<block path="xsl:for-each/xsl:for-each" x="61" y="0"/>
				<block path="xsl:for-each/xsl:for-each/xsl:if" x="131" y="0"/>
				<block path="xsl:for-each/xsl:for-each/xsl:value-of" x="321" y="40"/>
				<block path="xsl:for-each/xsl:for-each[1]" x="221" y="40"/>
				<block path="xsl:for-each/xsl:for-each[1]/xsl:if" x="11" y="0"/>
				<block path="xsl:for-each/xsl:for-each[1]/xsl:choose" x="91" y="40"/>
				<block path="xsl:for-each/xsl:for-each[1]/xsl:choose/=[0]" x="45" y="34"/>
				<block path="xsl:for-each/xsl:for-each[1]/xsl:choose/=[0]/name[0]" x="0" y="28"/>
				<block path="xsl:for-each/xsl:for-each[1]/xsl:choose/xsl:when/xsl:value-of" x="41" y="40"/>
				<block path="xsl:for-each/xsl:for-each[1]/xsl:choose/xsl:when/xsl:value-of[1]" x="361" y="80"/>
				<block path="xsl:for-each/xsl:for-each[1]/xsl:choose/xsl:otherwise/xsl:value-of" x="241" y="80"/>
			</template>
		</MapperBlockPosition>
		<TemplateContext></TemplateContext>
		<MapperFilter side="source"></MapperFilter>
	</MapperMetaTag>
</metaInformation>
-->