08-01-2016 04:15 PM
HEllo Everyone,
I need to use XML to save some program data. In the attached example, I am saving a path to an XML file, so that my program remembers the latest Export folder used.
The format of this simple XML file is as follow:
<?xml version="1.0" encoding="UTF-8"?> -<Config> <ExportFolder>C:\Users\AJ\Desktop</ExportFolder> </Config>
At some other point in my main program, an exception occurs when trying to update the XML file with a new path location and i endup with the current XML :
<?xml version="1.0" encoding="UTF-8"?> -<Config> <ExportFolder/> </Config>
I am currently trying to detect if the ExportFolder text node is empty then add a default path to it :
The if statement is working but I can't find a way to update the XML file and parse a next node under the ExportFolder Element.
Any help will be greatly appreciated.
Best regards,
AJ
Solved! Go to Solution.
08-01-2016 06:50 PM
Not sure where the exportFolder text node is in your app, but cant you use the empty string? vi and if true wire a default path. You can use hte select? vi if you dont want to use a case structure for this. There is also a is path and not empty? vi if you node is a path.
08-02-2016 07:58 AM
Hello Matt,
I am indeed trying to " you use the empty string? vi and if true wire a default path."
My problem is that I can't append the closed tag with the new path.
Once this tag is closed :
<ExportFolder/>
I can't find a way to programmatically change it back to :
<ExportFolder>C:\</ExportFolder>
08-02-2016 09:45 AM
Found a solution to this. for those who might have a similar issue, this worked for me :