01-19-2011 06:48 PM
Hello
The attached xml file contains data that I would like to extract. The data value has the tag (ubchild???/)name of "mean'. This can occur quite a number of times within the file for different child names. e.g.
<Key>SENS0710:10951:IntSolIrr</Key> has the value as
<Mean>742.320755</Mean>
and
<Key>SMBAU008:154000347:m_S0 kWh</Key> has the value as
<Mean>227.458679</Mean>
and so on....
The attached vi is very very simple and uses the JKI EasyXML vi to parse the file to a labview data type.
This is the point at which I need some guidance as to move forward. I have looked at using variant to data, clusters etc, but can't seem to get anything near working.
Would somebody be so kind as to give me some advice or tips as to extract these values to an array.
Thankl you
Regards
Ray
Solved! Go to Solution.
01-19-2011 11:24 PM - edited 01-19-2011 11:26 PM
01-20-2011 12:46 AM
Hello srikrishnaNF
Thank you
I had found the multiple node search vi at the same time as your post.
It was enough for me to get a simplified vi working, along with your png.
I have attached the vi for any other who may want to use it.
I will give you the kudos
Thanks again
Ray
01-26-2011 10:40 PM - edited 01-26-2011 10:40 PM
01-26-2011 11:09 PM
Thanks Jim
I did get a solution working, but your method is much more elegant and less code intensive, so If I may, I will use your method.
Best regards
Ray
01-26-2011 11:32 PM
Hey Ray,
Sure, feel free to use whatever example code I posted.
Yes, I think you'll find that the EasyXML approach is much simpler to set up and maintain. Personally, I find using the XML DOM API to be hard.
Cheers,
-Jim
01-26-2011 11:39 PM
Hello again Jim
One question please....the item with the pink string surround marked as WebBox. I've not seen this before. Could you explain it's use.
Regards
Ray
01-26-2011 11:48 PM
That is a cluster. A programmer defined datatype.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
01-27-2011 12:01 AM
That's a local variable of the WebBox cluster Indicator. It's used to get the datatype for EasyXML to use when parsing the XML data -- then, we convert the variant back into that same datatype. This is the one part of EasyXML that could be made easier someday (maybe by using the magic of XNodes)
01-27-2011 04:05 AM - edited 01-27-2011 04:05 AM
One question please....the item with the pink string surround marked as WebBox. I've not seen this before. Could you explain it's use.
You probably got confused by the different look of a local variable in LabVIEW 2010 in comparison to earlier versions. It's meant to be less diagram consuming and I think a good change, though it does require some getting used to.