Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Show XML data

0 views
Skip to first unread message

Looch

unread,
Oct 11, 2007, 3:20:18 PM10/11/07
to
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

unread,
Oct 11, 2007, 3:41:56 PM10/11/07
to
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

unread,
Oct 11, 2007, 9:37:58 PM10/11/07
to
You can apply an xslt withoug saving the file
Or d you mean woth want to stream it out to the screen
Elaborate more

"Looch" <lucian...@yahoo.com> wrote in message
news:1192131716....@r29g2000hsg.googlegroups.com...

rote

unread,
Oct 11, 2007, 9:37:58 PM10/11/07
to
You can apply an xslt withoug saving the file
Or d you mean woth want to stream it out to the screen
Elaborate more

"Looch" <lucian...@yahoo.com> wrote in message
news:1192131716....@r29g2000hsg.googlegroups.com...

John Saunders [MVP]

unread,
Oct 11, 2007, 9:44:21 PM10/11/07
to
"Looch" <lucian...@yahoo.com> wrote in message
news:1192131716....@r29g2000hsg.googlegroups.com...
>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.
--
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer


Looch

unread,
Oct 12, 2007, 10:56:11 AM10/12/07
to
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

unread,
Oct 12, 2007, 11:37:41 AM10/12/07
to
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

unread,
Oct 12, 2007, 11:39:09 AM10/12/07
to
Sorry that should have been xdoc.LoadXml(SqlRequest).


0 new messages