cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping issue

Former Member
0 Kudos

Hi,

I am working in migration project i.e. from Webmethod to PI 7.1 in that client has give all the .xsd structure file and .xsl mapping program and I have imported both the files in PI but getting error while testing in interface mapping.

Error: TransformerConfigurationException Occurred when loading XSLT ZORDERS.xsl

details: Could not compile stylsheet.

Can anyone please guide me to resolve this issue?

Thanks,

Subbu

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Panguluri,

The xsl program worked in webmethods might not be necessarily workk in pi also. The error says there are some issues in your xsl mapping program. So first create a a sample xml payload and then first please test your XSL mapping using Altova XML Spy. So if it worked there then save the .xsl program and then zip the .xsl file and then imported into IR.

If it didnot work then give the sample payload and the xsl program here so that somebody can help you out here.

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

I am unable to send code in SDN so i have sent this code to your gmail ID.

I have tested XSL mapping program with xml payload in Altova , here it is not giving any error.

As you have suggested i have zipped .xsl program and imported into IR but in interface mapping it is giving error.

In PI i am using namespace:http://kkrtosap.com . Do i need to add this namespace in .xsl mapping program? If yes where should i add this?

I will be waiting for your response.

Regards,

Subbu

Former Member
0 Kudos

Hi Panguluri,

There is no need to add the namespace which you have created in IR.

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

Thanks for your support to resolve this. I was doing mistake while importing the file.

Regards,

Subbu

Answers (5)

Answers (5)

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Satish,

I have tested XSL mapping program with xml payload in Altova , here it is not giving any error.

As you have suggested i have zipped .xsl program and imported into IR but in interface mapping it is giving error.

In PI i am using namespace:http://kkrtosap.com . Do i need to add this namespace in .xsl mapping program? If yes where should i add this?

I am also sending .xsl program and xml payload.

.xsl program

*****

<?xml version="1.0" encoding="UTF-8"?>

<!--

This file was generated by Altova MapForce 2008sp1

YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE

OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.

Refer to the Altova MapForce Documentation for further details.

http://www.altova.com/mapforce

-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs xsi xsl">
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
	<xsl:template match="/PPR">
		<ZORDERS05EXT>
			<IDOC>
				<EDI_DC40>
					<xsl:for-each select="SI_ID_IDOCS">
						<xsl:for-each select="ID_TABNAM">
							<TABNAM>
								<xsl:value-of select="."/>
							</TABNAM>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_SP_SAP_PARTNER_INFO">
						<xsl:for-each select="SP_MANDT">
							<MANDT>
								<xsl:value-of select="."/>
							</MANDT>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_CH_ORDCHG_HEADER">
						<xsl:for-each select="CH_DOC_NUM">
							<DOCNUM>
								<xsl:value-of select="."/>
							</DOCNUM>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_ID_IDOCS">
						<xsl:for-each select="ID_DIRECT">
							<DIRECT>
								<xsl:value-of select="."/>
							</DIRECT>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_ID_IDOCS">
						<xsl:for-each select="ID_IDOCTYP">
							<IDOCTYP>
								<xsl:value-of select="."/>
							</IDOCTYP>
						</xsl:for-each>
					</xsl:for-each>
					<CIMTYP>
						<xsl:value-of select="'ZORDERS05EXT'"/>
					</CIMTYP>
					<xsl:for-each select="SI_ID_IDOCS">
						<xsl:for-each select="ID_MESTYP">
							<MESTYP>
								<xsl:value-of select="."/>
							</MESTYP>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_SP_SAP_PARTNER_INFO">
						<xsl:for-each select="SP_SNDPOR">
							<SNDPOR>
								<xsl:value-of select="."/>
							</SNDPOR>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_SP_SAP_PARTNER_INFO">
						<xsl:for-each select="SP_SNDPRT">
							<SNDPRT>
								<xsl:value-of select="."/>
							</SNDPRT>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_SP_SAP_PARTNER_INFO">
						<xsl:for-each select="SP_SNDPRN">
							<SNDPRN>
								<xsl:value-of select="."/>
							</SNDPRN>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_SP_SAP_PARTNER_INFO">
						<xsl:for-each select="SP_RCVPOR">
							<RCVPOR>
								<xsl:value-of select="."/>
							</RCVPOR>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_SP_SAP_PARTNER_INFO">
						<xsl:for-each select="SP_RCVPRT">
							<RCVPRT>
								<xsl:value-of select="."/>
							</RCVPRT>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_SP_SAP_PARTNER_INFO">
						<xsl:for-each select="SP_RCVPRN">
							<RCVPRN>
								<xsl:value-of select="."/>
							</RCVPRN>
						</xsl:for-each>
					</xsl:for-each>
					<xsl:for-each select="SI_CH_ORDCHG_HEADER">
						<xsl:variable name="VmarkerloopSI_CH_ORDCHG_HEADER2" select="."/>
						<xsl:for-each select="CH_DOC_NUM">
							<xsl:variable name="Vvar14_result" select="normalize-space(.)"/>
							<xsl:variable name="Vvar15_result" select="string-length($Vvar14_result)"/>
							<xsl:variable name="Vvar16_result">
								<xsl:value-of select="($Vvar15_result) - ('9')"/>
							</xsl:variable>
							<xsl:variable name="Vvar17_result" select="substring($Vvar14_result, $Vvar16_result, '10')"/>
							<xsl:for-each select="$VmarkerloopSI_CH_ORDCHG_HEADER2/CH_DOC_SEQ">
								<xsl:variable name="Vvar18_result" select="normalize-space(.)"/>
								<xsl:variable name="Vvar19_result" select="string-length($Vvar18_result)"/>
								<xsl:variable name="Vvar20_result">
									<xsl:value-of select="($Vvar19_result) - ('5')"/>
								</xsl:variable>
								<xsl:variable name="Vvar21_result" select="substring($Vvar18_result, $Vvar20_result, '6')"/>
								<xsl:variable name="Vvar22_result" select="concat('PPR', $Vvar17_result)"/>
								<xsl:variable name="Vvar23_result" select="concat($Vvar22_result, ' SEQ')"/>
								<xsl:variable name="Vvar24_result" select="concat($Vvar23_result, $Vvar21_result)"/>
								<ARCKEY>
									<xsl:value-of select="$Vvar24_result"/>
								</ARCKEY>
							</xsl:for-each>
						</xsl:for-each>
					</xsl:for-each>
				</EDI_DC40>
				<E1EDK01>
					<xsl:for-each select="SI_CH_ORDCHG_HEADER">
						<xsl:for-each select="CH_SLS_DOC_NO">
							<xsl:variable name="Vvar25_result" select="number(.)"/>
							<xsl:variable name="Vvar26_result">
								<xsl:value-of select="($Vvar25_result) &gt; ('99999')"/>
							</xsl:variable>
							<xsl:variable name="Vvar27_cond">
								<xsl:choose>
									<xsl:when test="(string($Vvar26_result))='true'">
										<xsl:variable name="Vvar28_result" select="normalize-space(.)"/>
										<xsl:variable name="Vvar29_result" select="concat('X', $Vvar28_result)"/>
										<xsl:value-of select="$Vvar29_result"/>
									</xsl:when>
									<xsl:otherwise>
										<xsl:value-of select="."/>
									</xsl:otherwise>
								</xsl:choose>
							</xsl:variable>
							<BELNR>
								<xsl:value-of select="$Vvar27_cond"/>
							</BELNR>
						</xsl:for-each>
					</xsl:for-each>
				</E1EDK01>
				<xsl:for-each select="SI_CD_ORDCHG_DETAIL">
					<E1EDP01>
						<xsl:for-each select="CD_SLS_LINE_NO">
							<xsl:variable name="Vvar30_result" select="normalize-space(.)"/>
							<POSEX>
								<xsl:value-of select="$Vvar30_result"/>
							</POSEX>
						</xsl:for-each>
						<xsl:for-each select="CD_MATERIAL_NO">
							<xsl:variable name="Vvar31_result" select="substring(., '1', '5')"/>
							<xsl:variable name="Vvar32_result" select="concat('000000000000', '9')"/>
							<xsl:variable name="Vvar33_result" select="concat($Vvar32_result, $Vvar31_result)"/>
							<MATNR>
								<xsl:value-of select="$Vvar33_result"/>
							</MATNR>
						</xsl:for-each>
						<ZE1EDP01_ADDB>
							<xsl:for-each select="CD_PROD_QTY">
								<ZZSTKPPR>
									<xsl:value-of select="."/>
								</ZZSTKPPR>
							</xsl:for-each>
						</ZE1EDP01_ADDB>
					</E1EDP01>
				</xsl:for-each>
			</IDOC>
		</ZORDERS05EXT>
	</xsl:template>
</xsl:stylesheet>

***************

xml payload:
**************

<?xml version="1.0" encoding="UTF-8"?>
<PPR BEGIN="" xsi:noNamespaceSchemaLocation="SI_CH_IDOC.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SI_ID_IDOCS IDOCINFO="1">
<ID_MESTYP>ZORDER_CHG</ID_MESTYP>
<ID_DOCTYP>ORDERS05</ID_DOCTYP>
<ID_IDOCTYP>ORDERS05</ID_IDOCTYP>
<ID_TABNAM>EDI_DC40</ID_TABNAM>
<ID_DIRECT>2</ID_DIRECT>
<ID_DESCRIPTION>ORDERS TO SAP</ID_DESCRIPTION>
<ID_XSLT_FILE>MappingZORDERS05EXT.xslt</ID_XSLT_FILE>
<ID_DATE_ADDED>12/28/2007 00:00:00</ID_DATE_ADDED>
<ID_LAST_UPDATE>12/28/2007 00:00:00</ID_LAST_UPDATE>
</SI_ID_IDOCS>
<SI_SP_SAP_PARTNER_INFO SAPINFO="1">
<SP_MANDT>800</SP_MANDT>
<SP_SNDPOR>EPE_PPR   </SP_SNDPOR>
<SP_SNDPRT>LS</SP_SNDPRT>
<SP_SNDPRN>EPE_PPR   </SP_SNDPRN>
<SP_RCVPOR>SAPDBP    </SP_RCVPOR>
<SP_RCVPRT>LS</SP_RCVPRT>
<SP_RCVPRN>DBPCLNT800</SP_RCVPRN>
<SP_STATUS>A</SP_STATUS>
</SI_SP_SAP_PARTNER_INFO>
<SI_CH_ORDCHG_HEADER CHDATA="1">
<CH_DOC_NUM>00000000000003461672</CH_DOC_NUM>
<CH_DOC_SEQ>0000000002</CH_DOC_SEQ>
<CH_MESTYP>ZORDER_CHG</CH_MESTYP>
<CH_DIRECT> </CH_DIRECT>
<CH_INSERT_DT>04/07/2009 01:52:46</CH_INSERT_DT>
<CH_LAST_UPD_DT>04/07/2009 02:00:10</CH_LAST_UPD_DT>
<CH_STATUS>A</CH_STATUS>
<CH_EVENT_ID></CH_EVENT_ID>
<CH_EVENT_SEQ></CH_EVENT_SEQ>
<CH_CONTROL_AREA>IPUS</CH_CONTROL_AREA>
<CH_DOC_TYPE></CH_DOC_TYPE>
<CH_DV_QUALF></CH_DV_QUALF>
<CH_DV_ORG></CH_DV_ORG>
<CH_DC_QUALF></CH_DC_QUALF>
<CH_DC_ORG></CH_DC_ORG>
<CH_SO_QUALF></CH_SO_QUALF>
<CH_SO_ORG></CH_SO_ORG>
<CH_PARTNER_FUNC>  </CH_PARTNER_FUNC>
<CH_PARTNER_SOLDTO></CH_PARTNER_SOLDTO>
<CH_VN_QUALF>    </CH_VN_QUALF>
<CH_SLS_DOC_NO>014896    </CH_SLS_DOC_NO>
</SI_CH_ORDCHG_HEADER>
<SI_CD_ORDCHG_DETAIL CDDATA="001">
<CD_DOC_NUM>00000000000003461672</CD_DOC_NUM>
<CD_DOC_SEQ>0000000002</CD_DOC_SEQ>
<CD_SLS_DOC_NO>014896    </CD_SLS_DOC_NO>
<CD_SLS_LINE_NO>001   </CD_SLS_LINE_NO>
<CD_ACTION></CD_ACTION>
<CD_MATERIAL_NO>0877232750J   C2S</CD_MATERIAL_NO>
<CD_QUALF></CD_QUALF>
<CD_IDTNR></CD_IDTNR>
<CD_PROD_QTY>0424400</CD_PROD_QTY>
</SI_CD_ORDCHG_DETAIL>
</PPR>

Regards,

Subbu

Edited by: subbarayudu panguluri on Aug 5, 2009 8:20 PM

Edited by: subbarayudu panguluri on Aug 5, 2009 8:22 PM

Former Member
0 Kudos

Hi,

Thanks for the response.

Namespace i am using in PI is http://kkrtosap.com . where should i change the namespace in mapping program and what changes i need to do in attribute.

I am sending the part of mapping program.

*************************************

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs xsi xsl">

<xsl:output method="xml" encoding="UTF-8" indent="yes"/>

<xsl:template match="/PPR">

<ZORDERS05EXT>

<IDOC>

<EDI_DC40>

<xsl:for-each select="SI_ID_IDOCS">

<xsl:for-each select="ID_TABNAM">

<TABNAM>

<xsl:value-of select="."/>

</TABNAM>

</xsl:for-each>

</xsl:for-each>

<xsl:for-each select="SI_SP_SAP_PARTNER_INFO">

<xsl:for-each select="SP_MANDT">

<MANDT>

<xsl:value-of select="."/>

</MANDT>

</xsl:for-each>

</xsl:for-each>

<xsl:for-each select="SI_CH_ORDCHG_HEADER">

<xsl:for-each select="CH_DOC_NUM">

<DOCNUM>

<xsl:value-of select="."/>

</DOCNUM>

</xsl:for-each>

</xsl:for-each>

<xsl:for-each select="SI_ID_IDOCS">

<xsl:for-each select="ID_DIRECT">

<DIRECT>

<xsl:value-of select="."/>

</DIRECT>

</xsl:for-each>

</xsl:for-each>

<xsl:for-each select="SI_ID_IDOCS">

<xsl:for-each select="ID_IDOCTYP">

<IDOCTYP>

<xsl:value-of select="."/>

</IDOCTYP>

*****************************

Regards,

Subbu

Former Member
0 Kudos

Go to Moni and check the error for more info

and also what is the XSLT doing ..

Rajesh

Former Member
0 Kudos

Hi Subbu,

As you said that you directly copied the xslt,there may be a need to change the xml attributes or check if the namespace declaration is proper or not.

refer this [link|;