468,514 Members | 1,631 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,514 developers. It's quick & easy.

asp / sql code in xml file possible? or other options to retrieve recordset in xml

120 100+
hi guys - okay I've already asked this question in the xml section here but I'm not having much luck.

I have an xml file which we send to a 3rd party company - the 3rd party company then utilises this xml file that they are expecting.

in the xml there is a price tag and all I want to achieve is to be able to retrieve a value from our sql db and then to place this value within the xml price tag.

I've tried
Expand|Select|Wrap|Line Numbers
  1. <price><![CDATA[ ASP CODE HERE ]]></price>
  2.  
and also as an include
Expand|Select|Wrap|Line Numbers
  1. <price><![CDATA[ <!--#include virtual="price.asp" --> ]]></price>
  2.  
both of these methods dont work. now I've read on w3 schools that you can insert a js script using the cdata method -
link is here

as the 3rd party company expects to receive the xml file i must continue this - but is there any way to retreive the price value from a sql db and then to insert this within the xml price tag??

thanks in advance
Omar.
Apr 27 '10 #1
5 1829
Frinavale
9,735 Expert Mod 8TB
Why didn't it work?
What was the XML output generated?

-Frinny
Apr 27 '10 #2
omar999
120 100+
rather than displaying the value from the db the entire asp code is output revealing connection string, password etc and other sensitive information.
Apr 27 '10 #3
Frinavale
9,735 Expert Mod 8TB
Did you create an .asp file that generates the XML?

Is it being executed properly? It has to be executed as an asp file...which will generate the XML...

How are you accessing the file?



-Frinny
Apr 27 '10 #4
omar999
120 100+
hi frinny

i dont have an asp file generating the xml - from what I've been reading and advised maybe this IS the problem??

Ideally I'd like to add some asp code to the xml tag... is this not possible?

otherwise I will need some sort of asp script to generate the xml am i right?

thanks in advance
Omar.
Apr 27 '10 #5
Frinavale
9,735 Expert Mod 8TB
Yes that Is the problem.

ASP (Active Server Pages) is executed as a script and generates output (text). Commonly this text is HTML which is sent a web browser that has requested the ASP script. The script typically dynamically generates the HTML to create a dynamic website.

ASP doesn't have to output HTML though...it could output anything really.
In your case you want it to output XML.

What I'm wondering is how you are using this?
What is your application?
Is it a web application?
How are you planning on calling the script?

There are many ways to generate XML files...depending on what technology you are using and what type of application you are developing.


-Frinny
Apr 27 '10 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

45 posts views Thread by Steven T. Hatton | last post: by
4 posts views Thread by pamelafluente | last post: by
5 posts views Thread by Eric Layman | last post: by
1 post views Thread by rn5a | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.