use 5.010; use XML::LibXML; my $xml = XML::LibXML->load_xml(IO => \*DATA); foreach my $workflow ($xml->findnodes('//workflow')) { say $workflow->{name}; my ($testcases) = $workflow->findnodes('./testcases'); for (qw/ total passed failed skipped blocked /) { say "\t$_: $testcases->{$_}"; } } __DATA__ <workflows> <workflow name="Generic Audio Driver Tests" id="8ff67565-7954-4a6c +-84b4-6404af4a6357" owneralias="louiscl" featurepath="$\UX Platform\A +udio\Driver" jobid="60112"> <result starttime="9/5/2012 7:43:37 PM" executiontime="00:09:2 +9.0354215" executionoutcome="Succeeded" testoutcome="Passed" /> <testcases total="609" passed="609" failed="0" skipped="0" blo +cked="0" /> <tasks> <task name="Deploy Packages" id="975e822e-c4de-4cfd-9748-7 +d08ff5cfee0"> <result starttime="9/5/2012 7:43:37 PM" executiontime= +"00:00:23.3509657" executionoutcome="Succeeded" /> <outputdirectory> <localpath>C:\Users\hivinod\TShell\Results\Submiss +ion\0905-194337\8ff67565\975e822e\1</localpath> <remotepath>\\BDCLAB-WM7-10\C$\Users\hivinod\TShel +l\Results\Submission\0905-194337\8ff67565\975e822e\1</remotepath> </outputdirectory> <outputs> <output filename="Microsoft.Phone.Test.UXPlatform. +AVCore.AudioCore.Driver_DeployTest.log" fullpath="\\BDCLAB-WM7-10\C$\ +Users\hivinod\TShell\Results\Submission\0905-194337\8ff67565\975e822e +\1\Microsoft.Phone.Test.UXPlatform.AVCore.AudioCore.Driver_DeployTest +.log" /> </outputs> </task> <task name="Execute Test Harness" id="9a1f022d-dd77-48f8-b +3a3-60d0c70e1594"> <commandline>TestLauncher -b te.exe -w "C:\data\test\r +esult" -la -a \Data\Test\bin\gaudit_mc.dll /select:"not((@Name='*KS +PROPERTY_PIN_NAME*')or(@Name='*INVALIDVALUE_AUDIO_MUX_SOURCE')or(@Nam +e='*2_CONNECTION_DATAFORMAT')or(@Name='*3_CONNECTION_DATAFORMAT')or(@ +Name='*CHANNELULONG*VOLUMELEVEL'))" /enablewttlogging /outputFolder:\ +Data\Test\Result /logfile:results.wtl</commandline> <workingdir>\Data</workingdir> <result starttime="9/5/2012 7:44:00 PM" executiontime= +"00:09:05.5944478" executionoutcome="Succeeded" testoutcome="Passed" +/> <testcases total="609" passed="609" failed="0" skipped +="0" blocked="0" /> <outputdirectory> <localpath>C:\Users\hivinod\TShell\Results\Submiss +ion\0905-194337\8ff67565\9a1f022d\1</localpath> <remotepath>\\BDCLAB-WM7-10\C$\Users\hivinod\TShel +l\Results\Submission\0905-194337\8ff67565\9a1f022d\1</remotepath> </outputdirectory> <outputs> <output filename="results.wtl" fullpath="\\BDCLAB- +WM7-10\C$\Users\hivinod\TShell\Results\Submission\0905-194337\8ff6756 +5\9a1f022d\1\results.wtl" /> </outputs> <analyses /> </task> <task name="Cleanup Dependencies" id="23e9c221-d748-49c3-9 +ee3-c6c3a31394b6"> <result starttime="9/5/2012 7:53:06 PM" executiontime= +"00:00:00" executionoutcome="Succeeded" /> </task> </tasks> </workflow> </workflows>
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

In reply to Re: XML Parsing by tobyink
in thread XML Parsing by gvinu4u

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.