LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read XML file problem

Solved!
Go to solution

Hi all,

I am trying to read an xml file and display the output. i get a blank display. Can anybody please help me out.

Thanks in advance

 

I cant attach the xml file. Since its not a valid extension. Please find the xml code below.

<Company>
<Name>Samsung</Name>
<Location>
<City>Busan</City>
<Country>South Korea</Country>
</Location>
</Company>



Regards,
KM
0 Kudos
Message 1 of 5
(4,974 Views)

Well, I don't see what are you trying to achieve. Do you want to parse xml and get cluster or just read file and get pure string?
In second case, you can just read .xml like regular txt file. However, in first case there are few possibilities to get cluster.

0 Kudos
Message 2 of 5
(4,957 Views)

Well, thanks for your reply, i want to parse xml and get a cluster output. Can you please suggest me how to go about it.

Regards,
KM
0 Kudos
Message 3 of 5
(4,931 Views)

First you should use Read From XML File.vi not Read Text File.vi.

 

How was your xml file generated? Does it follow the LabVIEW xml schema?

 

Your cluster should be representative of your data which is not the case in the code you attached.

 

Ben64

Message 4 of 5
(4,916 Views)
Solution
Accepted by topic author KevinKM

If you can change saved .xml file, you can modify it to be compatible with Labview XML shema and use Unflatten from XML like in your VI. If you cannot, you should use XML Parser library. In attachement you can find 2 exmaples for these situations.

Download All
Message 5 of 5
(4,912 Views)