LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Read data from a xml?

Dear All,

 

My Xml file has the following attributes,

 

<UserLogSettings>
<LogLaserActions>False</LogLaserActions>
<LogAlways>True</LogAlways>
<Current>True</Current>
<Frequency>True</Frequency>
<Shg>True</Shg>
<Thg>True</Thg>
<Temperature>True</Temperature>
<LogFromDate>1/01/0001 12:00:00 AM</LogFromDate>
<LogToDate>1/01/0001 12:00:00 AM</LogToDate>
<ErrorLoggerSize>2</ErrorLoggerSize>
<Seed>True</Seed>
 </UserLogSettings> 

 

I want to read the above xml file and display each attribute separately, How can I do this?

 

Gaya 

0 Kudos
Message 1 of 4
(2,729 Views)

Hi Gaya,

 

you could read the text file and parse for the different XML tags. This has been asked before so you should find thread discussing the parsing part...

 

Or you could dig into OpenG, they provide some powerful XML functions too...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,719 Views)
  • Method 1: Use the XML Parser functions that ship with LabVIEW. Examples ship with LabVIEW. Did you look?
  • Method 2: Parse it yourself by reading it as a text file and just using the string functions. As Gerd suggested.
  • Method 3: Use LabXML. This is an old toolkit, and I don't think it's supported anymore.
  • Method 4: Use (buy) EasyXML from JKI.
Message 3 of 4
(2,714 Views)

Thank you for your replies

0 Kudos
Message 4 of 4
(2,682 Views)