BizTalk XSLT Map - Execution of scripts was prohibited

731 Views Asked by At

I'm programming with BizTalk Server 2020 (Visual Studio 2019).

I have this xsl code (simplified), that is in an external xsl file of a btm map:

<?xml version="1.0" encoding="UTF-16"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                xmlns:msxsl="urn:schemas-microsoft-com:xslt" 
                xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var"
                exclude-result-prefixes="msxsl var userCSharp" version="1.0" 
                xmlns:ns0="http://Schema1/EDI/EDIFACT/2006" 
                xmlns:ns1="http://Schema2.schCanonical"
                xmlns:userCSharp="http://schemas.microsoft.com/BizTalk/2003/userCSharp">
                
  <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />

  <xsl:template match="/">
    <xsl:apply-templates select="/ns0:EFACT" />
  </xsl:template>
  
  <xsl:template match="/ns0:EFACT">
    <ns1:schCanonical>
      <xsl:variable name="var:v1" select="userCSharp:StringConcat(&quot;VariableOne&quot;)" />
    ...
    </ns1:schCanonical>
  </xsl:template>
  
  
  <msxsl:script language="C#" implements-prefix="userCSharp">
  <![CDATA[
  
public string StringConcat(string param0)
{
   return param0;
}

  ]]>
  </msxsl:script>
</xsl:stylesheet>

The problem is that on var:v1 declaration I have this warning:

Execution of scripts was prohibited. Use the XsltSettings.EnableScript property to enable it.


These are BTM GRID configurations:
  • Custom Extension XML: "externalObject.xml"
  • Custom XSLT Path: "xsl file with above code"
  • XSLT Trasform engine: Undefined

The externalObject.xml code is:

<ExtensionObjects />

This is the error:

This is the error:

My fear is that if I were to implement other functions, this error could affect the correct transformation output.

How can I fix it?

0

There are 0 best solutions below