Zk 5.0.10 seemingly generates invalid html markup

asked 2012-02-09 11:51:54 +0800

cvarona gravatar image cvarona
554 1 6


I'm trying to use some of the available open source html2image utilities available in order to capture the html generated by the zul renderer into an image. While html2image does accept and process the html I fed to her by applying the tip in this forum question, flying saucer complains about the provided html not being valid. I've inspected the obtained html and compared it with that unveiled by using firebug's html inspector. They're the same and do indeed contain invalid html markup, for instance:

    <div class="z-vlayout-inner" id="dFUYt3-chdex">
        <img src="/zksandbox/zkau/view/z_9m00/dFUYt3/a4h1/1/c/captcha1328787157810.png" style="width:150px;height:50px;" id="dFUYt3">

Am I doing something that might prevent the html from being generated or retrieved as valid markup? Is it some bug to be fixed in a forthcoming zk release?

With kind regards

César Varona

delete flag offensive retag edit

4 Replies

Sort by » oldest newest

answered 2012-02-15 01:38:55 +0800

matthewgo gravatar image matthewgo

Hi César,
Do you mean the img tag does not have a end tag ?

link publish delete flag offensive edit

answered 2012-02-15 07:52:55 +0800

cvarona gravatar image cvarona
554 1 6

Hi Matthew,

yes, and it's only an example. Other samples of not well-formedness can be found as well.

link publish delete flag offensive edit

answered 2012-02-15 12:53:23 +0800

gekkio gravatar image gekkio flag of Finland
899 1

You cannot do that kind of reasoning about HTML validity with Firebug's HTML inspector, because Firebug only sees the internal representation, not the source HTML that was used. You can verify that yourself by inspecting any img tag in any website. Even if the source HTML contains the self-closing tag, it will not appear when inspecting the element (at least in FF10).
The same thing applies to the innerHTML property in Javascript that is used in the forum post you mentioned. Here's a relevant stackoverflow question

It's also worth noting that HTML5 makes self-closing tags optional, so that markup is actually valid HTML 5.

link publish delete flag offensive edit

answered 2012-02-15 13:53:27 +0800

cvarona gravatar image cvarona
554 1 6

Hi Gekkio,

thanks for your accurate and well documented reply. I'm aghast at these details about Html5. I had never expected well-formedness would not become common law.

With kind regards

César Varona

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2012-02-09 11:51:54 +0800

Seen: 197 times

Last updated: Feb 15 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More