LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically add tags to XML file

Hello Everyone,

 

I need my application to be able to write to an already existing XML file.

 

The XML file is of this type:

 

<XML>

<Parameter x="1" y="2"/>

</XML>

 

The user should be able to add tags so that the resulting XML looks like this:

 

<XML>

<Parameter x="1" y="2"/>

<Parameter x="3" y="4"/>

</XML>

 

 

So basically I need to add tags programmatically.

 

Suggestions?

 

Thanks 

0 Kudos
Message 1 of 3
(3,230 Views)

Which version of LabVIEW are you using? In older versions of LabVIEW the built-in VIs for unflatten/flatten to XML only work with the NI XML Schema. In 2013 (?) onwards, there are additional functions for parsing/modifying XML files using property/method nodes:

 

2015-11-03_16-52-02.png

 

I think there are also other toolkits available on the tools network (look in package manager), you can also use .NET - it has a library for dealing with XML.

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 3
(3,210 Views)

Maybe something like this:

Add XML Node.png

 

You could also do some traditional string manipulation:

Traditional string manipulation.png

0 Kudos
Message 3 of 3
(3,183 Views)