Custom Extension XML (Grid Property)

 

Use the Custom Extension XML property to open the Select Custom Extension XML File dialog box, in which you can select the file that contains the custom extension XML for the map.

Category

Compiler

Allowed Values

Valid name of a file that contains the custom extension XML for the map.

Either type the full path name of the file or use the ellipsis button (...) on the right side of the input field to open the Select Custom Extension XML File dialog box.

Default Value

None.

Remarks

In a map, you can call a method in an external .NET assembly; you might do this by using the Scripting functoid, for example. When you do so, the map associates a namespace with this external .NET assembly to refer to it in the XSLT that is generated. This XSLT is usually of the following form:

xmlns:ScriptNS{n}="http://schemas.microsoft.com/BizTalk/2003/ScriptNS{n}"  
  

Where {n} is a number that corresponds to how many assemblies have been used in the map so far. The file identified by the Custom Extension XML property is used to bind this generated namespace to the FullyQualifiedName (FQN) of the .NET assembly to which it refers. This file is used during TestMap operations and at run time to instantiate the .NET assembly and then call the method defined within it. By default, this file is generated by BizTalk Mapper. When you validate a map, the Output window will contain links to the generated XSLT file and a link to the generated custom extension XML file, the latter of which is usually empty except for the tag "<ExtensionObjects/>".

To generate a non-empty custom extension XML file, use the external assembly fields of the Configure Functoid Script dialog box (associated with the Script property of a Scripting functoid) to identify an external assembly, class, and method within that class. Then validate the map and examine the contents of the generated XSLT and custom XML files. The XSLT file will use a namespace such as xmlns:ScriptNS{n}="http://schemas.microsoft.com/BizTalk/2003/ScriptNS{n}" and the custom extension XML file will define the binding between this namespace and the external .NET assembly.

There are two cases in which you will need to build your own custom extension XML file and set the Custom Extension XML file to refer to it, as follows:

  • If you use the Custom XSLT Path property to specify your own XSLT for the entire map file and you call an external .NET assembly from your XSLT, you are responsible for creating a properly formatted custom extension XML file that provides the appropriate namespace-to-assembly binding.

  • If you use the Inline XSLT or the Inline XSLT Call Template script types in a Scripting functoid and you call a method in an external .NET assembly from that XSLT, you are responsible for creating a properly formatted custom extension XML file that provides the appropriate namespace-to-assembly binding. This is required because BizTalk Mapper does not parse into the XSLT you provide looking for calls to external assemblies. Any binding information you provide by using the Custom Extension XML property will be appended to any binding information that has already been generated when the map was compiled (such as bindings required by other Scripting functoids in the map that use the external assembly option). When you validate the map, the resulting contents of the custom extension XML file contain the union of the binding information you provided and any binding information generated by BizTalk Mapper.

In the following example custom extension XML file, the namespace http://schemas.microsoft.com/BizTalk/2003/ScriptNS0 is bound to an assembly named "CustomFunctions.dll" that contains a class named CustomFunctions.MyClass:

<ExtensionObjects>  
   <ExtensionObject  
      Namespace="http://schemas.microsoft.com/BizTalk/2003/ScriptNS0"  
      AssemblyName="CustomFunctions, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  
      ClassName="CustomFunctions.MyClass" />  
</ExtensionObjects>  
  

In the XSLT generated by the corresponding map, the GetData method in this external assembly class is called by using the following syntax:

ScriptNS0:GetData(p1, p2, p3)  
  

Where the namespace prefix ScriptNS0 refers to the namespace http://schemas.microsoft.com/BizTalk/2003/ScriptNS0.

Note

You cannot undo or redo the Custom Extension XML property.

See Also

Grid Properties