0

我有一个 XML,我正在尝试将其导出为适用于我们系统的 xml。一切正常,除非一个节点不同并输出具有不同数据的同一节点的 2 个。

'<Policies>
    <Policy>
      <ServiceType>Mail</ServiceType>
      <Division>CommercialLines</Division>
      <InsuredName>Strongs</InsuredName>
      <InsuredDBA>
      </InsuredDBA>
      <InsuredAddress>219</InsuredAddress>
      <InsuredAddress2>
      </InsuredAddress2>
      <InsuredCity>Fond</InsuredCity>
      <InsuredState>IA</InsuredState>
      <InsuredZipCode>50000</InsuredZipCode>
      <InsuredPhone>000-900-6000</InsuredPhone>
      <EntityType>Corporation</EntityType>
      <FEIN>
      </FEIN>
      <DueDate>2020-04-16</DueDate>
      <Rush>0</Rush>
      <AgentAddress>110</AgentAddress>
      <AgentAddress2>
      </AgentAddress2>
      <AgentCity>FOND</AgentCity>
      <AgentState>IA</AgentState>
      <AgentZipCode>50000</AgentZipCode>
      <AgentName>JERRY</AgentName>
      <AgentTelephone>990-999-9999</AgentTelephone>
      **<AgentCode>50000</AgentCode>**
      <AuditContactName>Mark Stong</AuditContactName>
      <AuditContactAddress>219</AuditContactAddress>
      <AuditContactAddress2>
      </AuditContactAddress2>
      <AuditContactCity>Fond</AuditContactCity>
      <AuditContactState>WI</AuditContactState>
      <AuditContactZipCode>50000-0000</AuditContactZipCode>
      <AuditContactPhone>9009000000</AuditContactPhone>
      <AuditContactPhoneSecondary>
      </AuditContactPhoneSecondary>
      <AuditPrimaryEmail>
      </AuditPrimaryEmail>
      <AuditSecondaryEmail>
      </AuditSecondaryEmail>
      <Comments />
      <Notes />
      <CustomerNumber>9999980</CustomerNumber>
      <PolicyNumber>0202111</PolicyNumber>
      <PolicyVersion>25</PolicyVersion>
      <EffectiveDate>2019-03-02</EffectiveDate>
      <ExpirationDate>2020-03-02</ExpirationDate>
      <AuditIssueDate>02/16/2020 11:03:06</AuditIssueDate>
    </Policy>
    <Policy>
    <ServiceType>Mail</ServiceType>
      <Division>CommercialLines</Division>
      <InsuredName>Strongs</InsuredName>
      <InsuredDBA>
      </InsuredDBA>
      <InsuredAddress>219</InsuredAddress>
      <InsuredAddress2>
      </InsuredAddress2>
      <InsuredCity>Fond</InsuredCity>
      <InsuredState>IA</InsuredState>
      <InsuredZipCode>50000</InsuredZipCode>
      <InsuredPhone>000-900-6000</InsuredPhone>
      <EntityType>Corporation</EntityType>
      <FEIN>
      </FEIN>
      <DueDate>2020-04-16</DueDate>
      <Rush>0</Rush>
      <AgentAddress>110</AgentAddress>
      <AgentAddress2>
      </AgentAddress2>
      <AgentCity>FOND</AgentCity>
      <AgentState>IA</AgentState>
      <AgentZipCode>50000</AgentZipCode>
      <AgentName>JERRY</AgentName>
      <AgentTelephone>990-999-9999</AgentTelephone>
      **<AgentCode>50001</AgentCode>**
      <AuditContactName>Mark Stong</AuditContactName>
      <AuditContactAddress>219</AuditContactAddress>
      <AuditContactAddress2>
      </AuditContactAddress2>
      <AuditContactCity>Fond</AuditContactCity>
      <AuditContactState>WI</AuditContactState>
      <AuditContactZipCode>50000-0000</AuditContactZipCode>
      <AuditContactPhone>9009000000</AuditContactPhone>
      <AuditContactPhoneSecondary>
      </AuditContactPhoneSecondary>
      <AuditPrimaryEmail>
      </AuditPrimaryEmail>
      <AuditSecondaryEmail>
      </AuditSecondaryEmail>
      <Comments />
      <Notes />
      <CustomerNumber>9999980</CustomerNumber>
      <PolicyNumber>956285</PolicyNumber>
      <PolicyVersion>25</PolicyVersion>
      <EffectiveDate>2019-03-02</EffectiveDate>
      <ExpirationDate>2020-03-02</ExpirationDate>
      <AuditIssueDate>02/16/2020 11:03:06</AuditIssueDate>
  </Policy>
  </Policies>

<AgentCode>5000</AgentCode>
<AgentCode>50001</AgentCode>'

我使用 Distinct Values 仅保留每个节点的一个节点,但在此示例中,代理代码不同,因此 2 个节点会出现哪些错误。有没有一种方法,如果节点不相等,它可以选择一个最大数量的节点?

4

0 回答 0