LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open and display XML contents

Hello!

I've attached a simple VI which I expect to open a display the contents of an XML file. I put a probe on the output of Build Path Icon, and a second probe on the output of Read From XML File. The VI runs, but, within the probe watch window, the value is just "" . I read the detailed help on Read From XML File, and I see that the XML file must be formatted in the LabVIEW XML schema. I'm sure my file does not conform to the schema. The test.xml file is an ouput from a different, separate VI. I cannot alter the schema of test.xml as it has been in use for a very long time. What do I need to do to read the test.xml?  Thank you for assisting me!!  -  John

 

The test xml file is a Word doc, but has an XML format. This XML format has been altered by the conversion process; converting it from an XML to a word doc.

LabVIEW FULL 2016

Download All
0 Kudos
Message 1 of 35
(4,893 Views)

Use JKI's EasyXML, you can download it from the LabVIEW Tools Network using VIPM.

 

I use it a lot, it's great and there is a support forum if you need tips and help.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 35
(4,867 Views)

A doc or docx file isn't XML. Save the doc(x) file as text, and you stand a chance. You'd probably need to do some formatting, depending on the word document.

 

Alternatively, you'd need some sort of word document parser to get the XML from the document.

 

Open the word document in notepad, and you'll see it's not XML. It just contains XML.

 

No XML parser (not even JKI) would be able to do it. Why would it be able to read from a word document? And PDF? And XLS,HTML, zip, HTML in zip, etc. It's just not possible to make an XML library that reads from every file format there is... That's what other libraries are for.

0 Kudos
Message 3 of 35
(4,841 Views)

Hi,

I tried to upload the original XML, but, I get an error saying an XML format is not allowed here on the forum. So I paste the contents of the XML is a word, (docx), the only reason was to upload the file here on the forum. This is why I commented on this within my original post. 

 

Thanks for your assistance! -  John

0 Kudos
Message 4 of 35
(4,835 Views)

zip all your files then upload it.

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 5 of 35
(4,823 Views)

Excellent, thanks! - John

0 Kudos
Message 6 of 35
(4,820 Views)

Zip files attached. - John

Download All
0 Kudos
Message 7 of 35
(4,816 Views)

That is actually 7z-ed, not zipped.

0 Kudos
Message 8 of 35
(4,811 Views)

If you want to use (un)flatten from\to XML, the XML needs to confirm to the LabVIEW XML scheme.

 

There are XML parser functions, that let you do anything with arbitrary XML. Then again, if that's the situation, JKI EasyXML might help. The native library is a bit rough around the edges.

0 Kudos
Message 9 of 35
(4,809 Views)

Is there any performance advantage to using XML versus just parsing the data as a text file? I have never used XML. It is my understanding that you can embed data type tags within XML formatted data. Is this true? If true, does my XML file have data type tags? If not, then I'll just parse and manipulate it as a text file. 

 

Thanks for assisting! I am grateful for your experience! -  John

0 Kudos
Message 10 of 35
(4,807 Views)