N
Nik
this is what I could make with the help of a java book:
public static void serialize(String filename)
{
try {
XMLEncoder o = new XMLEncoder( new FileOutputStream(filename));
o.writeObject("Today");
o.writeObject(new Date());
o.close();
} catch (FileNotFoundException e) {}
}
this code creates an XML file containing this:
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.4.2_05" class="java.beans.XMLDecoder">
<string>Today</string>
<object class="java.util.Date">
<long>1114933156049</long>
</object>
</java>
so far it looks not bad but instead of the <string>, <long> etc. tags I
want to create own tags. the final XML should have this format:
<archive name="archive1">
<file name="xx">
<size>100</size>
<ext>jpg</ext>
</file>
</archive>
I did not really understand how I have to use DOM (I am kind of new to this)
any help is appreciated
public static void serialize(String filename)
{
try {
XMLEncoder o = new XMLEncoder( new FileOutputStream(filename));
o.writeObject("Today");
o.writeObject(new Date());
o.close();
} catch (FileNotFoundException e) {}
}
this code creates an XML file containing this:
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.4.2_05" class="java.beans.XMLDecoder">
<string>Today</string>
<object class="java.util.Date">
<long>1114933156049</long>
</object>
</java>
so far it looks not bad but instead of the <string>, <long> etc. tags I
want to create own tags. the final XML should have this format:
<archive name="archive1">
<file name="xx">
<size>100</size>
<ext>jpg</ext>
</file>
</archive>
I did not really understand how I have to use DOM (I am kind of new to this)
any help is appreciated