| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| I have several instances where I put a Scripting Functoid in my map, configure it as Inline Visual Basic .NET, and then call that function from my Custom XSLT using the userVB namespace. Now I want to be able to do the same thing with a Scripting Functoid configured as an External Assembly. If I drop the Scripting Functoid in the map, configure it as an External Assembly, and then use it directly in the map (connecting its inputs and outputs directly to the source and target schemas) and then do Validate Map to see the resultant XSL, the XSL includes a declaration of the namespace ScriptNS0 as http://schemas.microsoft.com/BizTalk/2003/ScriptNS0. The calls to the external function then use this ScriptNS0 namespace. But if I remove the input and output connections from the functoid and try to call it from my custom XSLT, the namespace isn't defined. When I do the same thing with an Inline Visual Basic .NET scripting functoid, the namespace declaration is automatically added to the XSL. So how can I configure a scripting functoid as External Assembly and call it from my custom XSLT? Thanks, Zoe |
|
#2
| |||
| |||
| Hi Zoe, You can add a custom extension xml file to your solution in order to declare the namespace and use a method from a .Net assembly from XSL. The extension file should look something like this: <ExtensionObjects> <ExtensionObject Namespace="http://mapHelper" AssemblyName="MyHelperAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=..." ClassName="MyHelper.MappingHelper"/> </ExtensionObjects> In the properties of your BizTalk map point the value of the 'custom extension file' property to the file above. Finally in your xsl you can use the method from the assembly. For example: <xsl:variable name="methodResult" xmlns:mapHelper="http://mapHelper" select="MappingHelper oMethod()" /><xsl:value-of select="$methodResult" /> Although this solution doesn't use a scripting functoid as an external assembly you can use it to call a custom .Net method from your code. If I interpret your question correctly that is what you need to do. HTH, Randal van Splunteren "Zoe Hart" <zoe.hart@nospam.competitive.com> wrote in message news:%23Z0K9zSiIHA.4376@TK2MSFTNGP05.phx.gbl... > I have several instances where I put a Scripting Functoid in my map, > configure it as Inline Visual Basic .NET, and then call that function from > my Custom XSLT using the userVB namespace. Now I want to be able to do the > same thing with a Scripting Functoid configured as an External Assembly. If > I drop the Scripting Functoid in the map, configure it as an External > Assembly, and then use it directly in the map (connecting its inputs and > outputs directly to the source and target schemas) and then do Validate Map > to see the resultant XSL, the XSL includes a declaration of the namespace > ScriptNS0 as http://schemas.microsoft.com/BizTalk/2003/ScriptNS0. The calls > to the external function then use this ScriptNS0 namespace. But if I remove > the input and output connections from the functoid and try to call it from > my custom XSLT, the namespace isn't defined. When I do the same thing with > an Inline Visual Basic .NET scripting functoid, the namespace declaration is > automatically added to the XSL. > > So how can I configure a scripting functoid as External Assembly and call it > from my custom XSLT? > > Thanks, > Zoe > > |
|
#3
| |||
| |||
| You are correct. I don't need the scripting functoid. I was just using that as a means of accessing my external assembly. I will try the approach you describe instead. Thanks, Zoe "Randal van Splunteren" <Randal.van.Splunteren@hotmail.com> wrote in message news:O3TS9iZiIHA.4344@TK2MSFTNGP03.phx.gbl... > Hi Zoe, > > You can add a custom extension xml file to your solution in order to > declare > the namespace and use a method from a .Net assembly from XSL. > > The extension file should look something like this: > > <ExtensionObjects> > <ExtensionObject Namespace="http://mapHelper" > AssemblyName="MyHelperAssembly, Version=1.0.0.0, Culture=neutral, > PublicKeyToken=..." ClassName="MyHelper.MappingHelper"/> > </ExtensionObjects> > > In the properties of your BizTalk map point the value of the 'custom > extension file' property to the file above. > > Finally in your xsl you can use the method from the assembly. For example: > > <xsl:variable name="methodResult" xmlns:mapHelper="http://mapHelper" > select="MappingHelper oMethod()" />> <xsl:value-of select="$methodResult" /> > > Although this solution doesn't use a scripting functoid as an external > assembly you can use it to call a custom .Net method from your code. If I > interpret your question correctly that is what you need to do. > > HTH, > > Randal van Splunteren > > "Zoe Hart" <zoe.hart@nospam.competitive.com> wrote in message > news:%23Z0K9zSiIHA.4376@TK2MSFTNGP05.phx.gbl... >> I have several instances where I put a Scripting Functoid in my map, >> configure it as Inline Visual Basic .NET, and then call that function >> from >> my Custom XSLT using the userVB namespace. Now I want to be able to do >> the >> same thing with a Scripting Functoid configured as an External Assembly. > If >> I drop the Scripting Functoid in the map, configure it as an External >> Assembly, and then use it directly in the map (connecting its inputs and >> outputs directly to the source and target schemas) and then do Validate > Map >> to see the resultant XSL, the XSL includes a declaration of the namespace >> ScriptNS0 as http://schemas.microsoft.com/BizTalk/2003/ScriptNS0. The > calls >> to the external function then use this ScriptNS0 namespace. But if I > remove >> the input and output connections from the functoid and try to call it >> from >> my custom XSLT, the namespace isn't defined. When I do the same thing >> with >> an Inline Visual Basic .NET scripting functoid, the namespace declaration > is >> automatically added to the XSL. >> >> So how can I configure a scripting functoid as External Assembly and call > it >> from my custom XSLT? >> >> Thanks, >> Zoe >> >> > > |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.