biglebowski
Technical User
I have an xml file which contains all the messages for a system monitor application. I've been asked to come with a way of automating a task to find out what files were deleted each day when a job runs. The status is held below in the xml file:
<Message id="8523" instanceId="2011/04/06-18:06:18.700_172.18.225.241_8523_Audio Watermark_E:\OspData\29-Dec-2010" status="Existing" severity="Informational" firstReceiveTime="2011-04-06T18:06:18.7005001+01:00">
<Text>Audio Watermark disk manager last deleted folder E:\OspData\29-Dec-2010</Text>
<Params>
<Param type="String">Audio Watermark</Param>
<Param type="String">E:\OspData\29-Dec-2010</Param>
</Params>
What I'd like to do is have a script that will search for a value and then send the text in the next matching value to a text file.
I want to use the value Message id="8523" as the search field and then send the data in the <Param type="String">E:\OspData\29-Dec-2010</Param> to a text file.
I have the following from searching other sites but it creates an error and I don't know how to extract the second param type string info:
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("C:\LastSystemStatus.xml")
Application = xmlDoc.GetElementsByTagName("Message id="8523"").item(0).text
wscript.echo application
Biglebowskis Razor - with all things being equal if you still can't find the answer have a shave and go down the pub.
<Message id="8523" instanceId="2011/04/06-18:06:18.700_172.18.225.241_8523_Audio Watermark_E:\OspData\29-Dec-2010" status="Existing" severity="Informational" firstReceiveTime="2011-04-06T18:06:18.7005001+01:00">
<Text>Audio Watermark disk manager last deleted folder E:\OspData\29-Dec-2010</Text>
<Params>
<Param type="String">Audio Watermark</Param>
<Param type="String">E:\OspData\29-Dec-2010</Param>
</Params>
What I'd like to do is have a script that will search for a value and then send the text in the next matching value to a text file.
I want to use the value Message id="8523" as the search field and then send the data in the <Param type="String">E:\OspData\29-Dec-2010</Param> to a text file.
I have the following from searching other sites but it creates an error and I don't know how to extract the second param type string info:
set xmlDoc=CreateObject("Microsoft.XMLDOM")
xmlDoc.async="false"
xmlDoc.load("C:\LastSystemStatus.xml")
Application = xmlDoc.GetElementsByTagName("Message id="8523"").item(0).text
wscript.echo application
Biglebowskis Razor - with all things being equal if you still can't find the answer have a shave and go down the pub.