HTML 5 versus XHTML 1.0 Transitional?

后端 未结 9 1695
Happy的楠姐
Happy的楠姐 2020-11-28 22:12

It seems that HTML 5 is going to be supported (partially) by Firefox 3.1 and other browsers. It is adding support for video and audio as tags, but these are new tags that XH

相关标签:
9条回答
  • 2020-11-28 22:38

    What is the behavior supposed to be if I use a new HTML 5 tag in a future version of Firefox but use the DTD for XHTML?

    And what if I mix HTML 5 markup with XHTML 1.0 Trans?

    If your markup isn't implemented as part of your chosen DTD - then logically, that markup shouldn't be followed. But browser implementations aren't always strictly logical.

    Why didn't they just add these tags to XHTML? How do we support both XHTML and HTML 5?

    xHTML is not better than HTML, but it's more suited to some applications. One of the main benefits of xHTML is that it can be transformed into different formats using XSLT. For example, you could use XSLT to automatically transform xHTML into an RSS feed or another XML format.

    You don't need to support both formats - weigh up the benefits/drawbacks for each with your project's requirements. HTML 5 probably won't be standard for quite some time.

    0 讨论(0)
  • 2020-11-28 22:43

    You might be looking at the problem the wrong way because the relationship to XHTML 1.x section, HTML 5 states:

    "This specification is intended to replace XHTML 1.0 as the normative definition of the XML serialization of the HTML vocabulary."

    Now that language is controversial (the XHTML 2 WG has disputed it and the HTML WG is trying to resolve the differences...) but that's where we stand right now.

    A couple of notes:

    • HTML 5 includes an XML serialization known as XHTML 5, the spec explains the differences if you're into nitty gritty details
    • HTML is not SGML. Henri Sivonen has done a great write up on the history of HTML parsing
    • As of this time (it has been a topic of debate several times), there won't be a DTD for HTML/XHTML 5 -- the Conformance Requirements section of the spec explains why a DTD isn't suitable for defining the HTML language. The HTML 5 validator also contains a wealth of information on this topic (including RELAX NG schemas for HTML5)
    0 讨论(0)
  • 2020-11-28 22:45

    (X)HTML5 is just the next version. You should be using XHTML1.1 until XHTML5 is well-supported.

    You probably should not use the backwards-compatability SGML profile of HTML5. It makes things harder for scrapers and small parsers.

    0 讨论(0)
提交回复
热议问题