LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xml adapt an old file to a new file

I have this problem in Labview 2011: I have an old XML file created with Labview blocks from a cluster. Now I need to modify that cluster adding some variables inside. How can I insert the variables in the XML file (with a default value) without throwing away all the old data?

I need a universal method and I know that won't be simple, but I'll appreciate teh simplest.

Thank you in advance

0 Kudos
Message 1 of 6
(2,570 Views)

There is no "universal" method.

 

You have two choices:

  • Create a VI that reads in the old file and puts the information into the old cluster. Then repackage the data into the new cluster, adding the new data. Then write out the file in the new format.
  • Update the XML file manually. Did you use the Write to XML VI? If so, you are using the LabVIEW schema. This schema is documented in the LabVIEW Help, so you can read it and then modify the file using a simple text editor. Did you use the XML Parser VIs? If so, you are using your own schema, and you can modify the XML file accordingly. 
0 Kudos
Message 2 of 6
(2,564 Views)

Is there an example to compare two XMLs and adding in one of the two the differences? I'm using the Labview structure and I would be able to modify manually the XML, but some users of the application could not. In my opinion the modify should be too long manually. I'm using the parser to try an universal method to insert the differences. I appreciate some suggestions.

Thank you.

0 Kudos
Message 3 of 6
(2,549 Views)

I'm not able to navigate inside clusters. How can I automatically have the referiments of all the elements of a cluster?

Thank you in advance.

0 Kudos
Message 4 of 6
(2,546 Views)

@FabioBone wrote:

Is there an example to compare two XMLs and adding in one of the two the differences?


Not that I'm aware of. However, third-party programs are better suited to do this. Something like Beyond Compare.

 


I'm not able to navigate inside clusters. How can I automatically have the referiments of all the elements of a cluster?

I have no idea what this means. Can you please rephrase, or explain it differently?

0 Kudos
Message 5 of 6
(2,541 Views)

I don't know the structure of the cluster. In fact an user of the application could modify it and I would take all the elements of that cluster to compare with another one (the cluster before the modify). I know that is possible to take the referiment of the controls (so the referiment of a control cluster), but I am not able to take some referiment of the objects inside the cluster. Anyway, now, I convert the data structure to an XML and I use the Labview Parser in order to compare the data of the old data structure.

0 Kudos
Message 6 of 6
(2,536 Views)