【问题标题】:How to change an xml value when attributes keys are same当属性键相同时如何更改xml值
【发布时间】:2022-06-10 18:04:40
【问题描述】:

我的xml示例如下。

<?xml version="1.0" encoding="utf-8"?>
<settingsConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="SettingsConfig.xsd">
  <!-- config sources -->
  <categories>
    <!-- general config -->
    <category name="general" source="xml">
      <settings>
        <setting name="SwVersion" type="System.String" encrypted="false" readonly="true" scope="application"
          description="The version number will be shown in splash screen\ settings">5.0</setting>
        <setting name="BuildVersion" type="System.String" encrypted="false" readonly="true" scope="application"
          description="This version number is the device software build version">5.1.0.snapshot</setting>
    </settings>
</category>
</categories>
</settingsConfiguration>

我需要更改的值

<setting name="BuildVersion" type="System.String" encrypted="false" readonly="true" scope="application"
          description="This version number is the device software build version">5.1.0.snapshot</setting>

使用 Windows 批处理脚本或 Powershell 从 5.1.0.snapshot 到 6.x.x。

任何帮助将不胜感激。

【问题讨论】:

  • 向我们展示您的尝试,以便我们帮助您编写代码。

标签: xml powershell xml-parsing


猜你喜欢
  • 1970-01-01
  • 2018-12-23
  • 1970-01-01
  • 1970-01-01
  • 2010-09-26
  • 1970-01-01
  • 1970-01-01
  • 2021-12-24
  • 1970-01-01
相关资源
最近更新 更多