Hi Gary,
> I am writing a program to store stuff to xml using the storeToXML method
> but I can;t get it to compile here it is; any ideas?
First, I don´t believe that blank lines increase the readability of a
posting, but instead make it unneccessarily long. So you should think
of removing those blank lines the next time.
Second, a detailed description of the problem makes it much easier to
help. "Won´t work" or "Won´t compile" is generally not very
instructive.
> import java.io.*;
> import java.util.*;
[quoted text clipped - 4 lines]
> Properties props = new Properties();
> props.setProperty("something", "bla");
//more properties
> String OperatingSystem = System.getProperty("user.home") +"\\";
> FileOutputStream xmlwrite =
> new FileOutputStream(OperatingSystem + "config.xml");
> props.java.util.Properties.storeToXML(xmlwrite, "config");
That won´t work. Your "props"-Object is an instance of
java.util.Properties, and the storeToXML method is consequently
invoked "props.storeToXML"
Note that the storeToXML and loadFromXML methods are only available in
Java 1.5. In Java 1.4 (the version that I still use) they are not
available.
For a comparison of the two versions:
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html
http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html
<rest of code omitted>
HTH
Piet