希望合并以下 XML。我想在 Python 中做到这一点,尽管它无论如何都不是必需的。
文件 1:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Class 1</members>
<members>Class 2</members>
<name>ApexClass</name>
</types>
<types>
<members>Trigger 1</members>
<name>ApexTrigger</name>
</types>
<types>
<members>Rule 1</members>
<members>Rule 2</members>
<name>WorkflowRule</name>
</types>
<types>
<members>Address</members>
<name>CustomField</name>
</types>
<version>39.0</version>
</Package>
文件2:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Class 3</members>
<name>ApexClass</name>
</types>
<types>
<members>Rule 2</members>
<name>WorkflowRule</name>
</types>
<types>
<members>Phone</members>
<name>CustomField</name>
</types>
<version>41.0</version>
</Package>
合并文件 1和文件 2以创建下面的文件 3:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Class 1</members>
<members>Class 2</members>
<members>Class 3</members>
<name>ApexClass</name>
</types>
<types>
<members>Trigger 1</members>
<name>ApexTrigger</name>
</types>
<types>
<members>Rule 1</members>
<members>Rule 2</members>
<name>WorkflowRule</name>
</types>
<types>
<members>Address</members>
<members>Phone</members>
<name>CustomField</name>
</types>
<version>41.0</version>
</Package>
请注意,标识节点可以是 50 多个不同值之一。
相关分类