<commit_before><xsl:stylesheet version="1.0"
                xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <!-- Assuming that the following Parameters are derived runtime from header -->
    <xsl:param name="c2r_msg_id" /> <!-- a UUID -->
    <xsl:param name="c2r_today_204" />
    <xsl:param name="c2r_report_received_on_102" />
    <xsl:param name="c2r_msg_number" />
    <xsl:param name="c2r_msg_date" />
    <xsl:param name="c2r_msg_sender_id" />
    <xsl:param name="c2r_msg_receiver_id" />
    <xsl:param name="report_id" />
    
    <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>

    <xsl:template match="/">
        <ichicsrack lang="en">
            <ichicsrmessageheader>
                <messagetype>ichicsrack</messagetype>
                <!-- always ichicsrack for ach-->
                <messageformatversion>1.1</messageformatversion>
                <!-- ich-icsrack-v1.1.dtd is used for icsr 2.1-->
                <messageformatrelease>1.0</messageformatrelease>
                <!-- release of dtd is 1.0 -->
                <messagenumb><xsl:value-of select="$c2r_msg_id" /></messagenumb>
                <!-- caAERS's unique message number, for this ACK message -->
                <messagesenderidentifier><xsl:value-of select="$c2r_msg_receiver_id" /></messagesenderidentifier>
                <messagereceiveridentifier><xsl:value-of select="$c2r_msg_sender_id" /></messagereceiveridentifier>
                <messagedateformat>204</messagedateformat>
                <messagedate><xsl:value-of select="$c2r_today_204" /></messagedate>
                <!-- Date on which ack got created : in CCYYMMDDHHMMSS format-->
            </ichicsrmessageheader>
            <acknowledgment>
                <messageacknowledgment>
                    <icsrmessagenumb><xsl:value-of select="$c2r_msg_number" /></icsrmessagenumb>
                    <!-- obtained as part of the input safety report message -->
                    <localmessagenumb></localmessagenumb>
                    <!-- optional, might not be present if there was processing error. This number was assigned to the input safety Message by caAERS -->
                    <icsrmessagesenderidentifier><xsl:value-of select="$c2r_msg_sender_id" /></icsrmessagesenderidentifier>
                    <icsrmessagereceiveridentifier><xsl:value-of select="$c2r_msg_receiver_id" /></icsrmessagereceiveridentifier>
                    <icsrmessagedateformat>204</icsrmessagedateformat>
                    <icsrmessagedate><xsl:value-of select="$c2r_msg_date" /></icsrmessagedate>
                    <transmissionacknowledgmentcode>02</transmissionacknowledgmentcode>
                    <parsingerrormessage><xsl:value-of select="//payload" /></parsingerrormessage> 
                </messageacknowledgment>
            </acknowledgment>
        </ichicsrack>
    </xsl:template><commit_msg>CAAERS-7022, trying a more friendly error message.<commit_after><xsl:stylesheet version="1.0"
                xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <!-- Assuming that the following Parameters are derived runtime from header -->
    <xsl:param name="c2r_msg_id" /> <!-- a UUID -->
    <xsl:param name="c2r_today_204" />
    <xsl:param name="c2r_report_received_on_102" />
    <xsl:param name="c2r_msg_number" />
    <xsl:param name="c2r_msg_date" />
    <xsl:param name="c2r_msg_sender_id" />
    <xsl:param name="c2r_msg_receiver_id" />
    <xsl:param name="report_id" />
    
    <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>

    <xsl:template match="/">
        <ichicsrack lang="en">
            <ichicsrmessageheader>
                <messagetype>ichicsrack</messagetype>
                <!-- always ichicsrack for ach-->
                <messageformatversion>1.1</messageformatversion>
                <!-- ich-icsrack-v1.1.dtd is used for icsr 2.1-->
                <messageformatrelease>1.0</messageformatrelease>
                <!-- release of dtd is 1.0 -->
                <messagenumb><xsl:value-of select="$c2r_msg_id" /></messagenumb>
                <!-- caAERS's unique message number, for this ACK message -->
                <messagesenderidentifier><xsl:value-of select="$c2r_msg_receiver_id" /></messagesenderidentifier>
                <messagereceiveridentifier><xsl:value-of select="$c2r_msg_sender_id" /></messagereceiveridentifier>
                <messagedateformat>204</messagedateformat>
                <messagedate><xsl:value-of select="$c2r_today_204" /></messagedate>
                <!-- Date on which ack got created : in CCYYMMDDHHMMSS format-->
            </ichicsrmessageheader>
            <acknowledgment>
                <messageacknowledgment>
                    <icsrmessagenumb><xsl:value-of select="$c2r_msg_number" /></icsrmessagenumb>
                    <!-- obtained as part of the input safety report message -->
                    <localmessagenumb></localmessagenumb>
                    <!-- optional, might not be present if there was processing error. This number was assigned to the input safety Message by caAERS -->
                    <icsrmessagesenderidentifier><xsl:value-of select="$c2r_msg_sender_id" /></icsrmessagesenderidentifier>
                    <icsrmessagereceiveridentifier><xsl:value-of select="$c2r_msg_receiver_id" /></icsrmessagereceiveridentifier>
                    <icsrmessagedateformat>204</icsrmessagedateformat>
                    <icsrmessagedate><xsl:value-of select="$c2r_msg_date" /></icsrmessagedate>
                    <transmissionacknowledgmentcode>02</transmissionacknowledgmentcode>
                    <parsingerrormessage><xsl:choose>
                    	<xls:when test="fn:starts-with(//payload, 'soap:Client : Unmarshalling Error')">
                    		The XML file provided could not be parsed.
                    		Please ensure that it is properly formed and that data is of the correct type.
                    		Full Error Details;
                    		<xsl:value-of select="//payload" />
                    	</xls:when>
                    	<xls:otherwise>
                    		<xsl:value-of select="//payload" />
                    	</xls:otherwise>
                    </xsl:choose></parsingerrormessage>
                </messageacknowledgment>
            </acknowledgment>
        </ichicsrack>
    </xsl:template>
{'fraction_non_alphanumeric': 0.12479301520397411, 'fraction_numerical': 0.01685985247629083, 'mean_word_length': 2.2536728697355533, 'pattern_counts': {'":': 0, '<': 150, '<?xml version=': 0, '>': 150, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7595943', 'n_tokens_mistral': 2139, 'n_tokens_neox': 1857, 'n_words': 332}