html5 template support

The HTML5 TEMPLATE
<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template> tag is
designed to work with slots passed from the template instantiation payload.
For XSLT perhaps it means the immediate children of XML root element.

While it is handny in some limited cases, it is not enough as templating
language and engine. There are some discussions on w3c around its
limitations and needs for replacement.

You can see the showcases for TEMPLATE slots on
https://unpkg.com/@epa-wg/custom-element@0.0.21/index.html


HTML5 TEMPLATE is not a real template as can not be reused across instances
and has to be re-instantiated every time by JS API or by DOM parser in case
of  *shadowrootmode* attribute defined.

There is nothing to stop the <template> support in XSLT but the shadow root
messes things up.

<custom-element> has support for non-shadow root mode as in sample link ^^.
In order to avoid the misuse the TEMPLATE from html and xslt namespace, the
xslt:template namespace have to be stated explicitly in the scope of
<custom-element>.

Having TEMPLATE supported in XSLT4+ would make the adoption easier but
integration into the w3c html standard way harder. It would be nice to have
a discussion on the potential obstacles and the way to overcome them.


PS. from QT4CG meeting 080 draft minute, 4/5 June 2024, Prague, CZ
> 2.2.4. 75, Support processing HTML 5 template element content

   We wish RD was here to explain HTML templates.
     * JLO: The content of the template element isn't visible in the DOM.
       It's used for instantiating something

   Some attempt to understand the meaning of a template element.
     * JLO: It's used when creating new instances.
     * MK: If this is an HTML feature, users will want to be able to
       create them through the HTML serialization method.
          + ... If the parse-html function does something special, does it
            round-trip?

   "Revisit"

Received on Wednesday, 12 June 2024 16:01:01 UTC