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 / Languages / C# / February 2008

Tip: Looking for answers? Try searching our database.

Displaying unparsed HTML in a WebBrowser control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Artie - 25 Feb 2008 09:49 GMT
Hi,

I'm using a WebBrowser control to display xml formatted to html using
a stylesheet.

In certain scenarios, if I detect that the xml is invalid, I'd need to
display the raw invalid xml in the WebBrowser control.  I've wrapped
the raw invalid xml in some html tags, and it displays, however, all
the xml tags have been parsed out - it just displays the values.

My question is, how can I get the WebBrowser to display the actual
xml, including all the tags?

Example:

I want to display "<Forenam>John</Forename><Surname>Smith</Surname>"
in the WebBrowser
(deliberate mistake 'Forenam')

rather than
"JohnSmith"

Any help much appreciated

Cheers

Attie
Paul E Collins - 25 Feb 2008 09:57 GMT
> I've wrapped the raw invalid xml in some html tags, and it displays,
> however, all the xml tags have been parsed out - it just displays the
> values.

Web browsers assume that anything like <blah> is an HTML element they
don't recognise, and they ignore it when rendering. (Imagine the mess of
tags otherwise whenever a new element was introduced.)

You probably want to replace < and > with the character entities &lt;
and &gt;.

Eq.
Artie - 25 Feb 2008 12:27 GMT
On 25 Feb, 09:57, "Paul E Collins" <find_my_real_addr...@CL4.org>
wrote:
> > I've wrapped the raw invalid xml in some html tags, and it displays,
> > however, all the xml tags have been parsed out - it just displays the
[quoted text clipped - 8 lines]
>
> Eq.

Thanks Paul, that worked perfectly.

Artie

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.