...

View Full Version : httprequest and dom document creation



bkanmani
03-24-2005, 05:40 AM
hi all,
i have created http request using newhttprequest() and the response is
objposter.responseText
this contains xml content like
<districts>
<district code =01 name=xxx>
</districts>
like tht

first i was usign this in ie browser i got result usign responseXml . so the contaent wil be in xml type and
objPoster = new ActiveXObject("MSXML2.XMLHTTP.3.0");
i fetched using objposter.responseXml.Selectnodes("districts/district")

but i doesnot works in mozilla and other browsers netscape.
so i have created this

i have read tht i have to create dom docuemnt
objDOM = document.implementation.createDocument("","", null);
now i want to knw how to load the xml request into the domdocuemnt and get the value stored in the nodes .
i tried xmldoc.load but it loads only xml files.
mine is a string
responseXml is not workign in mozilla and other browsers.
plz help me regardign this issue

Kor
03-24-2005, 08:49 AM
ActiveX object works for IE only, for Moz you may use XML HTTP Request object.

See also this article (http://jibbering.com/2002/4/httprequest.html)

bkanmani
03-28-2005, 11:13 AM
actually for the script
objPoster=new ActiveXObject("Msxml2.XMLHTTP.4.0"); i have used

objPoster = new XMLHttpRequest();


now i have got xml string thorugh this code
objposter.responseText

since this is a response text xml is in the form of string

responsexml is not workign in mozila browsers

so i want to kwn how to get the xml mode values

the xml string is as follows
<districts>
<district code=001 name="xxx">
..
</districts>

i want to get the value stored in code and name nodes

how can i get it
objposter.responsexml.SelectNodes("distircts/district")
is not workign in mozila browsers

plz help me in this issue

Kor
03-28-2005, 11:56 AM
I have heard about a crossbrowser library called SARISSA which might help you in your particular attempt. Google for it.

here's a start
http://www.xml.com/pub/a/2005/02/23/sarissa.html

A1ien51
03-28-2005, 02:26 PM
responseXml is not workign in mozila browsers...

Sounds like the header content of the page is most liekly not set to text/xml. I ran into that problem.

Eric

Kor
03-28-2005, 04:50 PM
Frankly said, I have not yet need it, so I have only pointed out an article I have seen, but no verify...so...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum