Discussion:
HtmlElement InnerHtml attributes returning without quotes
(too old to reply)
geissingert
2007-03-20 14:30:42 UTC
Permalink
HtmlElement elem = webBrowser1.Document.GetElementById("PageHtml");
string pageHtml = elem.InnerHtml;

I am using the following to read the innerhtml from a web page that I
created. When I read the information from the innerhtml the attributes do
not contain quotes:

if should be id="Text1" but what is returned is id=Text1. Is there any way
to set a property or value in the web page to return the attributes with the
quotes?

I have added the DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" to the top of the html
page and the following xmlns="http://www.w3.org/1999/xhtml" to the html tag.

What I am trying to do is keep the content in xhtml format.

Any help would be greatly appreciated.
unknown
2009-09-17 06:41:10 UTC
Permalink
Hi,
In my blog, I have an article about converting the innerHTML content to XHTML format.....
find it in <a href="http://tedscape.blogspot.com" ></a>
Regards,
Jacob



Posted as a reply to:

HtmlElement InnerHtml attributes returning without quotes

HtmlElement elem = webBrowser1.Document.GetElementById("PageHtml");
string pageHtml = elem.InnerHtml;

I am using the following to read the innerhtml from a web page that I
created. When I read the information from the innerhtml the attributes do
not contain quotes:

if should be id="Text1" but what is returned is id=Text1. Is there any way
to set a property or value in the web page to return the attributes with the
quotes?

I have added the DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" to the top of the html
page and the following xmlns="http://www.w3.org/1999/xhtml" to the html tag.

What I am trying to do is keep the content in xhtml format.

Any help would be greatly appreciated.

EggHeadCafe - Software Developer Portal of Choice
WCF Workflow Services Using External Data Exchange
http://www.eggheadcafe.com/tutorials/aspnet/3d49fa0d-a120-4977-842a-6dafb17b6d74/wcf-workflow-services-usi.aspx
Loading...