Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How do I write XML from a dataset to Response, including schema?

Reply
Thread Tools

How do I write XML from a dataset to Response, including schema?

 
 
Alan Silver
Guest
Posts: n/a
 
      03-17-2005
Hello,

I am trying to write some XML from a DataSet out to the Response object,
but I'm getting somewhat stuck.

I started out with ...

strXmlData = dstData.GetXml();
Response.Write(strXmlData);

which was fine, except it doesn't include the schema. I then discovered
that I should have been using WriteXML instead of GetXML, as that allows
me to tell it add the schema.

This is where I got stuck. I can't work out what to use for the first
parameter of WriteXML. The second one is the WriteSchema flag, but what
do I use for the first?

I tried ...

dstData.WriteXml(Response, XmlWriteMode.WriteSchema);

thinking that maybe Response was really a stream, but that didn't work.

So, anyone know how to do this? I just want the most efficient way of
sending the XML including schema to Response.

TIA for any help

--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
 
Brock Allen
Guest
Posts: n/a
 
      03-17-2005
Use Response.OutputStream

-Brock
DevelopMentor
http://staff.develop.com/ballen



> Hello,
>
> I am trying to write some XML from a DataSet out to the Response
> object, but I'm getting somewhat stuck.
>
> I started out with ...
>
> strXmlData = dstData.GetXml();
> Response.Write(strXmlData);
> which was fine, except it doesn't include the schema. I then
> discovered that I should have been using WriteXML instead of GetXML,
> as that allows me to tell it add the schema.
>
> This is where I got stuck. I can't work out what to use for the first
> parameter of WriteXML. The second one is the WriteSchema flag, but
> what do I use for the first?
>
> I tried ...
>
> dstData.WriteXml(Response, XmlWriteMode.WriteSchema);
>
> thinking that maybe Response was really a stream, but that didn't
> work.
>
> So, anyone know how to do this? I just want the most efficient way of
> sending the XML including schema to Response.
>
> TIA for any help
>




 
Reply With Quote
 
 
 
 
Alan Silver
Guest
Posts: n/a
 
      03-17-2005
>Use Response.OutputStream

Fantastic, thanks

>-Brock
>DevelopMentor
>http://staff.develop.com/ballen
>
>
>
>> Hello,
>> I am trying to write some XML from a DataSet out to the Response
>> object, but I'm getting somewhat stuck.
>> I started out with ...
>> strXmlData = dstData.GetXml();
>> Response.Write(strXmlData);
>> which was fine, except it doesn't include the schema. I then
>> discovered that I should have been using WriteXML instead of GetXML,
>> as that allows me to tell it add the schema.
>> This is where I got stuck. I can't work out what to use for the
>>first
>> parameter of WriteXML. The second one is the WriteSchema flag, but
>> what do I use for the first?
>> I tried ...
>> dstData.WriteXml(Response, XmlWriteMode.WriteSchema);
>> thinking that maybe Response was really a stream, but that didn't
>> work.
>> So, anyone know how to do this? I just want the most efficient way
>>of
>> sending the XML including schema to Response.
>> TIA for any help
>>

>
>
>


--
Alan Silver
(anything added below this line is nothing to do with me)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is this standard way of including xml into xml? hilz XML 5 10-31-2005 03:29 PM
Newbie. xml "dynamically" including another xml document Clive XML 1 08-21-2005 08:26 PM
Dataset>XML>SQLText field>XML>Dataset thomas@humphries.com ASP .Net 0 07-12-2005 03:52 AM
dataset.Databind error when dataset XML contains attributes... ringo ASP .Net Datagrid Control 0 08-18-2004 05:28 PM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments