parse xml
-
how to parse xml recusive based on directory and search criteria to get file name
<FileSystem>
<Drives>
<Drive name="C:">
<Folder name="data">
<Folder name="CSLogs">
<Folder name="Applications">
<Folder name="Citrix">
<Folder name="XenDesktop Installer">
<Folder name="MSI Log Files">
<File Name="BrokerAgent_x64311392187.txt" />
<File Name="CitrixCse_x641365171634.txt" />
<File Name="DirectorVDAplugin_x64276896625.txt" />
<File Name="IcaWS_x64397216209.txt" />
<File Name="MachineIdentityServiceAgent_x64492650649.txt" />
<File Name="MachineManagementProvider_x64407826716.txt" />
<File Name="personalvDisk_x64359317401.txt" />
<File Name="profilemgt_x641717284940.txt" />
<File Name="PzAppV_VDA_x641126819295.txt" />
<File Name="UpsClient_x641677360187.txt" />
<File Name="VdaMonitorPlugin_x64958367608.txt" />
<File Name="WMIProxy_x64801526517.txt" />
</Folder>
<File Name="XenDesktop Installation.log" />
</Folder>
<File Name="23157CIXXenDesktopVirtFx_Popup.log" />
<File Name="FixPolicyCorruption.ps1.log" />
</Folder> -
how to parse xml recusive based on directory and search criteria to get file name
<FileSystem>
<Drives>
<Drive name="C:">
<Folder name="data">
<Folder name="CSLogs">
<Folder name="Applications">
<Folder name="Citrix">
<Folder name="XenDesktop Installer">
<Folder name="MSI Log Files">
<File Name="BrokerAgent_x64311392187.txt" />
<File Name="CitrixCse_x641365171634.txt" />
<File Name="DirectorVDAplugin_x64276896625.txt" />
<File Name="IcaWS_x64397216209.txt" />
<File Name="MachineIdentityServiceAgent_x64492650649.txt" />
<File Name="MachineManagementProvider_x64407826716.txt" />
<File Name="personalvDisk_x64359317401.txt" />
<File Name="profilemgt_x641717284940.txt" />
<File Name="PzAppV_VDA_x641126819295.txt" />
<File Name="UpsClient_x641677360187.txt" />
<File Name="VdaMonitorPlugin_x64958367608.txt" />
<File Name="WMIProxy_x64801526517.txt" />
</Folder>
<File Name="XenDesktop Installation.log" />
</Folder>
<File Name="23157CIXXenDesktopVirtFx_Popup.log" />
<File Name="FixPolicyCorruption.ps1.log" />
</Folder>Please do not repost your question. You need will need to show code you have tried and where you are stuck. Also, why this muh of blank space? This is what may do: 1. Remove the other post with same question. 2. Update this post with formatted relevant code 3. Tell us where exactly are you stuck.
"You'd have to be a floating database guru clad in a white toga and ghandi level of sereneness to fix this goddamn clusterfuck.", BruceN[^]
-
how to parse xml recusive based on directory and search criteria to get file name
<FileSystem>
<Drives>
<Drive name="C:">
<Folder name="data">
<Folder name="CSLogs">
<Folder name="Applications">
<Folder name="Citrix">
<Folder name="XenDesktop Installer">
<Folder name="MSI Log Files">
<File Name="BrokerAgent_x64311392187.txt" />
<File Name="CitrixCse_x641365171634.txt" />
<File Name="DirectorVDAplugin_x64276896625.txt" />
<File Name="IcaWS_x64397216209.txt" />
<File Name="MachineIdentityServiceAgent_x64492650649.txt" />
<File Name="MachineManagementProvider_x64407826716.txt" />
<File Name="personalvDisk_x64359317401.txt" />
<File Name="profilemgt_x641717284940.txt" />
<File Name="PzAppV_VDA_x641126819295.txt" />
<File Name="UpsClient_x641677360187.txt" />
<File Name="VdaMonitorPlugin_x64958367608.txt" />
<File Name="WMIProxy_x64801526517.txt" />
</Folder>
<File Name="XenDesktop Installation.log" />
</Folder>
<File Name="23157CIXXenDesktopVirtFx_Popup.log" />
<File Name="FixPolicyCorruption.ps1.log" />
</Folder> -
how to parse xml recusive based on directory and search criteria to get file name
<FileSystem>
<Drives>
<Drive name="C:">
<Folder name="data">
<Folder name="CSLogs">
<Folder name="Applications">
<Folder name="Citrix">
<Folder name="XenDesktop Installer">
<Folder name="MSI Log Files">
<File Name="BrokerAgent_x64311392187.txt" />
<File Name="CitrixCse_x641365171634.txt" />
<File Name="DirectorVDAplugin_x64276896625.txt" />
<File Name="IcaWS_x64397216209.txt" />
<File Name="MachineIdentityServiceAgent_x64492650649.txt" />
<File Name="MachineManagementProvider_x64407826716.txt" />
<File Name="personalvDisk_x64359317401.txt" />
<File Name="profilemgt_x641717284940.txt" />
<File Name="PzAppV_VDA_x641126819295.txt" />
<File Name="UpsClient_x641677360187.txt" />
<File Name="VdaMonitorPlugin_x64958367608.txt" />
<File Name="WMIProxy_x64801526517.txt" />
</Folder>
<File Name="XenDesktop Installation.log" />
</Folder>
<File Name="23157CIXXenDesktopVirtFx_Popup.log" />
<File Name="FixPolicyCorruption.ps1.log" />
</Folder>To "get the FileName" by ... what ? Do you need to essentially de-serialize the entire XML stream into a usable object/Class structure ... that you could use do complex queries on ? Or, is your need more simple, for example: given a Directory string filepath return all the Files in that Directory as a string[] ?
«Tell me and I forget. Teach me and I remember. Involve me and I learn.» Benjamin Franklin