Help in parsing xml from url or file
Hi,
I saw your XMLParser.suite in http://www.redstonesoftware.com/phpBB2/viewtopic.php?t=209&highlight=xml. In that suite, xml data is kept within the script and that is being parsed.
I want to parse the xml data from the url like, http://www.w3schools/xml/simple.xml or to load the xml file from my SUT (OS Windows 2003 server)
Can you provide script for implementing this within the same example suite which is provided. Thanks kindly
I saw your XMLParser.suite in http://www.redstonesoftware.com/phpBB2/viewtopic.php?t=209&highlight=xml. In that suite, xml data is kept within the script and that is being parsed.
I want to parse the xml data from the url like, http://www.w3schools/xml/simple.xml or to load the xml file from my SUT (OS Windows 2003 server)
Can you provide script for implementing this within the same example suite which is provided. Thanks kindly
Comments
To access XML from a file instead of a URL, replace the url expression in the top example with a file expression instead. That will work fine for a local file on the Eggplant machine. For a file on the SUT, the best (simplest) option is usually to mount the SUT's file system on the Mac through file sharing (SMB on Windows). Then you can treat the file just the same as if it were a local file.
If that's not possible, you'll have to do something a bit more challenging, like script Eggplant to open the file in a text editor on the SUT, copy the data to the clipboard, and use the remoteClipboard() function to access the text. There's usually a way to get what you need, but sometimes it's not obvious.