如何使用xls替换xml值从文件

时间:2017-09-24 05:42:41

标签: python xml shell xslt sed

我有一个xml文件,该文件在该文件的多个位置具有相同的标记。我想通过从文件中获取输入来更改包含。下面是我要更改的xml文件,通过从文件中获取输入,VL - / VL之间存在的值。输入文件按顺序包含值。可以连续改变价值吗? 我对xls很新,所以不要从哪里开始。任何输入都会对我有帮助。

<VL>
    <vl-id>VL</vl-id>
    <idx>1</idx>
    <type>flat</type>
    <link>true_c</link>
    <properties>
        <Ip>IPv4</Ip>
        <network-creation-type>existing_c</network-creation-type>
        <existing-segmentation-id>sgn-1234-abcd-efgh-5670</existing-segmentation-id>
        <existing-network-name>Ve_VNF_NET_ID</existing-network-name>
        <existing-network-id>ef923747-ea0a-4306-9063-b73237103349</existing-network-id>
        <existing-subnet-name>Ve_VNF_NET_ID_subnet</existing-subnet-name>
        <existing-physical-network>private_c</existing-physical-network>
        <existing-subnet-id>5a94bcbd-ae6c-4cca-8ea9-6d50d7be2f37</existing-subnet-id>
        <is-ip-migration-required>migration_not_required_c</is-ip-migration-required>
    </properties>
</VL>
<VL>
    <vl-id>VL</vl-id>
    <idx>1</idx>
    <type>flat</type>
    <link>true_c</link>
    <properties>
        <Ip>IPv4</Ip>
        <network-creation-type>existing_c</network-creation-type>
        <existing-segmentation-id>sgn-1234-abcd-efgh-5670</existing-segmentation-id>
        <existing-network-name>external_161</existing-network-name>
        <existing-network-id>2a05dc5e-d34c-4940-8fa2-6ba699e0e253</existing-network-id>
        <existing-subnet-name>external_161_subnet</existing-subnet-name>
        <existing-physical-network>private_c</existing-physical-network>
        <existing-subnet-id>bd4b7b3e-c878-417a-8d3c-8c7f367f9653</existing-subnet-id>
        <is-ip-migration-required>migration_required_c</is-ip-migration-required>
    </properties>
</VL>

0 个答案:

没有答案