c# - 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.
- 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.
解决方案
好的,我找到了一种方法:
我使用 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>
推荐阅读
- docker-compose - docker-compose down 无法停止所有容器
- javascript - 如何在可见按钮上应用带有 eventListener 的 MutationObserver?
- image - Matlab - 去除白色区域
- ruby - ruby 中 if/elsif 内联语句的语法
- switch-statement - 是否有 switch 语句的替代方法,我将如何组织它?
- python - 从另一列过滤给定数值阈值的列对
- powershell - 如何找出是什么 powershell 脚本造成了如此多的内存消耗?
- r - 如何将参考列表转换为数据框?
- reactjs - 存储在 .env 文件中的变量未在 netlify 的生产构建中加载
- parameters - Flutter:将传递的参数更改为“StatefulWidget”