cancel
Showing results for 
Search instead for 
Did you mean: 

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

thorsten73
Participant
540

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 

Ryan-Crosby
Active Contributor
0 Kudos
Why not use the XML validator function for this type of thing?
Ryan-Crosby
Active Contributor
0 Kudos

You had stated "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." which I would consider schema validation.

thorsten73
Participant
0 Kudos

Oh, sorry. That was my fault. I didn't describe my problem correctly.
We want to check the content of an XML document, not the structure.

View Entire Topic
thorsten73
Participant
0 Kudos

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