Hi,
Is there any xml parser available for widgets Like Kxml parser for j2me ? I want to parse the xml . How do I do that?
Hi,
Is there any xml parser available for widgets Like Kxml parser for j2me ? I want to parse the xml . How do I do that?
Hi Bhanu,
if you want to get the XML structure of a document retrieved from an XMLHttpRequest call, you can directly access its responseXML object, containing the response complete XML tree.
To parse an XML got in another way, you can:
1) take the XML content as plain text
2) create a fake (hidden) DIV
3) set the innerHMTL property of the created div to the XML content
Doing this way, you'll be able to access the complete XML structure by simply traversing the DIV DOM structure.
Hope it helps,
Pit
Hi jappit,
Thanks for your reply . I have One more question How do I retrieve the xml Document from the XMLHttpRequest is there any example ?
Hi,
The response object from the XmlHttpRequest has these properties
responseXML itself is a DOM object, it's ready parse. But in case of responseText, use the method that @jappit mentioned on his reply.Code:// String version of data returned from server XmlHttpResponse.responseText // DOM-compatible document object of data returned from server XmlHttpResponse.responseXML
Thanks,
Raghava
Hi Bhanu,
just follow the good tips given by Raghava.
For some other useful infos and code, take a look here:
* A complete introduction: http://ajaxpatterns.org/XMLHttpReque...#XML_Responses
* Widget code using responseXML: http://wiki.forum.nokia.com/index.ph...in_WRT_widgets
Pit