After loading and populating, I want the save button make the reverse operation.
That is, take the control values (that could have been changed by the user), and save them in the same XML file.
I have a problem for the operation of "find & change an attribute of an element", I'm stuck in the property/invoke nodes
The array that you have on the front panel is actually an indicator, not a control, so a user would not be able to edit the values while the VI is running. Once you change it to a control you will need to use a local variable to write to it in the "Load" event case. In the "Save" event case you would use the control's terminal to get the new values.
Since you are providing the array on the front panel a user would have the ability to add/delete "register" nodes via the right-click menu. Thus, the easiest thing to do is to simply recreate the new tree based on the new data rather than figuring out which nodes got deleted and which nodes got changed. If you open the Example Finder and search for "XML" you can take a look at the "Write Test Data File" example. It shows you how to write out a new XML file. Your code would not nearly be as wide since your XML structure is fairly simple.
If you do not want the user to be able to add/delete nodes then you must do at least 2 things:
I would like to know how to extract xml node attributes without knowing the names of those attributes. Is it possible using the XML parser of labvew 2010?
For example say I am reading in the below xml structure:
<node_2 name = second_node> text </node_2>
<node_3 type = a>
<node_4> text </node_4>
The programmer has no knowledge of the xml structure or content when writing. How do I extract the attributes of each node?
Would you mind statring a new thread with your question? This will increase the possibility that others will respond since this thread is so old. Thanks!
I have used an example for XML parsing for LV2009. Now I would like to use it for LV 8.x. I realized that all the Vis were properly recognized but one, the picture shows which one. Is there an example program that does the same (parsing the Attributes of an XML file and returning its Attribute value)?
Thanks for any hints