Welcome Guest Search | Active Topics | Sign In | Register

EO Webview html source is stripping self closing tags Options
AChallenger
Posted: Wednesday, February 26, 2014 4:23:47 PM
Rank: Newbie
Groups: Member

Joined: 2/11/2014
Posts: 3
We're finding that the HTML returned by the GetHtml() method on the Webview is stripping out the closing "/" character on self closing tags.

If we pass in source containing: <meta charset="UTF-8" />

The same tag will be returned as: <meta charset="UTF-8">

Note that both the trailing / and the space are missing.

We're using javascript to resize the content and need to get the result back to verify that the resize occurred in testing. Unfortunately we aren't able to parse the result as it is no longer valid XML.

Any suggestions? Is it possible that output is getting escaped incorrectly?
eo_support
Posted: Thursday, February 27, 2014 12:28:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,196
Hi,

That's normal. For some reason Chrome doesn't return format in self-closed syntax. You can run Chrome browser, then go to JavaScript console and check the value of the JavaScript expression "document.documentElement.outerHTML". It will return the HTML in the same way. We looked into the chrome's source code and noticed that it only return in self-closed format when the document is an XHTMLDocument instead of a HTMLDocument. However it appears that any HTML document is loaded as a HTMLDocument, not as an XHTMLDocument, even if it is has the correct XHTML header and namespace. The only way to create an XHTMLDocument is through this function:

https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation.createDocument

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.