PC Review


Reply
Thread Tools Rate Thread

How can i get content from xml file in a string format?

 
 
stringy
Guest
Posts: n/a
 
      12th May 2005
How can i get content from xml file in a string format?

I have an xml file. Within the xml file is html code.
I want to do:

string webpage = !! somehow read xmlfile as a string
Response.Write(webpage);

what do i need in order to do this?

thanks
 
Reply With Quote
 
 
 
 
Hans Kesting
Guest
Posts: n/a
 
      12th May 2005
stringy wrote:
> How can i get content from xml file in a string format?
>
> I have an xml file. Within the xml file is html code.
> I want to do:
>
> string webpage = !! somehow read xmlfile as a string
> Response.Write(webpage);
>
> what do i need in order to do this?
>
> thanks


If you just want to "response.write" the entire file, there is also
Response.WriteFile(filename);


Hans Kesting


 
Reply With Quote
 
Steve Walker
Guest
Posts: n/a
 
      12th May 2005
In message <001f01c556d3$1ab317c0$(E-Mail Removed)>, stringy
<(E-Mail Removed)> writes
>How can i get content from xml file in a string format?
>
>I have an xml file. Within the xml file is html code.
>I want to do:
>
>string webpage = !! somehow read xmlfile as a string
>Response.Write(webpage);


protected override void Render(HtmlTextWriter writer)
{
string file = Server.MapPath("file.xml");
using (System.IO.StreamReader sr = new System.IO.StreamReader(file,
System.Text.Encoding.Default,false))
{
writer.Write(sr.ReadToEnd());
}
}

--
Steve Walker
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Copy Content Text File in Project to a Folder or a String vjunkl@hotpop.com Microsoft Dot NET Framework 1 22nd Feb 2007 11:06 PM
Copy Content Text File in Project to a Folder or a String vjunkl@hotpop.com Microsoft C# .NET 1 22nd Feb 2007 11:06 PM
Wich way I can to write a content of a string from CString-type object to a previsioly opened file? Igor Natachanny Microsoft VC .NET 1 28th Aug 2005 05:37 PM
How to import a text file to Excel treating all input content are in string. Chittu Microsoft Excel Misc 1 22nd Jul 2005 06:37 AM
Read whole content of rich text format file into string variable =?Utf-8?B?VHJhbiBIb25nIFF1YW5n?= Microsoft Access VBA Modules 1 20th Feb 2004 07:23 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 PM.