LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XML text node

Hi!
In my application, I want to use XML files as configuration files.
I made a VI using XML DOM Parser fonctions to fill the text nodes with the desired information. In the case I want to overwrite previous information stored in a node , the data has to be written as text and is placed between the corresponding markers (for exemple in the attached file <InputValue>data<\InputValue>).
However if a node is empty (no text previoulsy written), the marker becomes <InputValue/>. In that case, it is impossible to write data in it... Why is that ?

I think my code is more explicit... Launch Test.vi, you will notice that the nodes "S_DateHeureFin" and "S_NomEquipementFin" are never written if they are empty (but they can be overwritten if a text is already present when the Vi is launched).

Note : I couldn't attach XML file so I changed the extension into jpg , so you have to change the extension .jpg to .xml of Try.jpg to read my xml file...
CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
Download All
0 Kudos
Message 1 of 4
(5,091 Views)
Two things:
1. <InputValue/> is an empty node. This is XML-Standard and you have to deal with when writing your own VIs.
 
2. Why haven't you used the XML-Functions built into LabVIEW? Just connect anything to it and you will get the XML-String. If you have several clusters just make an array of them and write it to / read it from a file using the XML-File functions.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 4
(5,089 Views)
Using the built-in XML functions is a good idea, though they are somewhat limited.

Another option is to use LabXML, rather than spinning your own XML read/write functions.
Message 3 of 4
(5,080 Views)
In this case, you have to create a new text node, and then append it to the element node.
Message 4 of 4
(5,051 Views)