views:

88

answers:

3

Hi

I'm currently calling a web service from my J2ME app and receiving the xml document as a string object.

is it possible to convert the string object to a document type? Can I navigate the document inside the string?

Any answers would be appreciated, been googling for a while and so far, no good.

A: 

You can find a list of XML parsers that will work in J2ME here. I personally used NanoXML, it can convert your string to a model on the memory and it worked pretty well for me.

Szere Dyeri
A: 

Szere is right.

XML parsers can convert the string to an object in memory. That object can be written to persistent memory in the doc form.

success_anil
A: 

Thank you for the link Szere! I had a look at the list and Xparse-J worked like a charmed; the Xparse.parse() method in the document sold it to me, exactly what I needed.

"The most important function for reading a document is Xparse.parse(). It takes the string containing the XML document as the sole argument and returns the root node of the parsed XML document."

TraderCoder
I am glad that it solved your problem. have fun with it :)
Szere Dyeri