Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

Show XML data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Looch - 11 Oct 2007 20:20 GMT
All,

I'm using the following code in a blank page:

public void Page_Load(object sender, EventArgs e)
   {
       ...
       XmlDocument xdoc = new XmlDocument();
       xdoc.LoadXml(receipt.getIndividualReceipt(a, b));
   }

How can I show the XML data that is in xdoc without saving the file
locally (which I'm not sure is even possible) and opening it?

Thanks in advance.
Looch - 11 Oct 2007 20:41 GMT
I should probably clarify this a little, I'd like to display the data
in raw form similarly to opening an XML file that doesn't have any
kind of style sheet. Thanks.
rote - 12 Oct 2007 02:37 GMT
You can apply an xslt withoug saving the file
Or d you mean woth want to stream it out to the screen
Elaborate more

>I should probably clarify this a little, I'd like to display the data
> in raw form similarly to opening an XML file that doesn't have any
> kind of style sheet. Thanks.
rote - 12 Oct 2007 02:37 GMT
You can apply an xslt withoug saving the file
Or d you mean woth want to stream it out to the screen
Elaborate more

>I should probably clarify this a little, I'd like to display the data
> in raw form similarly to opening an XML file that doesn't have any
> kind of style sheet. Thanks.
John Saunders [MVP] - 12 Oct 2007 02:44 GMT
>I should probably clarify this a little, I'd like to display the data
> in raw form similarly to opening an XML file that doesn't have any
> kind of style sheet. Thanks.

You could output xdoc.OuterXml.
Signature

--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer

Looch - 12 Oct 2007 15:56 GMT
I'd like to stream it out to the screen.

I understand how this would work:

Console.WriteLine(xdoc.OuterXml);

But what should replace the Console.WriteLine if outputting to a blank
page?
Looch - 12 Oct 2007 16:37 GMT
Ok, so I figured out that I needed Response.Write. Sheesh.

That seems to render the XML string returned from SQL server without
the element tags and all ran together. I loaded an XML doc with the
string (xdoc.Load(SqlResult). Response.Write has a constructor for an
object parameter but I get an error if I use xdoc as the parameter.
I'd like to render xdoc on the screen formatted with the element tags
and indenting. Why wouldn't I be able to use the xdoc object in
Response.Write?
Looch - 12 Oct 2007 16:39 GMT
Sorry that should have been xdoc.LoadXml(SqlRequest).

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.