I have an xml file having data, and want to add more to that file when a button is pressed in swing frame-
the xml file is like this -
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
// want to insert data here
how can i do this because every time the button is clicked, i want to store the data from the textfields of the window to an xml file , but i also want the previous data and the current one too.
I want to write the new data in between the <FDdetails> tag each time i click the button.
Can someone please help me with this? Completely exhausted searching on net for tutorials but no success.
<nitpicking>I feel compelled to point out that a parser can't alter anything - parsing XML means the act of reading it. DOM does more than just parse XML, though - it has methods to alter the resulting DOM tree. (And, if one wanted to be even more exacting, DOM doesn't actually do parsing at all- it relies on an underlying SAX parser to do that.)</nitpicking>
<extended-nitpicking>Actually, the Simple API for XML (SAX) also does not do any "parsing." It is an API that receives callbacks from an actual parser, e.g. Apache Xerces. Both DOM and SAX are programming API, they are not parsers.</extended-nitpicking>
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop