我有以下格式的XML:
<policy_groups>
<policy_group>
<policygroup_name>Application Server with IIS</policygroup_name>
<policygroup_id>38</policygroup_id>
<policygroup_description />
<policygroup_creatorname>VMW2K3-SSI10-KF\VMW2K3-SSI10-KF\Administrator</policygroup_creatorname>
<policygroup_patchgroup>-1</policygroup_patchgroup>
<policygroup_signaturegroup>-1</policygroup_signaturegroup>
<policygroup_system>false</policygroup_system>
<policygroup_item>
<policygroupitem_id>83217</policygroupitem_id>
<policygroupitem_name>.NET Framework Support Service Status</policygroupitem_name>
<policygroupitem_type>0</policygroupitem_type>
<policygroupitem_policygroupid>38</policygroupitem_policygroupid>
<policygroupitem_productname>Windows Server 2003, Standard Edition</policygroupitem_productname>
<policygroupitem_spname>Gold</policygroupitem_spname>
<policygroupitem_checkshavlikid>207</policygroupitem_checkshavlikid>
<policygroupitem_value>Disabled-Not Found</policygroupitem_value>
<policygroupitem_operator>=</policygroupitem_operator>
<policygroupitem_displayvalue>Not Installed</policygroupitem_displayvalue>
</policygroup_item>
<policygroup_item>
<policygroupitem_id>85541</policygroupitem_id>
<policygroupitem_name>.NET Framework Support Service Status</policygroupitem_name>
<policygroupitem_type>0</policygroupitem_type>
<policygroupitem_policygroupid>38</policygroupitem_policygroupid>
<policygroupitem_productname>Windows Server 2003, Standard Edition</policygroupitem_productname>
<policygroupitem_spname>SP1</policygroupitem_spname>
<policygroupitem_checkshavlikid>207</policygroupitem_checkshavlikid>
<policygroupitem_value>Disabled-Not Found</policygroupitem_value>
<policygroupitem_operator>=</policygroupitem_operator>
<policygroupitem_displayvalue>Not Installed</policygroupitem_displayvalue>
</policygroup_item>
</policy_group>
</policy_groups>
除了XML文档中有数千个<policygroup_item>
之外。
我需要移除policygroup_item
和<policygroupitem_productname>
与以下任意组合不匹配的任何<policygroupitem_spname>
:
有没有办法用XSLT或PowerShell做到这一点?或者也许是VB脚本?
由于
布拉德