cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping not working

Former Member
0 Kudos

Hi

I am creating one scenario using following weblog :

/people/community.user/blog/2006/09/08/email-report-as-attachment-excelword

But in my I am only getting the Headings but no values which I am providing through my XML file.

My XSLT is look like this.

Please find the link of the xslt file below, unfortunately I am unable to paste the xslt code below.

http://www.sendspace.com/file/bhk3u4

http://www.filefactory.com/file/b2d333a/n/xslt.txt

Notes

1. I am using External Definition as a Source not the Message Type.

2. There is no ns0 or ns1 in the source file.

*Source Message*

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

<Document xmlns='urn:iso:std:iso:20022:tech:xsd:pain.002.001.02' xmlns:xsi='http://wwww3org/2001/XMLSchema-instance'>

<pain.002.001.02>

<GrpHdr>

<MsgId>20091224-PSR/1040</MsgId>

<CreDtTm>2009-12-24T10:42:21</CreDtTm>

</GrpHdr>

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

*Mapping Error*

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

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemasxmlsoaporg/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">RESOURCE_NOT_FOUND</SAP:Code>

<SAP:P1>d4f78d30-381b-11df-b885-debcac120353, 660e7670-68~</SAP:P1>

<SAP:P2>urn:xx.com:xi:A_B2B_RSE:FI:XXXX</SAP:P2>

<SAP:P3>email/test.xsl</SAP:P3>

<SAP:P4>-1</SAP:P4>

<SAP:AdditionalText />

<SAP:Stack>Unable to find resource d4f78d30-381b-11df-b885-debcac120353, 660e7670-68~ in the following software component versions: urn:xxcom:xi:A_B2B_RSE:FI:xx/test.xsl-1</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

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

Can somebody please help me.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Resolved

former_member200962
Active Contributor
0 Kudos
1. I am using External Definition as a Source not the Message Type.

that should not be an issue....you should ensure that the message included in the source/ target Message Interface should be the same as that inlcuded in the source/ target of the XSLT mapping!

Any mismatch can also lead to the above error.

From your earlier thread:

1)

<ns1:Mail xmlns:ns1="http://sapcom/xi/XI/Mail/30">

It should be <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">

2) Why do you have the Document node after Mail in the XSLT?

3) Why is the Content type as text/html in your XSLT? as per the blog it should be according to the format in which you want to have the attachment!

Can you re-check the XSLT once?

Regards,

Abhishek.

Former Member
0 Kudos

Hi abhishek,

I don't know much about the XSLT mapping

I found one thread in which one of the guy mentioned about using the xslt tag after m ail Tag.

I need to send the output as a m ail content not as an attachment.

Below is the example

<?xml version='1.0'?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

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

<xsl:template match="/">

<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">

<ns0:Catalog_MT xmlns:ns0="urn:Reporting">

<Subject>Deliveries from XI</Subject>

<From>MY </From>

<To>My </To>

<Content_Type>text/html</Content_Type>

<Content>

<xsl:text xsl:space="preserve">Catalog of CDs available:</xsl:text>

<xsl:text xsl:space="preserve">Title</xsl:text>

<xsl:text xsl:space="preserve">Artist</xsl:text>

<xsl:text xsl:space="preserve">Country</xsl:text>

<xsl:text xsl:space="preserve">Company</xsl:text>

<xsl:text xsl:space="preserve">Price</xsl:text>

<xsl:text xsl:space="preserve">Year</xsl:text>

<xsl:for-each select="ns0:Catalog_MT/cd">

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

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

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

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

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

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

</xsl:for-each>

</Content>

</ns0:Catalog_MT>

</ns1:Mail>

</xsl:template>

</xsl:stylesheet>

The only difference I have is I am using external definition but may be because of that I am getting this error as I don't know how to use the external definition.

My XSLT which might contains errors

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://wwww3org/1999/XSL/Transform">

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

<xsl:variable name="break">&lt;br&gt;</xsl:variable>

<xsl:variable name="tableB">&lt;table&gt;</xsl:variable>

<xsl:variable name="tableE">&lt;/table&gt;</xsl:variable>

<xsl:variable name="trB">&lt;tr&gt;</xsl:variable>

<xsl:variable name="trE">&lt;/tr&gt;</xsl:variable>

<xsl:variable name="tdB">&lt;td&gt;</xsl:variable>

<xsl:variable name="tdE">&lt;/td&gt;</xsl:variable>

<xsl:variable name="nbsp">&amp;nbsp;</xsl:variable>

<xsl:variable name="thB">&lt;tr BGCOLOR=&quot;#CCCC99&quot;&gt;</xsl:variable>

<xsl:template match="/">

<ns1:Mail xmlns:ns1="http://sapcom/xi/XI/Mail/30">

<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.002.001.02" xmlns:ns0="urn:xcom:xi:A_B2B_RSE:FI:XXX">

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

<xsl:for-each select="Document/pain.002.001.02">

</Document>

Note:

1. There is no ns0, ns1.

2. How to use External Definition.

Former Member
0 Kudos

here is the blog without the attachment

/people/community.user/blog/2006/09/07/email-reporting

here is the thread with the solution.

former_member200962
Active Contributor
0 Kudos
I found one thread in which one of the guy mentioned about using the xslt tag after m ail Tag.

Who is that guy/ thread?

I need to send the output as a m ail content not as an attachment.

Then check this blog: /people/community.user/blog/2006/09/07/email-reporting

One thing that for sure the below XSLT is wrong

<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">

<ns0:Catalog_MT xmlns:ns0="urn:Reporting">

You would be using Mail package in the output side and that surely does not have a Catalog_MT or Document node.

Regards,

Abhishek.

former_member200962
Active Contributor
0 Kudos
here is the blog without the attachment

Check the code in the blog itself....you will have a similar code ....just the name of the nodes will change.

Former Member
0 Kudos

Hi Abhishek,

The Document is the name of my source file.

here is the my source file

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

<Document xmlns='urn:iso:std:iso:20022:tech:xsd:pain.002.001.02' xmlns:xsi='http://wwww3org/2001/XMLSchema-instance'>

<pain.002.001.02>

<GrpHdr>

<MsgId>20091224-PSR/1040</MsgId>

<CreDtTm>2009-12-24T10:42:21</CreDtTm>

</GrpHdr>

and I used that in my xslt mapping

<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">

<ns0:Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.002.001.02" xmlns:ns0="urn:linde.com:xi:A_B2B_RSE:FI:XXXX">

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

<xsl:for-each select="Document/pain.002.001.02">

</Document>

My source message is a XML file not the file and it didn't contain any ns0 or ns1.

HTTP---XI----MAIL

former_member200962
Active Contributor
0 Kudos
The Document is the name of my source file.
My source message is a XML file not the file and it didn't contain any ns0 or ns1

This is fine.

the main error is your XSLT is not detectable during runtime.....and for that first check that you have included the same source/ target in you XSLT mapping and Interface mapping.

Former Member
0 Kudos

Hi Abhishek,

I have managed to solved the source issue and now i am getting this error in SXMB_MONI

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

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">TRANSFORMER_CONF_EX</SAP:Code>

<SAP:P1>testemail/Email.xsl</SAP:P1>

<SAP:P2>urn:xxx.com:xi:A_B2B_RSE:FI:xxx</SAP:P2>

<SAP:P3>d4f78d30-381b-11df-b885-debcac120353</SAP:P3>

<SAP:P4>-1</SAP:P4>

<SAP:AdditionalText />

<SAP:Stack>TransformerConfigurationException triggered while loading XSLT mapping testemail/Email.xsl; urn:xxx.com:xi:A_B2B_RSE:FI:XXXd4f78d30-381b-11df-b885-debcac120353-1</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

former_member200962
Active Contributor
0 Kudos
I have managed to solved the source issue

And what was the solution?

TransformerConfigurationException triggered while loading XSLT mapping testemail/Email.xsl

the error says that the Mail structure is not formed properly....your XSLT is not correct!

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

I meant I have managed to resolved the other mapping issue

<MAPPING">RESOURCE_NOT_FOUND

But now I am getting this error

<MAPPING">TRANSFORMER_CONF_EX

I am just wondering did you get change to have a look at the XSLT mapping. I am bit confused about how to use external definition in the xslt mapping.

As you can see from the other blog all of them used the Message Type but in my case it is External definition

Will it be possible to get you mail address and I will send you the screen shot as well the complete XSLT Code.

My XSLT Mapping

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://wwww3org/1999/XSL/Transform">

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

<xsl:variable name="break">&lt;br&gt;</xsl:variable>

<xsl:variable name="tableB">&lt;table&gt;</xsl:variable>

<xsl:variable name="tableE">&lt;/table&gt;</xsl:variable>

<xsl:variable name="trB">&lt;tr&gt;</xsl:variable>

<xsl:variable name="trE">&lt;/tr&gt;</xsl:variable>

<xsl:variable name="tdB">&lt;td&gt;</xsl:variable>

<xsl:variable name="tdE">&lt;/td&gt;</xsl:variable>

<xsl:variable name="nbsp">&amp;nbsp;</xsl:variable>

<xsl:variable name="thB">&lt;tr BGCOLOR=&quot;#CCCC99&quot;&gt;</xsl:variable>

<xsl:template match="/">

<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">

<Document xmlns:ns0="urn:xx.com:xi:A_B2B_RSE:FI:XX">

<Subject>File Level Status</Subject>

<From>XX</From>

<To>XX</To>

<Content_Type>text/html</Content_Type>

I am not sure how to use external definition

<Document xmlns:ns0="urn:xx.com:xi:A_B2B_RSE:FI:XX">

In the other blogs they used Message Type

<ns0:Catalog_MT xmlns:ns0="urn:Reporting">

Can you please check the XSLT Code

former_member200962
Active Contributor
0 Kudos
I meant I have managed to resolved the other mapping issue

I asked how did you managed to solve the error....what is the solution....it may be beneficial for me/ community in future.

As you can see from the other blog all of them used the Message Type but in my case it is External definition

It does not make any difference if you are using a message type or External Definition.

See in the thread which you mentioned the Catalog entry was made because it had an ns0 associated with it....there was a need to specify to which namespace is the prefix associated.

In your case there is no namespace prefix (like ns0) so you dont need the declaration....

If you check the example given in this page you will notice the XML is without ns0/ ns1 and also is the XSLT....so ensure that you also develop your XSLT accordingly: http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog_ex2

Will it be possible to get you mail address and I will send you the screen shot as well the complete XSLT Code

Forum rules does not permit personal communication!

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

Thanks for your quick reply.

In regards to the first point it was my mistake I used the different name in Operation Mapping.

In regards to the External definition I need to know how to use it because if I know exactly how to write the sentence then it will resolve my issue.

If you could please have a look at my XSLT mapping and let me know the exact Tag or what exactly I need to write.

*Source XML File*

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

<Document xmlns='urn:iso:std:iso:20022:tech:xsd:pain.002.001.02' xmlns:xsi='http://wwww3org/2001/XMLSchema-instance'>

<pain.002.001.02>

<GrpHdr>

<MsgId>20091224-PSR/1040</MsgId>

<CreDtTm>2009-12-24T10:42:21</CreDtTm>

</GrpHdr>

*XSLT Mapping to generate the output*

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://wwww3org/1999/XSL/Transform">

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

<xsl:template match="/">

<ns1:Mail xmlns:ns1="http://sapcom/xi/XI/Mail/30">

<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.002.001.02" xmlns:ns0="urn:xcom:xi:A_B2B_RSE:FI:XXX">

<Subject>File Level Status</Subject>

<From>XX</From>

<To>XX</To>

<Content_Type>text/html</Content_Type>

<Content>

<xsl:text xsl:space="preserve">File Level Status:</xsl:text>

<xsl:text xsl:space="preserve">Original File Name</xsl:text>

<xsl:for-each select="Document/pain.002.001.02">

<xsl:value-of select="OrgnlGrpInfAndSts/OrgnlMsgId"/>

</xsl:for-each>

</Content>

</ns1:Mail>

</xsl:template>

</xsl:stylesheet>

Error in SXMB_MONI

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

- <!-- Request Message Mapping

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">

<SAP:Category>Application</SAP:Category>

<SAP:Code area="MAPPING">TRANSFORMER_CONF_EX</SAP:Code>

<SAP:P1>testemail/Email.xsl</SAP:P1>

<SAP:P2>urn:x.com:xi:A_B2B_RSE:FI:XX</SAP:P2>

<SAP:P3>d4f78d30-381b-11df-b885-debcac120353</SAP:P3>

<SAP:P4>-1</SAP:P4>

<SAP:AdditionalText />

<SAP:Stack>TransformerConfigurationException triggered while loading XSLT mapping testemail/Email.xsl; urn:xx.com:xi:A_B2B_RSE:FI:XXd4f78d30-381b-11df-b885-debcac120353-1</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

I hope you will get the clear picture now. so kindly tell me how to write the external definition in XSLT

Former Member
0 Kudos

Hi Abhishek,

I have now managed to get the output but I am only getting the heading but no values

Could you please check

Source XML File

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

<Document xmlns='urn:iso:std:iso:20022:tech:xsd:pain.002.001.02' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>

<pain.002.001.02>

<GrpHdr>

<MsgId>CITIBANK/20091224-PSR/1040</MsgId>

<CreDtTm>2009-12-24T10:42:21</CreDtTm>

</GrpHdr>

<OrgnlGrpInfAndSts>

<OrgnlMsgId>ANIL5_20091224</OrgnlMsgId>

<OrgnlMsgNmId>pain.001.001.02</OrgnlMsgNmId>

<OrgnlNbOfTxs>1</OrgnlNbOfTxs>

<OrgnlCtrlSum>96000</OrgnlCtrlSum>

<GrpSts>ACTC</GrpSts>

<StsRsnInf>

<AddtlStsRsnInf>ACK - FILE ACCEPTED</AddtlStsRsnInf>

</StsRsnInf>

</OrgnlGrpInfAndSts>

</pain.002.001.02>

</Document>

XSLT Mapping to generate the output

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://wwww3org/1999/XSL/Transform">

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

<xsl:template match="/">

<ns1:Mail xmlns:ns1="http://sapcom/xi/XI/Mail/30">

<Subject>File Level Status</Subject>

<From>XX</From>

<To>XX</To>

<Content_Type>text/html</Content_Type>

<Content>

<xsl:text xsl:space="preserve">File Level Status:</xsl:text>

<xsl:text xsl:space="preserve">Original File Name</xsl:text>

<xsl:for-each select="Document/pain.002.001.02">

<xsl:value-of select="Document/pain.002.001.02/OrgnlGrpInfAndSts/OrgnlMsgId"/>

</xsl:for-each>

</Content>

</ns1:Mail>

</xsl:template>

</xsl:stylesheet>

I am not getting any values only heading could you please check if I am doing anything wrong.

prateek
Active Contributor
0 Kudos

This is mapping cache issue. Check the blog

/people/sylvia.xiong/blog/2010/03/09/hints-about-pi-runtime-cache-refresh

Goto "2.1.2 Things to do when perform cache refresh manually", Point 8 and perform this for your mapping object.

Regards,

Prateek

former_member200962
Active Contributor
0 Kudos

The error indicates that the mapping program is not able during runtime....this can be a CACHE issue.

Ensure that the XSLT mapping (zip file) is not deleted/ moved from IR and check the CPA cache (in ID), also perform a CACHE refresh.

Regards,

Abhishek.

Former Member
0 Kudos

Hi Abhishek,

I have rechecked the xslt and it is there. I zipped the xsl file and imported it in the imported archive.

Is there any way I can generate the output in XML Spy or any other software because I am not sure whether my XSLT is correct or not.

Could you please check my xslt mapping because I am not sure how to use the External definition.

Thanks for your help.