473,379 Members | 1,222 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

send XML from ASP

ljb
Does anyone have an example of ASP streaming XML? Can I set content headers
to indicate the page returns XML? Can this XML be a string or must it be
prepared with DOM? I need to create an ASP that queries Access and Oracle,
combines the data and returns it as XML.

thanks
LJB
Mar 1 '06 #1
2 3748
>Does anyone have an example of ASP streaming XML?

Without using a DOM

Response.ContentType = "text/xml"

Response.Write "<?xml version=""1.0"" encoding=""windows-1252"" ?>"
Response.Write "<root><item>Hello World</item></root>"

Using a DOM

Dim oXML
Set oXML = Server.CreateObject("MSXML2.DOMDocument.3.0")

oXML.LoadXML "<root />"

AddElem oXML, "item", "Hello World"

Response.CharSet = "UTF-8"
Response.ContentType = "text/xml"
oXML.Save Response

Function AddElem(roParent, rsName, rvntValue)
Set AddElem = roParent.ownerDocument.createElement(rsName)
If Not IsNull(rvntValue) AddElem.Text = CStr(rvntValue)
End Function

Can I set content headers to indicate the page returns XML?
Response.ContentType = "text/xml"
Can this XML be a string or must it be prepared with DOM?
It is strongly recommend you use DOM if at all possible. Generating XML
using a string requires your code to perform appropriate character escaping.
I need to create an ASP that queries Access and Oracle,
combines the data and returns it as XML.


Access text fields are unicode. For best results use a DOM.

Anthony.
Mar 2 '06 #2
ljb
Very helpful!

thank you
Mar 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Steve Horrillo | last post by:
I can't figure out why this script won't insert the subject in the email and why can't I control the font and size being used? I'm not sure where to post this. Let me know where if this is OT. ...
0
by: zhimin | last post by:
Hi, I'm writing a program to send large file(100m) through dotnet using TCPListener & TCPClient, I'm sending the file with a ask and response loop: 1. Client send a flag 1 to server indicate it...
6
by: John J. Hughes II | last post by:
I have a service that needs to send e-mail alerts. I have been attempting to use the System.Net.Mail function from .NET but this seems to require the IIS be installed and running. Since some of...
13
by: Manfred Braun | last post by:
Hi All, I am trying to understand the blocking method socket.Send(). The call blocks as expected, but does this mean, it returnes after the underlying TCP layer got a confirmation, that the send...
3
by: Gerard | last post by:
Hello I have created a windows service to monitor a database, it starts some checks when a timer elapses. The checks send emails depending on their findings. My issue is that when I created a...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
3
by: ultr | last post by:
Hello, I have read that send() may not send whole message and returns the nuber of bytes sent, so that we can handle the rest of the message. Is it true, because i have tested sending even 1MB...
11
by: hazz | last post by:
smtpClient.Send(message) is causing me problems as per specifics in the trace below. Email is sent but not without this error typically upon sending the second email, but sometimes when running...
15
by: cj | last post by:
How can I get a button in VB to send the contents of a text box via email in a manner similar to the "Send To\Mail Recipient" functionality that you can select via right clicking a file in Windows...
4
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
I have a web page that at the click of a button must send a bunch (1000+) emails. Each email is sent individually. I have the code working fine, using Mail Message classes and smtp and all that. ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.