<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schema.infor.com/InforOAGIS/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://xml.apache.org/saxon/java" xmlns:tfs="http://www.infor.com/tfs" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xd="http://www.pnp-software.com/XSLTdoc" exclude-result-prefixes="java tfs">
	<!---->
	<!--****************************************************************************************************-->
	<!-- Creates error Message -->
	<!--****************************************************************************************************-->
	<xd:doc>
		<xd:short>This function can be called to abort the transformation in case of an error.</xd:short>
		<xd:detail>For example a missing mandatory field in the mapping.<br/>
	The error is printed in the Log4J Error log of the TFS Server and is shown in the Log entries in the TFS UI.<br/>
	There are four variable message informations, which can be passed to this function and which are then included in the message.</xd:detail>
		<xd:param name="msg" type="String">Message to be printed/shown</xd:param>
		<xd:param name="value1" type="String">Variable message information 01 which is shown in the message.</xd:param>
		<xd:param name="value2" type="String">Variable message information 02 which is shown in the message.</xd:param>
		<xd:param name="value3" type="String">Variable message information 03 which is shown in the message.</xd:param>
		<xd:param name="value4" type="String">Variable message information 04 which is shown in the message.</xd:param>
	</xd:doc>
	<xsl:function name="tfs:raiseError">
		<xsl:param name="msg" as="xs:string"/>
		<xsl:param name="value1" as="xs:string"/>
		<xsl:param name="value2" as="xs:string"/>
		<xsl:param name="value3" as="xs:string"/>
		<xsl:param name="value4" as="xs:string"/>
		<!---->
		<xsl:value-of select="error(QName('http://www.infor.com/tfserr', 'err:TFS00001'), concat($msg, ' ', $value1,',', $value2, ',', $value3, ',', $value4))"/>
	</xsl:function>
</xsl:stylesheet>
