源XSD结构:
documents (min occurs 1, max occurs 1)
document (min occurs 1, max occurs unbounded)
filename (min occurs 1, max occurs 1)目标XSD结构:
documents (min occurs 1, max occurs 1)
filename (min occurs 1, max occurs unbounded)如何在BizTalk映射器中完成此操作?
(编辑):第一个提供的解决方案是我的第一个实现,但似乎BizTalk中的测试映射选项(在BizTalk映射.btm文件上单击鼠标右键)有时需要额外的编译(我只保存了映射,然后使用测试映射选项测试了映射)。现在它起作用了。
发布于 2010-01-22 20:49:35
在Biztalk 2009 (可能还有2006)中,只需连接"filename“节点即可。
源架构:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://source" targetNamespace="http://source" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="documents">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" name="document">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="1" name="filename" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>目标架构:
<?xml version="1.0" encoding="utf-16"?>
<xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" xmlns="http://destination" targetNamespace="http://destination" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="documents">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="1" maxOccurs="unbounded" name="filename" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>地图:
<?xml version="1.0" encoding="utf-16"?>
<mapsource Name="BizTalk Map" BizTalkServerMapperTool_Version="2.0" Version="2" XRange="100" YRange="420" OmitXmlDeclaration="Yes" TreatElementsAsRecords="No" OptimizeValueMapping="Yes" GenerateDefaultFixedNodes="Yes" PreserveSequenceOrder="No" CopyPIs="No" method="xml" xmlVersion="1.0" IgnoreNamespacesForLinks="Yes">
<SrcTree>
<Reference Location="source.xsd" />
</SrcTree>
<TrgTree>
<Reference Location="destination.xsd" />
</TrgTree>
<ScriptTypePrecedence>
<CSharp Enabled="Yes" />
<ExternalAssembly Enabled="Yes" />
<VbNet Enabled="Yes" />
<JScript Enabled="Yes" />
<XsltCallTemplate Enabled="Yes" />
<Xslt Enabled="Yes" />
</ScriptTypePrecedence>
<TreeValues>
<TestValues />
<ConstantValues />
</TreeValues>
<Pages>
<Page Name="Page 1">
<Links>
<Link LinkID="1" LinkFrom="/*[local-name()='<Schema>']/*[local-name()='documents']/*[local-name()='document']/*[local-name()='filename']" LinkTo="/*[local-name()='<Schema>']/*[local-name()='documents']/*[local-name()='filename']" Label="" />
</Links>
<Functoids />
</Page>
</Pages>
https://stackoverflow.com/questions/2117176
复制相似问题