Use
In substantial XSLT programs it makes sense for the system to display an explanatory message when an error occurs. For this purpose there is the XSLT command
Alternatively, you can also call a Java method from your XSLT program, which writes information to the trace using the MappingTrace Object. For an example, see the XSLT mapping with Java enhancement section.
The PCK does not support the MappingTrace object.
Integration
Messages that are produced using the XSLT command
Features
The XLST command
<xsl:message terminate=“[yes|no]“>
The attribute Terminate determines whether processing of the XSLT program should be terminated (terminate=“yes”) or not (terminate=“no”). In both instances you can view the error message text by using the trace function for a message in monitoring (provided that you activated the trace function for the Integration Engine).
Example
The following example of a section of an XSLT program is taken from a mapping program with the name Person2Passenger.xsl. The XSLT commands in this section evaluate the current value of a tag from the source document and map the values as follows:
Source Document | Target Document |
0 | Mr. |
1 | Mrs. |
(Other) | Mr. or Mrs. |
The last instance is an exception for non-interpretable values. To retain this exception in the trace, a message is produced using
Gender has neither value 0 nor 1!
"Mr. or Mrs." was chosen for title.
Since the target field can still be completed appropriately, processing is not terminated (terminate=“no“).
Trace Output
In the technical monitor, the section in the trace for the third instance looks as follows:
No comments:
Post a Comment