Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

New Developer
Posts: 43
Registered: ‎08-23-2008

Reading and writing the XML (local)



I wolud like to know how the XML is created on the local device.

And also i would like to know the reading /writing /updating the xml.


Is XML is permanent storing place in the device?


Code support is appriciated.


Please use plain text.
Posts: 1,415
Registered: ‎07-30-2008

Re: Reading and writing the XML (local)

There is no file system on earlier devices but there is a persistent store. XML is just text, AFAIK, there is

no magical XML land. RIM does provide some XMLParser classes ( and again I personally recommend rendering

all the javadoc html and putting it in a location that can be easily grepped so you can look for keywords like

XML without the "Assistance" of a GUI or browser). I would imagine that XMLWriter would work for you.






I did get this to run with a subclass of DefaultHandler but I was trying to parse html which didn't work too well (duh).





the commented out code is pretty much what you would expect,

( assumed I could find something similar to XMLParser that works for real-life html )

 //XMLParser xml = new XMLParser();
   //DefaultHandler dh= new htmlhandler(m_app);


class htmlhandler extends DefaultHandler
 MyTgtApp m_app;
 String m_data="nothing";
 String xdata="";
 public htmlhandle(MyTgtApp app) {super(); m_app=app; }
 public void endElement(String url,
  String local, String qName ) throws SAXException
 {  }
 public void processingInstruction(String target,
                                  String data)
                           throws SAXException
     xdata=target+" "+data+"\n\r";
 public void endDocument()
                 throws SAXException
     {m_app.saysomething("parse done "+m_data.length()+xdata);





Please use plain text.