<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" encoding="US-ASCII" indent="yes"/>
	<xsl:template match="/">
		<X12>
			<ISA>
				<ISA01>00</ISA01>
				<ISA02>XXXXXXXXXX</ISA02>
				<ISA03>00</ISA03>
				<ISA04>XXXXXXXXXX</ISA04>
				<ISA05>ZZ</ISA05>
				<ISA06>
					<xsl:value-of select="substring(concat(EDIFACT/UNB/UNB02/UNB0201,'               '),1,15)"/>
				</ISA06>
				<ISA07>ZZ</ISA07>
				<ISA08>
					<xsl:value-of select="substring(concat(EDIFACT/UNB/UNB03/UNB0301,'               '),1,15)"/>
				</ISA08>
				<ISA09>
					<xsl:value-of select="substring(EDIFACT/UNB/UNB04/UNB0401,3,6)"/>
				</ISA09>
				<ISA10>
					<xsl:value-of select="EDIFACT/UNB/UNB04/UNB0402"/>
				</ISA10>
				<ISA11>U</ISA11>
				<ISA12>00304</ISA12>
				<ISA13>
					<xsl:value-of select="EDIFACT/UNB/UNB05"/>
				</ISA13>
				<ISA14>0</ISA14>
				<ISA15>T</ISA15>
				<ISA16>:</ISA16>
			</ISA>
			<GS>
				<GS01>CT</GS01>
				<GS02>
					<xsl:value-of select="EDIFACT/ORDERS/GROUP_2[1]/NAD/NAD02/NAD0201"/>
				</GS02>
				<GS03>
					<xsl:value-of select="EDIFACT/ORDERS/GROUP_2[2]/NAD/NAD02/NAD0201"/>
				</GS03>
				<GS04>
					<xsl:value-of select="substring(EDIFACT/ORDERS/DTM/DTM01/DTM0102,3,6)"/>
				</GS04>
				<GS05>0001</GS05>
				<GS06>1</GS06>
				<GS07>X</GS07>
				<GS08>003040</GS08>
			</GS>
			<TS_831>
				<ST>
					<ST01>831</ST01>
					<ST02>
						<xsl:value-of select="EDIFACT/ORDERS/UNH/UNH01"/>
					</ST02>
				</ST>
				<BGN>
					<BGN01>00</BGN01>
					<BGN02>
						<xsl:value-of select="EDIFACT/ORDERS/BGM/BGM02/BGM0201"/>
					</BGN02>
					<BGN03>
						<xsl:value-of select="substring(EDIFACT/ORDERS/DTM/DTM01/DTM0102,3,6)"/>
					</BGN03>
					<BGN04>0001</BGN04>
				</BGN>
				<DTM>
					<DTM01>007</DTM01>
					<DTM02>
						<xsl:value-of select="substring(EDIFACT/ORDERS/DTM/DTM01/DTM0102,3,6)"/>
					</DTM02>
					<DTM03>0001</DTM03>
				</DTM>
				<xsl:for-each select="EDIFACT/ORDERS/GROUP_28">
					<N9>
						<N901>DD</N901>
						<N902>
							<xsl:value-of select="LIN/LIN03/LIN0301"/>
						</N902>
						<N903>
							<xsl:value-of select="FTX/FTX04/FTX0401"/>
						</N903>
					</N9>
				</xsl:for-each>
				<TRN>
					<TRN01>2</TRN01>
					<TRN02>
						<xsl:value-of select="EDIFACT/ORDERS/GROUP_28/LIN/LIN01"/>
					</TRN02>
				</TRN>
				<xsl:for-each select="EDIFACT/ORDERS/GROUP_28">
					<AMT>
						<AMT01>E</AMT01>
						<AMT02>39.95</AMT02>
					</AMT>
				</xsl:for-each>
				<xsl:for-each select="EDIFACT/ORDERS/GROUP_28">
					<QTY>
						<QTY01>01</QTY01>
						<QTY02>
							<xsl:value-of select="QTY/QTY01/QTY0102"/>
						</QTY02>
					</QTY>
				</xsl:for-each>
				<SE>
					<SE01>
						<xsl:value-of select="EDIFACT/ORDERS/CNT/CNT01/CNT0102"/>
					</SE01>
					<SE02>
						<xsl:value-of select="EDIFACT/ORDERS/UNH/UNH01"/>
					</SE02>
				</SE>
			</TS_831>
			<GE>
				<GE01>
					<xsl:value-of select="EDIFACT/ORDERS/UNT/UNT01"/>
				</GE01>
				<GE02>1</GE02>
			</GE>
			<IEA>
				<IEA01>
					<xsl:value-of select="EDIFACT/UNZ/UNZ01"/>
				</IEA01>
				<IEA02>
					<xsl:value-of select="EDIFACT/UNZ/UNZ02"/>
				</IEA02>
			</IEA>
		</X12>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2005. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="edifact&#x2D;sample.txt" userelativepaths="yes" externalpreview="no" url="adapter:EDI?file:///c:/test/edifact&#x2D;sample.txt" htmlbaseurl="" outputurl="adapter:EDI?file:///c:/test/after.edi" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="yes" validator="internal" customvalidator="" ><validatorSchema value="file://c:\test\3040&#x2D;831.xsd"/></scenario></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="adapter:EDI?file:///c:/test/edifact&#x2D;sample.txt" srcSchemaRoot="EDIFACT" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template match="/"><block path="X12/ISA/ISA06/xsl:value&#x2D;of" x="262" y="80"/><block path="X12/ISA/ISA06/xsl:value&#x2D;of/concat[0]" x="224" y="75"/><block path="X12/ISA/ISA08/xsl:value&#x2D;of" x="261" y="116"/><block path="X12/ISA/ISA08/xsl:value&#x2D;of/concat[0]" x="220" y="121"/><block path="X12/ISA/ISA09/xsl:value&#x2D;of" x="274" y="25"/><block path="X12/GS/GS04/xsl:value&#x2D;of" x="196" y="196"/><block path="X12/TS_831/BGN/BGN03/xsl:value&#x2D;of" x="120" y="191"/><block path="X12/TS_831/DTM/DTM02/xsl:value&#x2D;of" x="36" y="164"/><block path="X12/TS_831/xsl:for&#x2D;each" x="270" y="295"/><block path="X12/TS_831/xsl:for&#x2D;each[1]" x="355" y="219"/></template></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->