On Tue, 12 Jun 2012 21:50:15 +0100, Hisateru Tanaka <tanakahisat...@gmail.com> wrote:

In another branch I started to let PHPTAL allow using with illegal
namespace. See:
https://github.com/pornel/PHPTAL/compare/html5_with_ns#L4R97

Thanks for fixing empty elements and HTML5 attributes!

I think the namespace fix needs to handle some more cases:

<xhtml:p xhtml="http://www.w3.org/1999/xhtml";></xhtml:p>

must be output in HTML5 mode as:

<p></p>

since that's a proper XHTML input from XML/DOM perspective. That's why the code was ignoring prefixes.


I wouldn't mind if:

<foo:p xhtml="http://example.com/foons";></foo:p>

was output as:

<foo:p></foo:p>

although it saddens me that's needed only for Google's invalid markup and now-deprecated FBML.


I'm not so sure about xmlns attributes. The "http://www.w3.org/1999/xhtml"; declaration is certainly not needed in HTML5. I think it may be better to omit other xmlns attributes too to avoid giving false impression that HTML5 has namespaces. It only has tags with invalid ":" character in them and ignores xmlns attributes for compatibility with "polyglot" XHTML documents (but HTML5 mode is inappropriate for polyglot documents).

Even in HTML5 output mode PHPTAL still is supposed to parse input as XML. As long as TAL claims to be XML-based language I think it should follow XML rule and require namespace declarations.

Ignoring of namespace declarations would be appropriate if PHPTAL had HTML5 *input* mode (parse HTML5 and output it as either HTML5 or XHTML).

--
regards, Kornel Lesiński

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to