首页 > 解决方案 > Altova Mapforce Designer - how to use tags

问题描述

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.

Thanks for some hints.

标签: c#xsltaltovamap-force

解决方案


好的,我找到了一种方法:

我使用 c# 函数和调用此函数的模板创建了一个 XSLT 文件。

这个 XSLT 文件可以在 Mapforcedesigner 中加载并在 GUI 中用于连接输入和输出文件。

<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>

添加库


推荐阅读