01-03-2009 02:03 AM
using Storm browser AND simulator, both give the same results.
i have read that AJAX is support in the browser and i have verified that the XLHttpRequest object does indeed work.
however, the X in AJAX stands for XML, and i have yet to get the browser to render an XML stream without the following error: "A problem occurred while trying to render the page"
here is a sample of the XML i am trying to return:
<?xml version="1.0" encoding="utf-8" ?>
<Routes><
Route><ActivityID>f254339a</ActivityID><
ActivityName>Cycling</ActivityName><RouteID>506c3599</RouteID><
RouteName>SantigoCanyon</RouteName></Route>
</Routes>
I am also sending the ContentType "text/xml" in the header.
This works flawlessly in every normal browser i have tried.
I am seriouly ready to throw something, please give me some ideas.
Solved! Go to Solution.
01-03-2009 09:30 AM
01-03-2009 09:31 AM
01-03-2009 02:54 PM
Thank you both for your responses. btw, there is no DTD for straight xml as there is only the version "1.0" standard, so there is no reason to validate it any other way. In my case, i couldn't care less how the xml is rendered what i am doing is behind the scenes using the XMLHttpRequest object in an AJAX call.
However, changing my contentType to application/xhtml+xml did in fact get the xml to render as text on the browser, but it didn't matter. After further review, it appears, i am indeed getting the xml through the XMLHttpRequest object - no matter what contentType i use. My problem now is i am unable to parse it. I am using the standard JavaScript DomParser() object, but i get nothing out of it.
any help with this is greatly appreciated.
thanks,
01-03-2009 06:49 PM - edited 01-03-2009 06:51 PM
01-03-2009 07:05 PM
yes, that ended up being my problem. i was using the responseText property from an earlier project where i was doing more html injection rather than xml and had written a function to create am xml document - when needed - from the text using the DomParser object which blackberry doesn't support. so using the responseXML property instead allows me to parse it directly.
so, i finally got a simple drop down populated with data, 18 hours later...
thanks
01-16-2009 11:54 AM
Hello,
I am using the responseXML property but I am getting it as null. responseText property has the proper response in the String format. But I need the xml in responseXML so I can use it directly. The jsp serving the response
is setting the contentType as "text/xml" and it is working fine in Internet Explorer. But in blackberry browser in Blackberry 9530 simulator this is not working. I also tried using the DOMParser but as you mentioned earlier, that doesn't seem to be supported in blackberry yet. The XML structure is like this:
<?xml version="1.0" encoding="utf-8" ?>
<responseMsg>
<node1><%=node1%></node1>
<node2><%=node2%></node2>
</responseMsg>
Any idea what could be the issue?
01-16-2009 01:01 PM
01-16-2009 01:25 PM
Thanks for your response. I changed the contentType to application/xhtml+xml but I am still getting null in responseXML property.
01-16-2009 01:46 PM - edited 01-16-2009 01:50 PM
perhaps you could post your code that creates your XMLHTTPRequest object?
and/or the code you are using to parse your xml?