Click to See Complete Forum and Search --> : data request and display


bulletz
12-05-2003, 12:33 AM
hi there!

i'm new to xml, i only know the basics of it. been using it for 2 weeks now.

the scenario:

my current project requires me to access our affiliates data system using xml and display the gathered information on our site.

our affiliate gave us a request structure,
see below for example

request structure: <catalogID> depends on a user input.

"http://www.affiliatedomain.com/affiliate.jsp?xml=<parent>catalogID>111111</catalogID></parent>"

response stucture is:
<catalogs>
<catalogname>name</catalogname>
<cdID>111111</cd>
<cdName>My CD</cdName>
</catalogs>

the problem:

how will i display the gathered informations? and how will i declare the "request structure" in our site?

Khalid Ali
12-05-2003, 10:00 PM
I don't think you'll be able to do this using a browser(cross domainsecurity issue).
You may want to try a stand alone aplication on the server side written php/java(jsp or servlet) and then load the results in a rowser window

paps
12-07-2003, 05:05 PM
u could do this using Javascript...

using the HTTPRequest object...u can post an XML file...to your client...and read the XML is response...

Load the incoming XML in an XMLDOM object...use XSL to make it look "pretty"....and siplay it...there simple isnt it?? hehe....

heres some sample code that does exatly what u want........

SerHttp = new ActiveXObject("Msxml2.XMLHTTP");
SerHttp.open(RequestMethod,ServiceRequest, false,
"","");
SerHttp.setRequestHeader("content-type","text/xml");
SerHttp.send(InputXML);
SerXML = new ActiveXObject("Microsoft.XMLDOM");
SerXML.loadXML(SerHttp.responseText);

FileData = SerXML.transformNode(XslXML);


heres what the code does....Sends "InputXML" to "ServiceRequest"...gets the response....loads into XMLDOM...transforms it against an XSL "XslXML"

HTH....

Have fun...:D