LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Processing TestStand XML report with labview

Solved!
Go to solution

Hello community,

 

I need to write an application which takes certain data out of teststand generated XML report. I am new in processing XML files in labview and I'm wondering how should I do it. (Attached the first first couple lines of my report and the VI I wrote.)

 

 

My basic problem is like this: I know that the serial number is under /Reports/Report/Prop/Prop/[Value], but how should I address this particular element?

 

I would understand this if it would be like /Reports/Report/UUT/SerialNumber/[value], because then I could address it easily, but instead of this the /Reports/Report has gazillion children named "Prop", so I first need to find the Prop which has the name of "UUT" then its child which has the name of "SerialNumber" to get the value.

 

Not sure if my problem description makes sense, I'm certainly unsure about the terminology. I guess my main question is if there is an easy way to find things in a teststand XML (mostly measurement results)?

 

thanks.

 

 

 

xml.png

 

xml_read.png

 

0 Kudos
Message 1 of 7
(830 Views)

Hi 1984,

there is vi in xml pallet Get all Matched nodes.vi which might help you, & an example is available.

bharath_p
LV2011
0 Kudos
Message 2 of 7
(823 Views)

Your answer has nothing to do with my question. Please do not troll away this topic.

0 Kudos
Message 3 of 7
(815 Views)

hi,

sorry I wasn't trolling, I was talking about the following example, which lists the properties by passing query.

bharath_p
LV2011
0 Kudos
Message 4 of 7
(805 Views)

I'm aware of this example, but its not applicable for me as the example takes elements of an XML in which all the nodes have the same data structure.

0 Kudos
Message 5 of 7
(800 Views)
Solution
Accepted by topic author 1984

Alright...

 

So the nodes can be addressed like this:

 

/Reports/Report/Prop[@Name='UUT']/Prop[@Name='SerialNumber']/Value

 

and then using the "Get Node Text Content.VI" could read the value tag. Not sure if this is the best solution but certainly resolves the problem I have.

0 Kudos
Message 6 of 7
(796 Views)

and I wasn't trolling..

bharath_p
LV2011
0 Kudos
Message 7 of 7
(791 Views)