LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read attributes from XML

Hi Anil,

 

Using //*@  gave me all the nodes/attributes from the XML.

So I wasn't looking for matching.

I then parsed out the text to get my data.

 

Thanks

Akbar

Message 11 of 18
(2,443 Views)

@anilkumarmuppirala18 wrote:

Could you please explain why you gave //*@ as the string constant to get all matched nodes

thanks in advance 

Anil


I'm no expert, but I think that's just standard XPATH stuff.  https://www.w3schools.com/xml/xpath_intro.asp.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 12 of 18
(2,433 Views)

Thanks akbar ,

but is there a way to get specific attributes because i tried using element name and its not working its not even giving me error

0 Kudos
Message 13 of 18
(2,427 Views)

Hi Anil,

 

I understand your frustration with XML. I feel this is very peculiar with LabVIEW. If you have a XML file  (not created by LabVIEW) then you always have issues getting a particular attribute. It works sometime seamlessly and sometimes it doesn't. As you mentioned it won't give you any errors as well.

So the best way to do this, is to read the entire XML file as a string and parse it using string functions to get the attribute value you want.

Hope this helps.

 

thanks,

Akbar

0 Kudos
Message 14 of 18
(2,412 Views)

Thanks akbar ,

Yesterday i struggled for 3 hours before finnaly finding a solution i was not using the right syntax . i looked up how xpath works and found this syntax its working for me now.syntax :- location to node containing attribute followed by @* Eg:-/rapishape/packagetypes/package/@*

hope this helps who ever is looking for this in future

 https://www.w3.org/TR/1999/REC-xpath-19991116/

Message 15 of 18
(2,401 Views)

may i know what is the name of the last block used out of 3 blocks used

0 Kudos
Message 16 of 18
(2,361 Views)

@KEERTHBIO wrote:

may i know what is the name of the last block used out of 3 blocks used


If you refer to my post using JKI Easy XML the name of the function is Variant To Data from Cluster, Class & Variant -> Variant palette.

 

Ben64

0 Kudos
Message 17 of 18
(2,356 Views)

Which message are you replying to?  (It helps to use the "Quote" button when your message could be ambiguous.)

 

I'm going to guess Ben64's message #5 since it has 3 functions in it.  That is a Variant to Data function.

0 Kudos
Message 18 of 18
(2,353 Views)