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?
|
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.createDocumentThanks!
|