Use asp file as XML Source

B

Behzad

Hi.
can anyone help me on this Please?
I have an ASP file like this named as 'somexml.asp':
<%
response.ContentType="text/xml"
dim rst
set rst=Session("someconn").execute("Select * from SomeTable")

Response.write("<?xml version='1.0' encoding='utf-8'?>")
Response.write("<as>")
do while not rst.eof
Response.write("<Name>" & rst.fields(Somefield))
Response.write("</Name>")
rst.movenext
loop
Response.write("</as>")
%>
when i run this page it will produce an xml file;but i the problem is
when iwant to refer to this file in another HTML file with this code:

<html><body>
<xml id="xxx" src="somexml.asp" async="false"></xml>
<table datasrc="#xxx">
<tr>
<td><span datafld="somefld"></span></td></tr>
</table></body></html>

when i set this html file as startup file in IIS it produce an empty
html file.
how can i refere to that asp file.can it be run before the html and
then the html file use its data?

thanx for ur attention.
Behzad
 
A

Andy Dingley

how can i refere to that asp file.can it be run before the html and
then the html file use its data?

Don't use DSO (datasrc, datafld etc.) Use a data island instead, with
a client-side XSLT transform (or even client-side JScript).

Don't use
Response.write("<?xml version='1.0' encoding='utf-8'?>")
Response.write("<as>")
etc. Use the DOM instead.

Your asp page should work fine and return XML quite happily. Try
entering that page's adress directly into IE - you should see the XML
content that's being returned. If you don't, then debug this
separately until it's working stand-alone.

I'm not going to answer your original question about synchronising the
twp pages, because that's just a bad and wrong way to go about it.
 
B

Behzad

hi Andi.

As i desceribed; my asp file works fine alone but when i call it from
within html file IIS wont execute the code within it.
BTW i'm not familiar with DOM.would u please guide me what to do?

Thanx
Behzad
 
A

Andy Dingley

As i desceribed; my asp file works fine alone but when i call it from
within html file IIS wont execute the code within it.

I'm sure it will. I think it's probably already doing it ! I would
gues that the fault is with the DSO code (datafld /. datasrc) that
you're trying to use - that stuff never worked right, and it's not
very useful anyway - far too inflexible.

Do you have a URL for this code where we can see it ?
BTW i'm not familiar with DOM.would u please guide me what to do?

If you're using Microsoft, look at the MSXML ActiveX component and the
rather good help file that comes with it. Searching MSDN.com should
give you all sorts of help.
 
B

Behzad

Hi.

i'm sorry.I'm developping the site and it will be ready next month. i
will tell u then.
i will try to find on msdn.i will ask u if i had any further
question.can i?

Thanx for ur attention.
Behzad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,088
Latest member
JeremyMedl

Latest Threads

Top