How to edit an XML file in JavaME using kXML?

857 Views Asked by At

kXML is an alternative XML parser I chose to use for JavaME apps.

The XML file to be editted is inside the mobile app's own JAR. I'm using CLDC profile.

Please help

2

There are 2 best solutions below

0
On BEST ANSWER

You WILL NOT be able to modify anything that is in the mobile application JAR file.
You need to create a modified copy of the file and store it in an area you can write to (presumably, on the mobile phone file system).

1
On

if i understand your problem, you want to parse xml file that is present in your apps jar. try this.

InputStream in = this.getClass().getResourceAsStream("/sample.xml");
InputStreamReader is = new InputStreamReader(in);
KXmlParser parser = new KXmlParser();
parser.setInput(is);

but if you want to make changes in that file, i think its not possible.