Just wondering how i would write an entry to an exiting xml file on the sd card. The xml file already has a number of entries in it.
Many Thanks already, you are all so helpful and accommodating.
I have only just started using the net mf and this site and forum has helped me out immensly.
With an XML file it is unlikely that all you need to do is append.
You could copy the file to a new file, inserting the addtional information at its proper place.
Usually, I would be parsing the xml file into an object model, inserting the new information into the object model, and the serializing the object model using xml to a new output file.
WHen the device starts up, I want to read the file and add together all of the log file in the last 24 hours, then every time it is required insert another row into the log file
Unless anyone can suggest a better way of logging data with the following requiremnts.
Load Settings file for the hardware (on sd card) to get the hardware specific settings.
Load Settings file for the user from a usb stick.
Load Log file from usb stick and add together logs for the last 24 hours (Processing through them or using some sort of quiery to filter them).
Then allow for the adding/appending of entries to the log file on the memory stick, and a backup log on the sd card.
Unless there is some sort of database available for use on the domino?
I would use XML for the settings file and a plain ASCII flat file of your own design for the log so you can append to it w/o all the extra overhead of XML. If you must have XML for the log then you might think of something open-ended that would only contain data elements and have the closing elements added during export of the data off the board. That way you could append w/o parsing the XML.
I was going to say why dont you use xmldocument and xmlreader. but i noticed there is an xmlreader, but no xmldocument class in micro framework.
For read, modify,save operations it should be fairly simple. but complex operations like xslt and xsd would require some thinking. then again there is no LINQ in netMF so querying would have to be on enumerations or xpath. this is interesting for sure. if anyone is interested i’ll give it a try.