http://qs321.pair.com?node_id=964078

balajinagaraju has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks. I tried several ways to parse the below XML but was not successful in doing so, i am new to XML and perl and i am seeking an help here. My task is to parse the below xml structure.My script has to perform the below operations. 1)Goto Testcase1 and access the step1 and perform the command mentioned in step1 with the provided parameters.The command is defined in another perl file as a function module and it should be triggered with the specified parameters.My script should perform step2 based on the return value of command1 if its success it should execute command 2 else exit from the script and goto testcase2. I am absolutely clueless about the approach i should take , can anyone suggest how to solve this. A code snippet would be very helpful.

<testcase1> <step1 command ="Launchapp " param1 = "executablepath" param2 = "d +irpath"/> <step2 command = "Dothis"/> <step3 command = "Changemode" param1 = "100"/> <step4 command = "CaptureRectanlge" param1 = "3" param2 = "96" par +am3 = "726" param4 = "580"/> <step5 command = "CompareImage" image1 = "D:\\img1.jpg" image2 = " +D:\\img2.jpg "/> </testcase1> <testcase2> <step1 command ="Launchapp " param1 = "executablepath" param2 = "d +irpath"/> <step2 command = "Dothis"/> <step3 command = "Changemode" param1 = "100"/> <step4 command = "CaptureRectanlge" param1 = "3" param2 = "96" par +am3 = "726" param4 = "580"/> <step5 command = "CompareImage" image1 = "D:\\img1.jpg" image2 = " +D:\\img2.jpg "/> </testcase2>