Search

Awesome. I was unaware of this, cheers!

This has been discussed, but unfortunately it has certain limits.

If you put the xml tag before an HTML5 doctype, it becomes XHTML5 and should validate as such, so any Faceballs namespaces can be used in an HTML5 document.

<?xml version="1.0" encoding="utf-8"?>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

</html>    

Document example and document validation, notice the content type.

@designermonkey: The example page says that you will need to serve alternate content to Internet Exploder. :-(

This still seems to be the cleanest solution for libxslt based parser:

<xsl:template match="/">
    <xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html&gt;</xsl:text>

No, the cleanest solution is the HTML5 Doctype extension. :-)

This has been discussed, but unfortunately it has certain limits.

What limits exactly?

so any Faceballs namespaces can be used in an HTML5 document.

Meanwhile, namespaces are back (sort of) in HTML5 and should work properly:

<html prefix="og: http://ogp.me/ns#">
<head>
<title>The Rock (1996)</title>
<meta property="og:title" content="The Rock" />
<meta property="og:type" content="video.movie" />
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/" />
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
...
</head>
...
</html>

Also, XFBMLis considered deprecated, most Facebook Social Plugins offer an HTML5 compliant alternative by now.

What limits exactly?

If you read the whole discussion, you will see why Nick created the HTML5 Doctype extension. It is the only solution that lets you generate XHTML "as usual" (i.e. with all the benefits, also in the XSLT parser) and simply "hack" the doctype afterwards.

It is the only solution that lets you generate XHTML "as usual" (i.e. with all the benefits, also in the XSLT parser) and simply "hack" the doctype afterwards.

Sorry, don't get it. XHTML "as usual" (with all the benefits, xml namespaces etc.) is not valid HTML5, so why bother with an HTML5 doctype at all under these circumstances?

If your templates create XHTML and you use the HTML5 Doctype extension, you can get perfectly valid HTML5. (HTML5 can include "XHTML-style" code, it doesn't need to be a mess.)

If your templates create XHTML and you use the HTML5 Doctype extension, you can get perfectly valid HTML5. (HTML5 can include "XHTML-style" code, it doesn't need to be a mess.)

"XHTML-style" code (which I use) isn't proper XHTML with all benefits (namespaces, etc.).

<xsl:output doctype-system="about:legacy-compat" method="html" /> is perfectly fine with XHTML-style code.

If you put the xml tag before an HTML5 doctype, it becomes XHTML5 and should validate as such, so any Faceballs namespaces can be used in an HTML5 document.

As far as I know, the doctype isn't required at all for proper XHTML5, because this information is already given through the namespace. You have to serve XHTML5 as content type application/xml instead of text/html, which brings along other (browser) issues.

Most Facebook stuff is HTML5 compliant by now, so you don't have to use the old XML / XFBML stuff anymore.

By the way, just trying to figure out if I'm missing something important here. Wouldn't debate stuff like this just for the sake of an argument.

Also, <xsl:output doctype-system="about:legacy-compat" method="html" /> is perfectly fine with that.

No output indenting then, right?

I didn't want to get involved in this (old) discussion again, I just wanted to help.

Personally I don't like HTML5, simply because it doesn't need to conform to XML standards. That is a big mistake. The greatest promise of HTML5, the video element, has been killed by browser manufacturers who don't accept a single video standard. The second biggest thing is data attributes (which I simply use in XHTML pages — no browser will vomit on that). Anything else? Browser-side form validation? Terrible browser support. Additional semantic elements? Inconsistent. (How can you allow a header and a footer in articles, but no body element? Isn't that strange?) The list doesn't end here…

I have to go back to work now.

No output indenting then, right?

I don't use output indentation.

I just wanted to help.

Yeah, thanks. I guess the outcome is, since I don't need output indentation, I'm fine with the W3C recommended approach. Everyone else should use the extension?

Personally I don't like HTML5, simply because it doesn't need to conform to XML standards.

Me neither, but that's not the discussion here. Instead, it's a perfect example where sticking to old legacy standards (XHTML, XSLT) just because we like them better causes a lot of unnecessary problems when the world around moves on with shittier stuff (HTML5).

Yeah, thanks. I guess the outcome is, since I don't need output indentation, I'm fine with the W3C recommended approach. Everyone else should use the extension?

I guess it boils down to this, yep (if you don't run into namespace issues).

the world around moves on with shittier stuff

Nice. :-) However, I wouldn't go thus far and call XSLT a legacy standard. But that's not the discussion here neither.

If you want code indent:

  <xsl:output method="xml"
    doctype-system="about:legacy-compat"
    omit-xml-declaration="yes"
    encoding="UTF-8"
    indent="yes" />

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details