hi
suppose we are storing all instance variable of class obj in HashMap using reflection
and then we are iterating field type , field name and field value from HashMap and displaying in XML format
<?xml version="1.0" encoding="UTF-8"?>
<root class="One" label=VAR1/>
<int name="int_One" >10</int>
<
String name="str_One" >One</String>
<float name="float_one" >1.2</float>
</root>
currently i m using StringBuffer for storing object and display in this above way by hardcode
like this
for (int counter = 0; counter <= xmlfieldnames.size(); counter++) {
if (xmlfieldnames.get("FieldName" + counter) != null) {
xmlStrBuffer.append("\n<" +
xmlfieldtype.get("FieldType" + counter) + " name=\"" +
xmlfieldnames.get("FieldName" + counter) + "\" >" +
xmlfieldvalue.get("FieldValue" + counter) + "</" +
xmlfieldtype.get("FieldType" + counter) + ">");
}
But i want to use XML (DOM /SAX) or JAVAX.xml API for above output insteed of using StringBuffer
waiting for reply
bye
saket