Given this sample xml, can anyone help me read the inputbuf?
<deadlock>
<process-list>
<process id="123" taskpriority="123">
<inputbuf> some random string like this </inputbuf>
</process>
</process-list>
</deadlock>
I know that I can read the id & taskpriority like this:
$event.Fields["xml_report"].Value.XML.SelectNodes('//deadlock/process-list/process').id
They both give me "123". But I want the value between the inputbuf tags, I want to read the " some random string like this ". Thanks for your help
I do not know how you parse the XML, but usually, there is property
InnerText
, which contains the text you want. For example, given that your XML is in string variable named$xml
, you can use: