In one of my recent project, we get invoice files from SAP which has to be converted to EDIFACT format in BizTalk map, which is completely done using custom XSLT before sending it to customer.
I had to check inside the map if a particular field is available in IDOC and terminate immediately if the field does not exist.
I got the solution from the below link
<xsl:message terminate=”yes”>Custom error text</xsl:message>
The above XSLT construct can be called inside any conditional statement in the BizTalk XSLT transformation to raise exception.