Altova Mapforce Designer - how to use <msxsl:script> tags

158 Views Asked by At

I use the Altova MapForce Designer to generate my XSLT Mappings we process in our Microsoft Service.

Now i would like to use the MS Ref to generate some C# Functions i need in the Mapping. I do not find the way to create a C# user Defined Function from the Designer.

Of course i can add the Functions at the end of the XSLT generation by hand, but it would be nice to have the hole XSLT in the Altova MFD File I think there should be a possibility to add a "Script" Tag to the Mapforce Toolbox but i do not find the setting.

  • Is there a DLL i need to add the library?
  • Is there a XSL File that declares the msxsl Namespace and i can import?

Thanks for some hints.

1

There are 1 best solutions below

1
On

Ok, i found a way:

I created a XSLT File with the c# Function and a Template that cals this function.

This XSLT File can be loaded in the Mapforcedesigner and used in the GUI to connect the input and output Files.

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  xmlns:user="urn:my-scripts">
  <msxsl:script language="C#" implements-prefix="user">
  <![CDATA[
  public double _circumference(double radius){
    double pi = 3.14;
    double circ = pi*radius*2;
    return circ;
  }
  ]]>
  </msxsl:script>
  <xsl:template name="user:circumference">
        <xsl:param name="input" select="()"/>
        <xsl:sequence select="user:_circumference($input)"/>
    </xsl:template>
</xsl:stylesheet>

Add Library