Extract value from xml file with symbol : and with space

Hi,
i desire to extract 1 value from a xml file format. In particular my case is:

<jwplayer:source file=“http://www.test.it/manifests/Y3jO4I3w.mp4”/>

I receive some error problem when i say that i want to extract from attribute “jwplayer:source file=”

What i need to do?
Thank you

Hi,

Could you give us a bigger example of the xml you’re trying to extract the data from? Also is this for Java or Web automation purposes or just for XML file extraction?

One way to find an xpath in ORQA in to use the UI Explorer - View → UI Explorer.

It will show the UI Explorer by default in the right bottom of the screen. There you’ll see a drop down with a selection of Java/Web/Windows and XML. Choose the appropriate one. Let’s assume you’re working with an XML file. Once you open the file, on the left hand side of the UI Explorer you will see a tree of the nodes, you can right-click on any of the them and click Copy Xpath, that will copy the unique xpath of the node into your clipboard for later use in the Get Element operations.

Hope that helps. Thanks

Hi Jan,
I desire to create a simple xml file extraction. I have seen the example inside the application. I have duplicated the folder and i have inserted my xml. Last step i have changing parameters according to my xml tag

here you can find my xml:

<rss xmlns:jwplayer="http://rss.jwpcdn.com/"> <channel> <title>Test_XML</title> <description/> <item> <title> <![CDATA[text]]> </title> <description> <![CDATA[text]]> </description> <guid>W7GMmNHJs</guid> <jwplayer:image>http://www.test.com/thumbs/1pxFnE10l.jpg</jwplayer:image> <jwplayer:source file="http://www.test.comm3u8"/> <jwplayer:source file="http://www.test.com/content/conversions/71vNMd4UF/videos/pxFnE10l-20982556.mp4"/> <jwplayer:track file="http://www.test.com/strips/pxFnE10l-120.vtt" kind="thumbnails"/> </item> <item> <title> <![CDATA[text]]> </title> <description> <![CDATA[Inntroduction]]> </description> <guid>pxFnE10la</guid> <jwplayer:image>http://www.test.com/thumbs/1pxFnE10l.jpg</jwplayer:image> <jwplayer:source file="http://www.test.com"/> <jwplayer:source file="http://www.test.com/content/conversions/71vNMd4UF/videos/pxFnE10l-20982556.mp4"/> <jwplayer:track file="http://www.test.com/strips/pxFnE10l-120.vtt" kind="thumbnails"/> </item> </channel> </rss>

I see the problem, you’ll need to define the namespace in order for it to work for this specific XML.

So the steps to make it work are in your task

  1. Read from XML operation - assign to variable myXML
  2. XML Namespace operation - use Prefix: Jwplayer; URI: http://rss.jwpcdn.com/
  3. Get XML Value operation - Node: =myXML; XPath: //item[1]/jwplayer:source[1]/@file; assign to variable myValue

When you create a task with these steps it will retrieve the value of the file attribute correctly. Hope that works for you.

Thanks

Jan

Hi Jan,
In my example i have try to set a function “Loop Throught Set” but i recevie an error.
In attachment i have insert a pic of my test configuration.

Hi, I can’t see the image unfortunately, can you send it in an email to me or upload somewhere else? Thanks!