首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >biztalk从无界with子元素映射到无界

biztalk从无界with子元素映射到无界
EN

Stack Overflow用户
提问于 2010-01-22 20:32:23
回答 1查看 1.2K关注 0票数 0

源XSD结构:

代码语言:javascript
复制
   documents (min occurs 1, max occurs 1)
      document (min occurs 1, max occurs unbounded)
         filename (min occurs 1, max occurs 1)

目标XSD结构:

代码语言:javascript
复制
documents (min occurs 1, max occurs 1)
      filename (min occurs 1, max occurs unbounded)

如何在BizTalk映射器中完成此操作?

(编辑):第一个提供的解决方案是我的第一个实现,但似乎BizTalk中的测试映射选项(在BizTalk映射.btm文件上单击鼠标右键)有时需要额外的编译(我只保存了映射,然后使用测试映射选项测试了映射)。现在它起作用了。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-01-22 20:49:35

在Biztalk 2009 (可能还有2006)中,只需连接"filename“节点即可。

源架构:

代码语言:javascript
复制
<?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>

目标架构:

代码语言:javascript
复制
<?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>

地图:

代码语言:javascript
复制
<?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()='&lt;Schema&gt;']/*[local-name()='documents']/*[local-name()='document']/*[local-name()='filename']" LinkTo="/*[local-name()='&lt;Schema&gt;']/*[local-name()='documents']/*[local-name()='filename']" Label="" />
    </Links>
    <Functoids />
  </Page>
</Pages>

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2117176

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档