cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to see message by using <xsl:message terminate="yes" in XSLT mapping

thorsten73
Participant
866

Hi all,

I have a problem with an XSLT mapping in the Integration Suite:

I want to check for the existence of some mandatory fields in the mapping and, if they are missing, abort the mapping and throw an exception.

Normally, this works using the instruction `<xsl:message terminate="yes">Exception Text</xsl:message>`.

The mapping is aborted in the Integration Suite, but I can't find my message "Exception Text" anywhere. I can only see the error message "Processing terminated by xsl:message at line 5 in XSLTMapping1.xsl," but not my message.

Does anyone know how to see the message in the log?
Otherwise nobody can't see the reason for the cancellation of the mapping.

Kind regards
Thorsten 

Accepted Solutions (1)

Accepted Solutions (1)

thorsten73
Participant

Hi,

here a solution which is working fine in Integration Suite. The mapping is interrupted and the error message is visible in the log.

Thererfore you can use the error function available since XSLT 2.0.

Example: <xsl:value-of select="error(QName('http://www.w3.org/2005/xqt-errors','error:err0815'), 'This is a test exception!')"/>

You can find a descrition of this function here: https://www.w3.org/TR/xpath-functions-31/#func-error

If you use this functionality you can see the error message in monitoring:

Error Details
net.sf.saxon.trans.UncheckedXPathException: This is a test exception!

BR,
Thorsten

marcelom_bovo
Participant
0 Kudos
Thanks, it helped me

Answers (2)

Answers (2)

thorsten73
Participant
0 Kudos

Is it possible to use XML validator for validating content of an XML message? I think it can only be used for schema validation, not for checking if the right content was sent. 

thorsten73
Participant
0 Kudos

I got the following response from SAP to this topic:

Upon checking with our dev experts, the CPI XSLT mapping uses Saxon Library for providing XSLT transformations. However, Saxon doesn't output by xsl error message default to the logs. For more information, kindly refer to the following documents:
https://www.saxonica.com/html/documentation12/using-xsl/stylesheet-output/message-output.html

We encourage you to submit the feature/functionality requests to our influence page:
https://influence.sap.com/sap/ino/#/campaign/2282/ideas-all/?sort=&campaign=2282&variant=all

Depending on the number of customer votes additional feature might also be considered. Feel free to post your questions, we will be glad to address them. 

I created a functionality request for this here: https://influence.sap.com/sap/ino/#/idea/326654/?section=sectionDetails

So please vote for it if you need this feature too.