cancel
Showing results for 
Search instead for 
Did you mean: 

Value mapping in xslt mapping

Former Member
0 Kudos

Hi,

I have 2 mapping program one is main .xsl program and other one is value mapping program .xsl .

I have zipped both the program and imported into Imported archive in IR but while testing in interface mapping i am getting error.

error:could not compile xslt stylsheet.

Some of the interface having one .xsl program and value mapping is also defined in the main program itself,these interface i am able to execute successfully but unable to execute wherever there are 2 program (main prog + value mapping).

It seems that value mapping is not loading / executing.

Can anyone please guide me how to call value mapping using xslt mapping?

Thanks,

Subbu

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Panguluri,

Instead of using value mapping using xsl, you can create the value mapping in ID and can access from the xsl mapping only. If you are ok with this approach then please see this blog:

Regards,

---Satish

Former Member
0 Kudos

Hi,

As per my client we are not suppose to change anything in existing .xsl code. Is there any way to get this by using same 2 .xsl

program?

Regards,

Subbu

Former Member
0 Kudos

Hi

You can access value mapping table from XSLT mapping using XVIM class and i just implemented las week in one of my interface. It works fine.

Please visit.

/people/kulwinder.grewal/blog/2009/08/21/xslt-runtime-value-mapping-from-integration-directory-using-xivmserviceclass

I am not sure if this blog is accessible now.if not please get in touch me.i will send it you.

Thanks

Rajesh

prateek
Active Contributor
0 Kudos

When you say you have two XSL file, do you want to execute both the mappings in your scenario?

If yes, then in your Interface Mapping, you need to use both th XSL files. Before that you need to make sure that mapping in XSL is done based to accommodate multiple mappings.

Regards,

Prateek

Former Member
0 Kudos

Hi Prateek,

Thanks for the response.

Yes i have 2 program and both needs to execute in one interface mapping.

First program (main) is MappingMOAPS_SAVEMULTIPLE2013.xsl and second program i.e (value mapping) MO_vmf.xsl.

From main program itself value mapping program is called.

Please look below code for main & value mapping prog.

In main prog this is the parameter (<xsl:import href="MO_vmf.xslt"/>) where value mapping prog name is mentioned.

I have already zipped and imported but while testing in interface mapping it is giving error that "could not compile xslt stylsheet".

Could you plaese tell how to check or make XSL to accommodate multiple mappings?

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

Main mapping : MappingMOAPS_SAVEMULTIPLE2013.xsl --

<?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" xmlns:vmf="http://www.altova.com/MapForce/UDF/vmf" exclude-result-prefixes="vmf xs xsi xsl">

<xsl:import href="MO_vmf.xslt"/>

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

<xsl:template match="/PPR">

<MOAPS_SAVEMULTIPLE201>

<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_ID_IDOCS">

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

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

Value mapping : MO_vmf.xsl:

<?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:vmf="http://www.altova.com/MapForce/UDF/vmf" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs xsi xsl">

<xsl:template name="vmf:inputtoresult">

<xsl:param name="input"/>

<xsl:choose>

<xsl:when test="$input='01'">

<xsl:value-of select="'PM1C'"/>

</xsl:when>

<xsl:when test="$input='02'">

<xsl:value-of select="'PM2C'"/>

</xsl:when>

<xsl:when test="$input='03'">

<xsl:value-of select="'EXT3'"/>

</xsl:when>

Regards,

Subbu

Former Member
0 Kudos

MappingMOAPS_SAVEMULTIPLE2013.xsl:

<?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" xmlns:vmf="http://www.altova.com/MapForce/UDF/vmf" exclude-result-prefixes="vmf xs xsi xsl">

<xsl:import href="MO_vmf.xslt"/>

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

<xsl:template match="/PPR">

<MOAPS_SAVEMULTIPLE201>

<IDOC>

<EDI_DC40>

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

Parameter : <xsl:import href="MO_vmf.xslt"/>

MO_vmf.xsl:

<?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:vmf="http://www.altova.com/MapForce/UDF/vmf" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs xsi xsl">

<xsl:template name="vmf:inputtoresult">

<xsl:param name="input"/>

<xsl:choose>

<xsl:when test="$input='01'">

<xsl:value-of select="'PM1C'"/>

</xsl:when>

<xsl:when test="$input='02'">

<xsl:value-of select="'PM2C'"/>

</xsl:when>

Regards,

Subbu

prateek
Active Contributor
0 Kudos

Could you also try with xsl:include instead of xsl:import?

Regards,

Prateek

Former Member
0 Kudos

Hi,

I have changed but getting same error in interface mapping.

Error:Transformer Configuration Exception occured while loading XSLT.

If it is ok can i send details to your Id?

Regards,

Subbu