我有以下xml:
usa11.xml:
<?xml version="1.0" encoding="UTF-8"?>
<country xmlns="http://www.tibco.com/xmlns/ApplicationManagement" >
<state name="CA">
<city>
<street>El Comino Ave.</street>
<library>library 11111.</library>
</city>
<city>
<street>DeAnza Ave.</street>
<library>library 22222.</library>
</city>
<city>
<street>shoreline Ave.</street>
<library>library 33333.</library>
</city>
</state>
</country>
和另一个xml:usa22.xml:
<?xml version="1.0" encoding="UTF-8"?>
<country xmlns="http://www.tibco.com/xmlns/ApplicationManagement" >
<state name="CA">
<city>
<street>El Comino Ave.</street>
<library>library AAAAA.</library>
</city>
<city>
<street>DeAnza Ave.</street>
<library>library BBBBB.</library>
</city>
</state>
</country>
然后我希望使用 Tibco BW 映射器来使用 usa22.xml 的元素值来替换 usa11.xml 的元素,前提是它们的街道名称相同:然后得到输出 usa33.xml,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<country xmlns="http://www.tibco.com/xmlns/ApplicationManagement">
<state name="CA">
<city>
<street>El Comino Ave.</street>
<library>library AAAAA.</library>
</city>
<city>
<street>DeAnza Ave.</street>
<library>library BBBBB.</library>
</city>
<city>
<street>shoreline Ave.</street>
<library>library 33333.</library>
</city>
</state>
</country>
请抛出一些亮点如何使用 Tibco BW 映射器进行此值替换?
架构如下:
美国.xsd:
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.tibco.com/xmlns/ApplicationManagement" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="country">
<xs:complexType>
<xs:sequence>
<xs:element name="state">
<xs:complexType>
<xs:sequence>
<xs:element name="city" maxOccurs="unbounded" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="street"/>
<xs:element type="xs:string" name="library"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute type="xs:string" name="name"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
非常感谢!!!