如果元素值与“ABB Automation Builder Platform.abpkg”匹配,我正在尝试设置元素的值
我的脚本使用 xmlpoke 如下:
<XmlPoke
Namespaces="<Namespace Prefix='x' Uri='http://www150.abb.com/spaces/DAE-1/ProdDev/Shared%20Documents/40%20DAE%20Installer/Design/XML%20Descriptions/DAEInstaller_Description_StyleSheet' >"
Query="x:ProductUpdate/x:Packages/x:Package[x:FileName='ABB Automation Builder Platform.abpkg']/x:FileHash"
XmlInputPath="Output\update.manifest"
Value="Ajay Vishwakarma"/>
我要修改的xml如下:
<?xml version="1.0" encoding="utf-8"?>
<ProductUpdate xmlns="http://www150.abb.com/spaces/DAE-1/ProdDev/Shared%20Documents/40%20DAE%20Installer/Design/XML%20Descriptions/DAEInstaller_Description_StyleSheet">
<Strings>
<Text id="1">
<Neutral>ABB Automation Builder 1.0 \nService Release 1</Neutral>
<Localized culture="en">ABB Automation Builder 1.0 \nService Release 1</Localized>
<Localized culture="de">ABB Automation Builder 1.0 \nService Release 1</Localized>
<Localized culture="fr">ABB Automation Builder 1.0 \nService Release 1</Localized>
<Localized culture="es">ABB Automation Builder 1.0 \nService Release 1</Localized>
<Localized culture="zh">ABB Automation Builder 1.0 \nService Release 1</Localized>
</Text>
<Text id="2">
<Neutral>Information\ABB Automation Builder Upate Package V1_0_1Description_en.htm</Neutral>
<Localized culture="en">Information\ABB Automation Builder Upate Package V1_0_1Description_en.htm</Localized>
<Localized culture="de">Information\ABB Automation Builder Upate Package V1_0_1Description_de.htm</Localized>
<Localized culture="fr">Information\ABB Automation Builder Upate Package V1_0_1Description_fr.htm</Localized>
<Localized culture="es">Information\ABB Automation Builder Upate Package V1_0_1Description_es.htm</Localized>
<Localized culture="zh">Information\ABB Automation Builder Upate Package V1_0_1Description_zh.htm</Localized>
</Text>
</Strings>
<ReleaseType>ServicePack</ReleaseType>
<ProductName>$1</ProductName>
<Version>1.0.1</Version>
<Description>$2</Description>
<License>
<Name>$3</Name>
<ID>45668677876463</ID>
<Description>$4</Description>
<Version>1.0.1</Version>
<DescriptionVersion>$5</DescriptionVersion>
<DescriptionTypeVersion>1.0.0</DescriptionTypeVersion>
<ToAccept>true</ToAccept>
</License>
<Copyright>$6</Copyright>
<MinimumRequiredVersion>1.0.0</MinimumRequiredVersion>
<Packages>
<Package>
<Name>ABB Automation Builder Platform Update Package</Name>
<Description>ABB Automation Builder Platform Update Package</Description>
<FileName>ABB Automation Builder Platform.abpkg</FileName>
<FileHash>AjayVishwakarma</FileHash>
<FileDownload>
</FileDownload>
<InstallerData>
<Component>
<Name>ABB Automation Builder Package Manager</Name>
<ID>{F5B05B3F-9FA5-476E-BDD3-DB1397CABF4C}</ID>
<Version>1.0.1.0</Version>
<InstallAlways>true</InstallAlways>
</Component>
</InstallerData>
</Package>
<Package>
<Name>PLC AC500 Update Package</Name>
<Description>PLC AC500 Update Package</Description>
<FileName>PLC - AC500.abpkg</FileName>
<FileHash>8652d588d4c1fe70e0e06a9cf3e09193</FileHash>
<FileDownload>
</FileDownload>
<InstallerData>
<Component>
<Name>Codesys</Name>
<ID>{F8A33E2A-5B6A-474B-8ED2-293B4982D4E6}</ID>
<Version>2.3.9.41</Version>
</Component>
<Component>
<Name>Target Support Package</Name>
<ID>{CC764263-BEF5-4060-AA49-0366AB2E868B}</ID>
<Version>1.0.1.0</Version>
</Component>
<Component>
<Name>Control Builder Plus documentation</Name>
<ID>{484D63DB-1EB6-4F4F-851F-7F7D7D34A396}</ID>
<Version>1.0.1.0</Version>
</Component>
</InstallerData>
</Package>
</Packages>
</ProductUpdate>
XmlPoke 任务无法更新元素值并给出消息“进行 0 次替换”。我也尝试过像
Query="//x:ProductUpdate/x:Packages/x:Package[x:FileName='ABB Automation Builder Platform.abpkg']/x:FileHash" OR Query=".//x:ProductUpdate/Packages/Package[ FileName='ABB Automation Builder Platform.abpkg']/FileHash"
我想知道我是否做错了?请注意,我不想对我的 xml 文档中的命名空间进行任何更改。