<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<xsl:template match="/">
		<ADAPTER_BO xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="file://e:\aol\from_shrikant\GenexSchema.xsd">
			<EBP_ShoppingCart_Superset>
				<xsl:for-each select="EBPShoppingCart/Body/Document/BusinessDocument/RequisitionHeader">
					<xsl:call-template name="RequisitionHeader-AxsOne_ShoppingCart"/>
				</xsl:for-each>
			</EBP_ShoppingCart_Superset>
		</ADAPTER_BO>
	</xsl:template>
	<xsl:template name="TextLine-RQNoteTable">
		<xsl:param name="item_number"> 0</xsl:param>
		<RQNoteTable>
			<RECTYPE>05</RECTYPE>
			<PROCMODE>A</PROCMODE>
			<RQNLINE>
				<xsl:value-of select="$item_number"/>
			</RQNLINE>
			<RQNSEQ>
				<xsl:choose>
					<xsl:when test="TDID='ITXT'">
						<xsl:value-of select="number(COUNTER)"/>
					</xsl:when>
					<xsl:when test="TDID='NOTE'">
						<xsl:choose>
							<xsl:when test="../../NoteType[1]/TextLine/TDID='ITXT'">
								<xsl:variable name="myvar" select="count(../../NoteType[1]/TextLine)"/>
								<xsl:value-of select="$myvar+number(COUNTER)"/>
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="number(COUNTER)"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:when>
				</xsl:choose>
			</RQNSEQ>
			<TXTTYPE>
				<xsl:value-of select="TDID"/>
			</TXTTYPE>
			<TXTGLBNO/>
			<TXTSTSW>N</TXTSTSW>
			<ITNUSERI/>
			<NPRTSW>N</NPRTSW>
			<FILLER/>
			<ebp_tdspras>
				<xsl:value-of select="TDSPRAS"/>
			</ebp_tdspras>
			<ebp_tdline>
				<xsl:value-of select="TDLINE"/>
			</ebp_tdline>
			<xsl:call-template name="TextLine-RQNotesTextTable">
				<xsl:with-param name="item_number_param" select="$item_number"/>
			</xsl:call-template>
		</RQNoteTable>
	</xsl:template>
	<xsl:template name="TextLine-RQNotesTextTable">
		<xsl:param name="item_number_param"> 0</xsl:param>
		<RQNotesTextTable>
			<RECTYPE>06</RECTYPE>
			<PROCMODE>A</PROCMODE>
			<RQTLINE>
				<xsl:value-of select="$item_number_param"/>
			</RQTLINE>
			<RQTSEQ>
				<xsl:choose>
					<xsl:when test="TDID='ITXT'">
						<xsl:value-of select="number(COUNTER)"/>
					</xsl:when>
					<xsl:when test="TDID='NOTE'">
						<xsl:choose>
							<xsl:when test="../../NoteType[1]/TextLine/TDID='ITXT'">
								<xsl:variable name="myvar" select="count(../../NoteType[1]/TextLine)"/>
								<xsl:value-of select="$myvar+COUNTER"/>
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="number(COUNTER)"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:when>
				</xsl:choose>
			</RQTSEQ>
			<TEXTLINE01>
				<xsl:choose>
					<xsl:when test="string-length(TDLINE)='0'">
						<xsl:value-of select="'.'"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="substring(TDLINE,1,68)"/>
					</xsl:otherwise>
				</xsl:choose>
			</TEXTLINE01>
			<TEXTLINE02>
				<xsl:value-of select="substring(TDLINE,69,128)"/>
			</TEXTLINE02>
			<TEXTLINE03/>
			<TEXTLINE04/>
			<TEXTLINE05/>
			<TEXTLINE06/>
			<TEXTLINE07/>
			<TEXTLINE08/>
			<TEXTLINE09/>
			<TEXTLINE10/>
			<RECCLAST/>
			<OWNERCDT/>
			<TPRTSW>N</TPRTSW>
			<ASSOCWPO>N</ASSOCWPO>
			<PRNTONPO>N</PRNTONPO>
			<FILLER/>
		</RQNotesTextTable>
	</xsl:template>
	<xsl:template name="RequisitionHeader-AxsOne_ShoppingCart">
		<AxsOne_ShoppingCart>
			<RECTYPE>01</RECTYPE>
			<PROCMODE>A</PROCMODE>
			<COMPANY>
				<xsl:value-of select="substring(../LineItem/BE_CO_CODE,1,3)"/>
			</COMPANY>
			<RQNUM>
				<xsl:value-of select="OBJECT_ID"/>
			</RQNUM>
			<REQUISNR>EBP</REQUISNR>
			<ALT1RQNO/>
			<RQHKEY2>
				<xsl:choose>
					<xsl:when test="substring(DESCRIPTION,1,2)='#C'">
						<xsl:value-of select="concat('S-',substring(DESCRIPTION,9,13),'-000')"/>
					</xsl:when>
					<xsl:when test="substring(DESCRIPTION,1,2)='#B'">
						<xsl:value-of select="concat('B-',substring(DESCRIPTION,10,13),'-000')"/>
					</xsl:when>
				</xsl:choose>
			</RQHKEY2>
			<RQHKEY3/>
			<RQSYSNUM/>
			<HVENDID/>
			<HVENDTYP/>
			<PRIORITY>
				<xsl:choose>
					<xsl:when test="substring(DESCRIPTION,1,2)='#C'">
						<xsl:value-of select="'Y'"/>
					</xsl:when>
					<xsl:when test="substring(DESCRIPTION,1,2)='#B'">
						<xsl:value-of select="'Y'"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="'N'"/>
					</xsl:otherwise>
				</xsl:choose>
			</PRIORITY>
			<RQHTYPE/>
			<STATUS/>
			<ORDERDTC>
				<xsl:value-of select="POSTING_DATE"/>
			</ORDERDTC>
			<LREVISE/>
			<AUTHCODE/>
			<EXPEDITE/>
			<GLPOSTDTC>
				<xsl:value-of select="../../../../Header/SendDate"/>
			</GLPOSTDTC>
			<PARTOK01>Y</PARTOK01>
			<STDMSG1/>
			<STDMSG2/>
			<STDMSG3/>
			<COMMENT/>
			<RQMISC1/>
			<RQMISC2/>
			<RQMISC3/>
			<RQMISC4/>
			<RQMISC5/>
			<RQMISC6/>
			<USERSTAT/>
			<HOLDSW>
				<xsl:choose>
					<xsl:when test="substring(DESCRIPTION,1,2)='#C'">
						<xsl:value-of select="'Y'"/>
					</xsl:when>
					<xsl:when test="substring(DESCRIPTION,1,2)='#B'">
						<xsl:value-of select="'Y'"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="'N'"/>
					</xsl:otherwise>
				</xsl:choose>
			</HOLDSW>
			<HOLDRSN/>
			<POSTCURR>
				<xsl:value-of select="../././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././LineItem[1]/CURRENCY"/>
			</POSTCURR>
			<EXTMODSW>N</EXTMODSW>
			<SCHEDREC>N</SCHEDREC>
			<HSHPOCD>
				<xsl:for-each select="../LineItem[1]/TradingPartners/Partner">
					<xsl:if test="PARTNER_FCT='00000027'">
						<xsl:value-of select="substring(DISTRICT,1,12)"/>
					</xsl:if>
				</xsl:for-each>
			</HSHPOCD>
			<HRQDLDTC>
				<xsl:value-of select="../././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././LineItem[1]/DELIV_DATE"/>
			</HRQDLDTC>
			<DLVYONBY>B</DLVYONBY>
			<HSHPVIA/>
			<SHIPTERM/>
			<DETALREC>N</DETALREC>
			<HRQCOMP>
				<xsl:value-of select="substring(../LineItem/AccountAssignment/AccountItem/ACC_STR,4,3)"/>
			</HRQCOMP>
			<HRQDEPT>
				<xsl:value-of select="substring(../LineItem/AccountAssignment/AccountItem/ACC_STR,7,3)"/>
			</HRQDEPT>
			<HPROJECT>
				<xsl:value-of select="substring(../LineItem/AccountAssignment/AccountItem/ACC_STR,19,5)"/>
			</HPROJECT>
			<HSDMIS1>
				<xsl:value-of select="substring(../LineItem/AccountAssignment/AccountItem/ACC_STR,24,3)"/>
			</HSDMIS1>
			<HSDMS2>
				<xsl:value-of select="substring(../LineItem/AccountAssignment/AccountItem/ACC_STR,16,3)"/>
			</HSDMS2>
			<HSDMS3>
				<xsl:for-each select="../LineItem[1]/TradingPartners/Partner">
					<xsl:if test="PARTNER_FCT='00000016'">
						<xsl:value-of select="substring(E_MAIL,1,15)"/>
					</xsl:if>
				</xsl:for-each>
			</HSDMS3>
			<RECCLASS/>
			<OWNERCD/>
			<REVRSN/>
			<SEPARPO>N</SEPARPO>
			<BILLTOCD>010</BILLTOCD>
			<RQHUSERI/>
			<PROCSDSW>N</PROCSDSW>
			<HPRTSW>N</HPRTSW>
			<TAXCODE/>
			<TAXAMT/>
			<AMTOVER/>
			<ONELNRQ/>
			<RQNUMTO/>
			<FILLER/>
			<reporting_requisition_key/>
			<ebp_status>
				<xsl:value-of select="../Status"/>
			</ebp_status>
			<ebp_process_type>
				<xsl:value-of select="PROCESS_TYPE"/>
			</ebp_process_type>
			<ebp_created_by>
				<xsl:value-of select="CREATED_BY"/>
			</ebp_created_by>
			<ebp_created_at>
				<xsl:value-of select="substring(CREATED_AT,1,8)"/>
			</ebp_created_at>
			<ebp_changed_by>
				<xsl:value-of select="CHANGED_BY"/>
			</ebp_changed_by>
			<ebp_changed_at>
				<xsl:value-of select="substring(CHANGED_AT,1,8)"/>
			</ebp_changed_at>
			<ebp_total_value>
				<xsl:value-of select="TOTAL_VALUE"/>
			</ebp_total_value>
			<ebp_total_tax>
				<xsl:value-of select="TOTAL_TAX"/>
			</ebp_total_tax>
			<xsl:for-each select="../LineItem">
			    <xsl:if test="DEL_IND!='X'">
				     <xsl:call-template name="LineItem-RQItemTable"/>
				</xsl:if>
			</xsl:for-each>
		</AxsOne_ShoppingCart>
	</xsl:template>
	<xsl:template name="AccountItem-RQDistTable">
		<xsl:param name="item_number"> 0</xsl:param>
		<RQDistTable>
			<RECTYPE>09</RECTYPE>
			<PROCMODE>A</PROCMODE>
			<RQDLINE>
				<xsl:value-of select="$item_number"/>
			</RQDLINE>
			<PODSCHD>00001</PODSCHD>
			<RQDDTL>00001</RQDDTL>
			<RQDSEQ>
				<xsl:value-of select="ACC_NO"/>
			</RQDSEQ>
			<xsl:for-each select="../../../../../../Header/SendDate">
				<POSTDT>
					<xsl:value-of select="."/>
				</POSTDT>
			</xsl:for-each>
			<PAI>
				<xsl:value-of select="concat(substring(ACC_STR,4,3),' ',substring(ACC_STR,7,3),' ',substring(ACC_STR,10,6),' ',substring(ACC_STR,16,3),' ',substring(ACC_STR,19,5),'-',substring(ACC_STR,24,3))"/>
			</PAI>
			<TRANSAMT>
				<xsl:variable name="transamt" select="(../../PRICE) div (../../PRICE_UNIT)*(../../QUANTITY)*(DISTR_PERC) div (number(100))"/>
				<xsl:value-of select="translate($transamt,'NaN','0')"/>
			</TRANSAMT>
			<UNITS>
				<xsl:value-of select="(DISTR_PERC)*(../../QUANTITY) div (((((((((100)))))))))"/>
			</UNITS>
			<DETREF1/>
			<DETREF2/>
			<DETREF3/>
			<RQDUSERI/>
			<DPRTSW>N</DPRTSW>
			<FILLER/>
			<ebp_client>
				<xsl:value-of select="CLIENT"/>
			</ebp_client>
			<ebp_distr_perc>
				<xsl:value-of select="DISTR_PERC"/>
			</ebp_distr_perc>
			<ebp_acc_cat>
				<xsl:value-of select="ACC_CAT"/>
			</ebp_acc_cat>
			<ebp_del_ind>
				<xsl:value-of select="DEL_IND"/>
			</ebp_del_ind>
			<ebp_acc_str>
				<xsl:value-of select="ACC_STR"/>
			</ebp_acc_str>
			<ebp_g_l_acct>
				<xsl:value-of select="G_L_ACCT"/>
			</ebp_g_l_acct>
		</RQDistTable>
	</xsl:template>
	<xsl:template name="LineItem-RQItemTable">
		<xsl:variable name="itemNumber" select="number(NUMBER_INT)"/>
		<RQItemTable>
			<RECTYPE>04</RECTYPE>
			<PROCMODE>A</PROCMODE>
			<RQILINE>
				<xsl:value-of select="$itemNumber"/>
			</RQILINE>
			<BUYER/>
			<ITEMIDS>EBPI-0000001</ITEMIDS>
			<ITEMIDP/>
			<RQIKEY3/>
			<ITEMDES1>
				<xsl:value-of select="substring(DESCRIPTION,1,30)"/>
			</ITEMDES1>
			<ITEMDES2>
				<xsl:value-of select="substring(DESCRIPTION,31,40)"/>
			</ITEMDES2>
			<VENDITEM/>
			<VENDORID/>
			<VENDETYP/>
			<ITYORDER>
				<xsl:value-of select="normalize-space(QUANTITY)"/>
			</ITYORDER>
			<IUM>
				<xsl:value-of select="UNIT"/>
			</IUM>
			<UNITPRIC>
				<xsl:variable name="myvar" select="(PRICE) div (PRICE_UNIT)"/>
				<xsl:value-of select="translate($myvar,'NaN','0')"/>
			</UNITPRIC>
			<IMTORDER>
				<xsl:variable name="imtorder" select="(PRICE) div (PRICE_UNIT)*(QUANTITY)"/>
				<xsl:value-of select="translate($imtorder,'NaN','0')"/>
			</IMTORDER>
			<TCURCODE>
				<xsl:value-of select="CURRENCY"/>
			</TCURCODE>
			<TAXABLE>N</TAXABLE>
			<PARTOKSW>Y</PARTOKSW>
			<SUBSTUTE>Y</SUBSTUTE>
			<STDMSG>
				<xsl:choose>
					<xsl:when test="count(ItemAttachments/Attachment)">
						<xsl:value-of select="'Y'"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="'N'"/>
					</xsl:otherwise>
				</xsl:choose>
			</STDMSG>
			<ITEMSPEC/>
			<WPDOC/>
			<WPLIB/>
			<IMAGE/>
			<REASON/>
			<APPROVDSW/>
			<QTYAPPRO>
				<xsl:value-of select="normalize-space(QUANTITY)"/>
			</QTYAPPRO>
			<AMTAPPRO>
				<xsl:variable name="amtappro" select="(PRICE) div (PRICE_UNIT)*(QUANTITY)"/>
				<xsl:value-of select="translate($amtappro,'NaN','0')"/>
			</AMTAPPRO>
			<CLOSEDSW>N</CLOSEDSW>
			<ACPTFLAG/>
			<SPVEFLAG/>
			<WHSEFLAG/>
			<ASSGVEND/>
			<ASSGPRIC/>
			<AITEMIDS/>
			<AITEMIDP/>
			<ASSGUM/>
			<ASSGCURR/>
			<TYPEFLAG/>
			<PONUMBER/>
			<POLINE/>
			<SEARCHSW/>
			<RQIUSERI/>
			<IPRTSW>N</IPRTSW>
			<SPBDFLAG>N</SPBDFLAG>
			<NOTMAST/>
			<RQITAXCD/>
			<RQITAXAM/>
			<IAMTOVER/>
			<AUXITIMID/>
			<LINEPAI/>
			<LINDUFL/>
			<FILLER/>
			<ebp_description>
				<xsl:value-of select="DESCRIPTION"/>
			</ebp_description>
			<ebp_category_id>
				<xsl:value-of select="CATEGORY_ID"/>
			</ebp_category_id>
			<ebp_quantity>
				<xsl:value-of select="QUANTITY"/>
			</ebp_quantity>
			<ebp_del_ind>
				<xsl:value-of select="DEL_IND"/>
			</ebp_del_ind>
			<ebp_price>
				<xsl:value-of select="PRICE"/>
			</ebp_price>
			<ebp_price_unit>
				<xsl:value-of select="PRICE_UNIT"/>
			</ebp_price_unit>
			<ebp_del_datcat>
				<xsl:value-of select="DEL_DATCAT"/>
			</ebp_del_datcat>
			<ebp_deliv_date>
				<xsl:value-of select="DELIV_DATE"/>
			</ebp_deliv_date>
			<ebp_product_type>
				<xsl:value-of select="PRODUCT_TYPE"/>
			</ebp_product_type>
			<ebp_be_co_code>
				<xsl:value-of select="BE_CO_CODE"/>
			</ebp_be_co_code>
			<ebp_be_doc_type>
				<xsl:value-of select="BE_DOC_TYPE"/>
			</ebp_be_doc_type>
			<ebp_be_unload_pt>
				<xsl:value-of select="BE_UNLOAD_PT"/>
			</ebp_be_unload_pt>
			<ebp_created_by>
				<xsl:value-of select="CREATED_BY"/>
			</ebp_created_by>
			<ebp_created_at>
				<xsl:value-of select="substring(CREATED_AT,1,8)"/>
			</ebp_created_at>
			<ebp_changed_by>
				<xsl:value-of select="CHANGED_BY"/>
			</ebp_changed_by>
			<ebp_changed_at>
				<xsl:value-of select="substring(CHANGED_AT,1,8)"/>
			</ebp_changed_at>
			<xsl:for-each select="ItemText/NoteType/TextLine">
				<xsl:call-template name="TextLine-RQNoteTable">
					<xsl:with-param name="item_number" select="$itemNumber"/>
				</xsl:call-template>
			</xsl:for-each>
			<ebp_value>
				<xsl:value-of select="VALUE"/>
			</ebp_value>
			<xsl:for-each select="TradingPartners/Partner">
				<xsl:call-template name="Partner-ebp_trading_partners">
					<xsl:with-param name="item_number" select="$itemNumber"/>
				</xsl:call-template>
			</xsl:for-each>
			<xsl:for-each select="AccountAssignment/AccountItem">
				<xsl:call-template name="AccountItem-RQDistTable">
					<xsl:with-param name="item_number" select="$itemNumber"/>
				</xsl:call-template>
			</xsl:for-each>
		</RQItemTable>
	</xsl:template>
	<xsl:template name="Partner-ebp_trading_partners">
		<xsl:param name="item_number"> 0</xsl:param>
		<ebp_trading_partners>
			<line_item_number>
				<xsl:value-of select="$item_number"/>
			</line_item_number>
			<partner_type>
				<xsl:value-of select="PARTNER_FCT"/>
			</partner_type>
			<partner_no>
				<xsl:value-of select="PARTNER_NO"/>
			</partner_no>
			<mainpartner>
				<xsl:value-of select="MAINPARTNER"/>
			</mainpartner>
			<addr_type>
				<xsl:value-of select="ADDR_TYPE"/>
			</addr_type>
			<addr_origin>
				<xsl:value-of select="ADDR_ORIGIN"/>
			</addr_origin>
			<pers_no>
				<xsl:value-of select="PERS_NO"/>
			</pers_no>
			<addr_no>
				<xsl:value-of select="ADDR_NO"/>
			</addr_no>
			<firstname>
				<xsl:value-of select="FIRSTNAME"/>
			</firstname>
			<lastname>
				<xsl:value-of select="LASTNAME"/>
			</lastname>
			<fullname>
				<xsl:value-of select="FULLNAME"/>
			</fullname>
			<room_no_p>
				<xsl:value-of select="ROOM_NO_P"/>
			</room_no_p>
			<name>
				<xsl:value-of select="NAME"/>
			</name>
			<name_2>
				<xsl:value-of select="NAME_2"/>
			</name_2>
			<city>
				<xsl:value-of select="CITY"/>
			</city>
			<district>
				<xsl:value-of select="DISTRICT"/>
			</district>
			<postl_cod1>
				<xsl:value-of select="POSTL_COD1"/>
			</postl_cod1>
			<street>
				<xsl:value-of select="STREET"/>
			</street>
			<house_no>
				<xsl:value-of select="HOUSE_NO"/>
			</house_no>
			<country>
				<xsl:value-of select="COUNTRY"/>
			</country>
			<countryiso>
				<xsl:value-of select="COUNTRYISO"/>
			</countryiso>
			<region>
				<xsl:value-of select="REGION"/>
			</region>
			<sort1>
				<xsl:value-of select="SORT1"/>
			</sort1>
			<sort2>
				<xsl:value-of select="SORT2"/>
			</sort2>
			<time_zone>
				<xsl:value-of select="TIME_ZONE"/>
			</time_zone>
			<tel1_number>
				<xsl:value-of select="TEL1_NUMBR"/>
			</tel1_number>
			<e_mail>
				<xsl:value-of select="E_MAIL"/>
			</e_mail>
		</ebp_trading_partners>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
<metaInformation>
<scenarios ><scenario default="no" name="New EBP Schema 0523" userelativepaths="yes" url="EBPShoppingCart.xml" htmlbaseurl="" processortype="internal" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/><scenario default="no" name="New EBP Test File" userelativepaths="yes" url="EBPTestFile0603.xml" htmlbaseurl="" processortype="internal" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/><scenario default="yes" name="EBP&#x2D;0611" userelativepaths="yes" url="EBP&#x2D;0611.xml" htmlbaseurl="" processortype="xalan" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext=""/></scenarios><MapperInfo srcSchemaPath="EBPShoppingCart.xml" srcSchemaRoot="EBPShoppingCart" srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="GenexSchema.xsd" destSchemaRoot="ADAPTER_BO" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
</metaInformation>
-->