在Visual Studio中,我可以右键单击一个地图(.btm文件),然后为一个地图手动选择“验证地图”。然后,我可以单击并查看XSLT。
是否可以调用此函数?我想将约150张地图转换为XSLT进行分析,并比较它们的相似/不同之处。
答案 0 :(得分:1)
您可以像这样通过业务流程动态加载和调用地图:
// dynamicMapType is declared 'System.Type'
dynamicMapType = Helper.GetMapType(MessageTypeName);
// Call the transform given by the object type, pass in a message
transform(msgOut) = dynamicMapType(msgIn);
这里是获取地图对象类型的示例。我把我放在C#助手程序集中。
public static System.Type GetMapType(string MessageType)
{
System.Type typ = null;
switch (MessageType.ToUpper())
{
case "ONE":
typ = System.Type.GetType("AssemblyQualifiedName_from_gacutil");
break;
default:
throw new SystemException("Could not determine map transform type '" + MessageType + "'");
}
if (typ == null)
throw new SystemException("Could not load map transform type '" + MessageType + "'");
return typ;
}