LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XML Parser to get the value from a specific Tag name

Solved!
Go to solution

Hi All,

 

Can you please give some hints or an example how to resolve my problem?

I have a XML File and I need to extract the value from the Photo.

tody1993_0-1683790878528.png

 

How can I do it?

I have tried to use the XML vi's but I don't get what I want.

I don't have a code for that, but I  attached something with how I started.

 

Thank you.

Download All
0 Kudos
Message 1 of 3
(2,019 Views)
Solution
Accepted by tody1993

Hi!

 

A section as shown in your screenshot exists several times in your XML, so it is not completely clear which one you are looking for.

 

I'd, XPATH, which is a query language and allows to find nodes inside an XML tree.

In this case, //Prop[@Name='RS_payload string [Out]']/Value

searches recursively (//) for nodes <Prop>, which have an attibute Name='RS_payload string [Out]' and a child node <Value>.

A reference to the last node described by the  XPATH string, i.e. <Value>, is returned.

 

The following code finds all such nodes, which are 1015 in your case. Maybe, you have to be more specific to finds what you are looking for.

 

By the way:

My labview stumbled upon the first three lines, like <LVData> never being closed. I simply deleted this tree lines.

 

 

snip.png

Message 2 of 3
(1,988 Views)

Thats what I was looking for, and its ok if there are many iterations, I knew about that.

Thank you very much!

0 Kudos
Message 3 of 3
(1,979 Views)