hi,
You can parse an xml file using kxml.
Ex: If your midlet request a servlet which generates an xml structure output then you can use the kxml parser to parse the output and you can display the data.
check these link http://www.ericgiguere.com/techtips/
Download XMLTest.zip and play with that.
GoodLuck.
This is the code I've got from somewhere and tried. Works just fine:
Element root = new Element();
root.setName("form");
root.setAttribute(new Attribute("name","Frm-All-03"));
Element e = new Element();
e.setName(Cut Block);
e.addChild(Xml.TEXT,"23/123");
root.addChild(Xml.ELEMENT,e)
System.out.println("XML doc:\n" + root.toString());
Output:
<form name="Frm-All-03">
<Cut Block>23/123</Cut Block>
</form>
The problem is, you cannot build a document with 30 nodes if you have 2MB handheld. Heap runs out of space. So, you may want to write XML to string "manually instead.
Any thoughts?
Stan Berka
Pope & Talbot