I would like to create a XML file which would have all the information about the system.
To get the information, i would use getProperty(os.name) and would save it in a string like this
String nameOS = "os.name";
nameOS=System.getProperty(nameOS);
And now i would like to create an XML and would like the value of this string to be one of the element of XML file created, for which i would be doing something like this
Element Osname = doc.createElement("Osname");
Osname.appendChild(doc.createTextNode("nameOS"));
staff.appendChild(Osname);
But Output xml file looks likes this
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
- <HardwareInfo>
<OsName>nameOS</OsName>
</HardwareInfo>
I get the name of the string in the output instead of Value of the string.
Any help would be very much appreciated.
remove the quotes from around nameOs