一、xml是什么?

为什么需要xml文件?

现实生活中存在着大量的数据,在这些数据之间往往存在一定的关系,我们希望能在计算机中保存和处理这些数据的同时能够保存和处理他们之间的关系。XML就是为了解决这样的需求而产生的数据存储格式。

xml的用途归纳两个方面:

1). 传输数据:XML本质上是一段字符串,具有跨平台性的特性,因此XML常被用来在不同系统之间进行数据交换 。
2). 配置文件:XML可以在保存数据的同时保存数据之间的关系。利用这一特点,它还经常用作应用程序配置文件来使用。

xml的两种解析思路:

1). DOM解析 DOM(Document Object Model) 它是 W3C 组织推荐的处理 XML的一种方式。
处理思想:它会将整个XML使用类似树的结构保存在内存中,再对其进行操作,所以它需要等到XML完全加载进内存才可以进行操作。
缺点:它的缺点是耗费内存,当解析超大的XML时慎用。
优点:可以方便的对XML进行增删改查的操作。

2. SAX解析 ,不是官方标准,但它是 XML 社区事实上的标准,几乎所有的 XML解析器都支持它。

处理思想:这种解析方式会逐行地去扫描XML文档,当遇到标签时会触发解析处理器,采用事件处理的方式解析XML。
缺点:只能用来读取XML中数据,无法进行增删改。
优点:在读取文档的同时即可对XML进行处理,不必等到文档加载结束,相对快捷。不需要加载进内存,因此不存在占用内存的问题,可以解析超大XML。

以上内容转载于博客:

二、xml模块源码分析

python生成的xml无法换行 python xml文件_python生成的xml无法换行

三、代码示例

1.xml.dom.minidom

创建一个全新的xml文件,代码如下(示例):

#! -*- coding:utf-8 -*-

import os
from ProcessorFile import config
from xml.dom import minidom

input_path = config.input_path
output_path = config.output_path
create_xml_by_dom_out_path = os.path.join(output_path, 'create_xml_by_dom.xml')

dom = minidom.Document()
#创建project节点
project = dom.createElement('project')
dom.appendChild(project)
#创建 text节点
text = dom.createTextNode('this linux kernel-4.14 code')
project.appendChild(text)
#设置属性
project.setAttribute('url', 'vendor/kernel/linux-4.14')
project.setAttribute('remote', 'opensource')
project.setAttribute('name', 'vendor/kernel')
project.setAttribute('revision', 'master')
try:
    with open(create_xml_by_dom_out_path, 'w') as f:
        dom.writexml(f, indent='', newl='\n', addindent=' ', encoding='utf-8')
except Exception as e:
    print(e)

print("create xml successful!")

修改一个xml文件,代码如下(示例):

#! -*- coding:utf-8 -*-

import os, xml
from ProcessorFile import config
from xml.dom import minidom

input_path = config.input_path
output_path = config.output_path
actionList_xml_file_path = os.path.join(input_path, 'Rules.System.Wireless.xml')
actionList_xml_file_out_path = os.path.join(output_path, 'Rules.System.Wireless_out.xml')


xmlDOM = minidom.parse(actionList_xml_file_path)
root = xmlDOM.getElementsByTagName('Rules')
# create new Ele
new_ele = xmlDOM.createElement("newapplication")
# e.g.1: creat attr
new_ele_attr = xmlDOM.createAttribute('name')
new_ele_attr.value = 'cat310'
new_ele.setAttributeNode(new_ele_attr)
# e.g.2: creat attr
new_ele.setAttribute('like', '210290')
# create text
new_text = xmlDOM.createTextNode('this is my fist app')
new_ele.appendChild(new_text)

root[0].appendChild(new_ele)


string_ele = root[0].getElementsByTagName("String")
for st in  string_ele:
    #get text content
    content = st.firstChild.nodeValue
    #change content
    st.firstChild.nodeValue = "confidentiality"
    #get attribute
    attr_id = st.getAttribute('ID')
    #change attibute
    st.setAttribute("loc.comment", 'unknow')
    #print("%s:%s" %(attr_id, content))
    #hasattribute
    print(st.hasAttribute('loc.comment'))
    #remove attribute
    st.removeAttribute('ID')

group_ele = xmlDOM.getElementsByTagName('Group')
for group in group_ele:
    group_rule_ele = group.getElementsByTagName('Rule')
    for group_rule in group_rule_ele:
        group.removeChild(group_rule) #删除节点

try:
    with open(actionList_xml_file_out_path, 'w', encoding='utf-8') as f:
        xmlDOM.writexml(f,indent='',addindent=' ',newl='',encoding='UTF-8')
        #indent: 根节点缩进格式
        #addindent:子节点缩进格式
        #newl: 换行格式
        #encoding: xml的编码
        print("change xml OK!")
except Exception as e:
    print(e)

2.xml.sax

代码如下(示例):

#! -*- coding:utf-8 -*-
import os
from ProcessorFile import config
from xml import sax
from xml.sax.handler import ContentHandler

input_path = config.input_path
output_path = config.output_path
actionList_file_path = os.path.join(input_path, 'ActionList.xml')

#SAX 就是处理xml文件中的数据而实现的模块,本身不对xml格式文件进行处理
# 实现ContentHandler,实现获取哪些数据、怎么样处理获取的数据等逻辑
class SystemRuleHandler(sax.handler.ContentHandler):
    def __init__(self):
        self.currentData = ''
        self.payload = ''

    def startElement(self, name, attrs):
        self.currentData = name
        self.currentAttr = attrs
        if name == 'Package':
            print("start parse element")
            id = attrs['Id']
            payloadType = attrs['PayloadType']
            featureId = attrs['FeatureId']
            print('INFO:%s|%s|%s' %(id, payloadType, featureId))

    def endElement(self, name):
        if self.currentData == 'Payload':
            print('Payload:%s' % self.payload)
        self.currentData = ''

    def characters(self, content):
       if self.currentData == 'Payload':
            self.currentData = content
        
class SystemRuleerrorHandler(sax.handler.ErrorHandler):
    pass
    
#实现方式参见 sax.parse方法
# def parse(source, handler, errorHandler=ErrorHandler())
#     parser = make_parser()
#     parser.setContentHandler(handler)
#     parser.setErrorHandler(errorHandler)
#     parser.parse(source)

parser = sax.make_parser() #创建解析器
handler = SystemRuleHandler() #事件处理器
parser.setContentHandler(handler)
error = SystemRuleerrorHandler() #错误处理逻辑
parser.setErrorHandler(error)
parser.parse(actionList_file_path)

总结

xml模块掌握两种思想,一种是DOM,一种是SAX。DOM可对xml格式文件本身进行改造,而SAX只能读取xml文件内容(数据存储)。对于简单的、小型的xml,使用DOM方便快捷;对于大型xml文件,需要使用SAX进行处理(目前工作中比较少见,没怎么遇到)。


附件

Rules.System.Wireless.xml windows系统文件:

<?xml version="1.0"?>

<!--***************************************************************************

  Copyright (c) Microsoft Corporation. All rights reserved.

****************************************************************************-->

<Rules>

<StringTable>
  <String ID="GroupWirelessNetwork" loc.comment="Wireless Network Repro The Problem Rule Group">Wireless Network Troubleshooter</String>
  <String ID="RuleInsertWirelessNetworkTables" loc.comment="Rule to insert Wireless Network Repro The Problem tables.">Insert Wireless Network Troubleshooting Tables</String>
  <String ID="RuleCreateRegistryWirelessAdapterTable" loc.comment="Rule to create table of adapter information from the registry information">Create Registry Wireless Adapter Table</String>
  <String ID="RuleCreateWirelessConnectionAttemptTable" loc.comment="Rule to create table of wireless network connection attempts">Create Wireless Network Connection Attempts Table</String>

  <Rule name="$(RuleWirelessServiceCheck)" enabled="true">
    <Step select="/Report/Section[@name='advice']/Table[@name='alltests']" fatal="true">
      <Exists>
        <Otherwise>
          <Variable name="group">$(LOC_TableNetworkWirelessSummary)</Variable>
        </Otherwise>
      </Exists>
    </Step>
    <Step select="/Report/Section[@name='advice']/Table[@name='alltests']/Item[Data[@name='alltestgroups'] = '{group}']" fatal="true">
      <Variable name="summarycnt" expression="count(Item)" />
      <When expression="{summarycnt} = 0">
        <Delete select="." />
      </When>
    </Step>
  </Rule>
</Rules>

ActionList.xml windwos系统文件

<?xml version='1.0' encoding='utf-8'?>
<ActionList xmlns="urn:schemas-microsoft-com:os-update-actionlist" SessionId="2019-03-19T11:44:20" Revision="1" SessionData="Enumerate_OnDemand" BuildInfo="19h1_release.18362.1.190318-1202" CorrelationVector="+XPRo2DSsk6S7T9o.2" Operation="Enumerate_OnDemand">
    <Downloads>
        <Package Id="amd64_FoDMetadata_Client" Reason="OnDemand" PayloadType="Canonical" FeatureId="FoDMetadata_Client">
            <Payload Hash="aocvJCLRs43mW0bz9hg/TLnTUCrsqzsApJ2uJdQy37g=" DownloadSize="346753" SourceName="FoDMetadata_Client.cab" SourcePath="UUP\DESKTOP\FoDMetadata"/>
        </Package>
    </Downloads>
    <Plan>
    </Plan>
    <Actions>
        <OfferPackage Id="Accessibility.Braille~~1.0" FilePath="metadata\Accessibility.Braille~~1.0.mum" CabFileName="Microsoft-Windows-Accessibility-Braille-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="4096347" Reason="Enumerate"/>
      
        <OfferPackage Id="Language.TextToSpeech~nb-no~1.0" FilePath="metadata\Language.TextToSpeech~nb-no~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-nb-no-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="6312232" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~nl-be~1.0" FilePath="metadata\Language.TextToSpeech~nl-be~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-nl-be-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="9318753" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~nl-nl~1.0" FilePath="metadata\Language.TextToSpeech~nl-nl~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-nl-nl-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="9555766" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~pl-pl~1.0" FilePath="metadata\Language.TextToSpeech~pl-pl~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-pl-pl-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="11217581" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~pt-br~1.0" FilePath="metadata\Language.TextToSpeech~pt-br~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-pt-br-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="32392960" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~pt-pt~1.0" FilePath="metadata\Language.TextToSpeech~pt-pt~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-pt-pt-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="7291330" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~ro-ro~1.0" FilePath="metadata\Language.TextToSpeech~ro-ro~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-ro-ro-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="2887159" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~ru-ru~1.0" FilePath="metadata\Language.TextToSpeech~ru-ru~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-ru-ru-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="12752197" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~sk-sk~1.0" FilePath="metadata\Language.TextToSpeech~sk-sk~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-sk-sk-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="7132836" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~sl-si~1.0" FilePath="metadata\Language.TextToSpeech~sl-si~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-sl-si-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="6103536" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~sv-se~1.0" FilePath="metadata\Language.TextToSpeech~sv-se~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-sv-se-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="8583587" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~ta-in~1.0" FilePath="metadata\Language.TextToSpeech~ta-in~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-ta-in-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="9791140" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~th-th~1.0" FilePath="metadata\Language.TextToSpeech~th-th~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-th-th-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="5169904" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~tr-tr~1.0" FilePath="metadata\Language.TextToSpeech~tr-tr~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-tr-tr-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="6491204" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~vi-vn~1.0" FilePath="metadata\Language.TextToSpeech~vi-vn~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-vi-vn-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="3665709" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~zh-cn~1.0" FilePath="metadata\Language.TextToSpeech~zh-cn~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-zh-cn-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="58452281" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~zh-hk~1.0" FilePath="metadata\Language.TextToSpeech~zh-hk~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-zh-hk-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="14729091" Reason="Enumerate"/>
        <OfferPackage Id="Language.TextToSpeech~zh-tw~1.0" FilePath="metadata\Language.TextToSpeech~zh-tw~1.0.mum" CabFileName="Microsoft-Windows-LanguageFeatures-TextToSpeech-zh-tw-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="20470872" Reason="Enumerate"/>
        <OfferPackage Id="MathRecognizer~~1.0" FilePath="metadata\MathRecognizer~~1.0.mum" CabFileName="Microsoft-Windows-TabletPCMath-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="6556549" Reason="Enumerate"/>
        <OfferPackage Id="Media.MediaFeaturePack~~1.0" FilePath="metadata\Media.MediaFeaturePack~~1.0.mum" CabFileName="Microsoft-Windows-Media-Features-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="70880059" Reason="Enumerate"/>
        <OfferPackage Id="Media.WindowsMediaPlayer~~12.0" FilePath="metadata\Media.WindowsMediaPlayer~~12.0.mum" CabFileName="Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="17394985" Reason="Enumerate"/>
        <OfferPackage Id="Microsoft.AdminTools~~1.0" FilePath="metadata\Microsoft.AdminTools~~1.0.mum" CabFileName="Microsoft-Windows-AdminTools-FOD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="22063837" Reason="Enumerate"/>
        <OfferPackage Id="Microsoft.Onecore.StorageManagement~~1.0" FilePath="metadata\Microsoft.Onecore.StorageManagement~~1.0.mum" CabFileName="Microsoft-OneCore-StorageManagement-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="3175903" Reason="Enumerate"/>
        <OfferPackage Id="Microsoft.WebDriver~~1.0" FilePath="metadata\Microsoft.WebDriver~~1.0.mum" CabFileName="Microsoft-WebDriver-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="329092" Reason="Enumerate"/>
        <OfferPackage Id="Microsoft.Windows.StorageManagement~~1.0" FilePath="metadata\Microsoft.Windows.StorageManagement~~1.0.mum" CabFileName="Microsoft-Windows-StorageManagement-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="5271676" Reason="Enumerate"/>
        <OfferPackage Id="Msix.PackagingTool.Driver~~1.0" FilePath="metadata\Msix.PackagingTool.Driver~~1.0.mum" CabFileName="Msix-PackagingTool-Driver-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="32205" Reason="Enumerate"/>
        <OfferPackage Id="NetFX3~" FilePath="metadata\NetFX3~.mum" CabFileName="Microsoft-Windows-NetFx3-OnDemand-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="72702771" Reason="Enumerate"/>
        <OfferPackage Id="Network.Irda~~1.0" FilePath="metadata\Network.Irda~~1.0.mum" CabFileName="Microsoft-Windows-IRDA-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="604101" Reason="Enumerate"/>
        <OfferPackage Id="OneCoreUAP.OneSync~~1.0" FilePath="metadata\OneCoreUAP.OneSync~~1.0.mum" CabFileName="Microsoft-OneCore-ApplicationModel-Sync-Desktop-FOD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="3364081" Reason="Enumerate"/>
        <OfferPackage Id="OpenSSH.Client~~1.0" FilePath="metadata\OpenSSH.Client~~1.0.mum" CabFileName="OpenSSH-Client-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="1316207" Reason="Enumerate"/>
        <OfferPackage Id="OpenSSH.Server~~1.0" FilePath="metadata\OpenSSH.Server~~1.0.mum" CabFileName="OpenSSH-Server-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="1291185" Reason="Enumerate"/>
        <OfferPackage Id="Print.EnterpriseCloudPrint~~1.0" FilePath="metadata\Print.EnterpriseCloudPrint~~1.0.mum" CabFileName="Microsoft-Windows-Printing-EnterpriseCloudPrint-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="1078076" Reason="Enumerate"/>
        <OfferPackage Id="Print.MopriaCloudService~~1.0" FilePath="metadata\Print.MopriaCloudService~~1.0.mum" CabFileName="Microsoft-Windows-Printing-MopriaCloudService-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="3354608" Reason="Enumerate"/>
        <OfferPackage Id="RasCMAK.Client~~1.0" FilePath="metadata\RasCMAK.Client~~1.0.mum" CabFileName="Microsoft-Windows-RasCMAK-Client-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="493840" Reason="Enumerate"/>
        <OfferPackage Id="RIP.Listener~~1.0" FilePath="metadata\RIP.Listener~~1.0.mum" CabFileName="Microsoft-Windows-RasRip-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="37827" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.ActiveDirectory.DS-LDS.Tools~~1.0" FilePath="metadata\Rsat.ActiveDirectory.DS-LDS.Tools~~1.0.mum" CabFileName="Microsoft-Windows-ActiveDirectory-DS-LDS-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="5230239" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.BitLocker.Recovery.Tools~~1.0" FilePath="metadata\Rsat.BitLocker.Recovery.Tools~~1.0.mum" CabFileName="Microsoft-Windows-BitLocker-Recovery-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="42179" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.CertificateServices.Tools~~1.0" FilePath="metadata\Rsat.CertificateServices.Tools~~1.0.mum" CabFileName="Microsoft-Windows-CertificateServices-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="1564108" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.DHCP.Tools~~1.0" FilePath="metadata\Rsat.DHCP.Tools~~1.0.mum" CabFileName="Microsoft-Windows-DHCP-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="1649868" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.Dns.Tools~~1.0" FilePath="metadata\Rsat.Dns.Tools~~1.0.mum" CabFileName="Microsoft-Windows-DNS-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="1339472" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.FailoverCluster.Management.Tools~~1.0" FilePath="metadata\Rsat.FailoverCluster.Management.Tools~~1.0.mum" CabFileName="Microsoft-Windows-FailoverCluster-Management-Tools-FOD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="9839817" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.FileServices.Tools~~1.0" FilePath="metadata\Rsat.FileServices.Tools~~1.0.mum" CabFileName="Microsoft-Windows-FileServices-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="5322452" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.GroupPolicy.Management.Tools~~1.0" FilePath="metadata\Rsat.GroupPolicy.Management.Tools~~1.0.mum" CabFileName="Microsoft-Windows-GroupPolicy-Management-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="4265567" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.IPAM.Client.Tools~~1.0" FilePath="metadata\Rsat.IPAM.Client.Tools~~1.0.mum" CabFileName="Microsoft-Windows-IPAM-Client-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="231257" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.LLDP.Tools~~1.0" FilePath="metadata\Rsat.LLDP.Tools~~1.0.mum" CabFileName="Microsoft-Windows-LLDP-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="23027" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.NetworkController.Tools~~1.0" FilePath="metadata\Rsat.NetworkController.Tools~~1.0.mum" CabFileName="Microsoft-Windows-NetworkController-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="167320" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.NetworkLoadBalancing.Tools~~1.0" FilePath="metadata\Rsat.NetworkLoadBalancing.Tools~~1.0.mum" CabFileName="Microsoft-Windows-NetworkLoadBalancing-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="273601" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.RemoteAccess.Management.Tools~~1.0" FilePath="metadata\Rsat.RemoteAccess.Management.Tools~~1.0.mum" CabFileName="Microsoft-Windows-RemoteAccess-Management-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="7035095" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.RemoteDesktop.Services.Tools~~1.0" FilePath="metadata\Rsat.RemoteDesktop.Services.Tools~~1.0.mum" CabFileName="Microsoft-Windows-RemoteDesktop-Services-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="970410" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.ServerManager.Tools~~1.0" FilePath="metadata\Rsat.ServerManager.Tools~~1.0.mum" CabFileName="Microsoft-Windows-ServerManager-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="6664223" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.Shielded.VM.Tools~~1.0" FilePath="metadata\Rsat.Shielded.VM.Tools~~1.0.mum" CabFileName="Microsoft-Windows-Shielded-VM-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="18204190" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.StorageMigrationService.Management.Tools~~1.0" FilePath="metadata\Rsat.StorageMigrationService.Management.Tools~~1.0.mum" CabFileName="Microsoft-Windows-StorageMigrationService-Management-Tools-FOD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="119162" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.StorageReplica.Tools~~1.0" FilePath="metadata\Rsat.StorageReplica.Tools~~1.0.mum" CabFileName="Microsoft-Windows-StorageReplica-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="461257" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.SystemInsights.Management.Tools~~1.0" FilePath="metadata\Rsat.SystemInsights.Management.Tools~~1.0.mum" CabFileName="Microsoft-Windows-SystemInsights-Management-Tools-FOD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="56489" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.VolumeActivation.Tools~~1.0" FilePath="metadata\Rsat.VolumeActivation.Tools~~1.0.mum" CabFileName="Microsoft-Windows-VolumeActivation-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="216775" Reason="Enumerate"/>
        <OfferPackage Id="Rsat.WSUS.Tools~~1.0" FilePath="metadata\Rsat.WSUS.Tools~~1.0.mum" CabFileName="Microsoft-Windows-WSUS-Tools-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="1680250" Reason="Enumerate"/>
        <OfferPackage Id="ServerCore.AppCompatibility~~1.0" FilePath="metadata\ServerCore.AppCompatibility~~1.0.mum" CabFileName="Microsoft-Windows-Server-AppCompat-FoD-Package~31bf3856ad364e35~amd64~~.cab" DownloadSize="244393279" Reason="Enumerate"/>
        </Actions>
     </ActionList >