This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16787 - [Templates]: Specify that XML parsing doesn't do anything special with <template>
Summary: [Templates]: Specify that XML parsing doesn't do anything special with <templ...
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - Component Model (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Dimitri Glazkov
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 15476
  Show dependency treegraph
 
Reported: 2012-04-18 18:09 UTC by Rafael Weinstein
Modified: 2012-10-04 00:04 UTC (History)
4 users (show)

See Also:


Attachments

Description Rafael Weinstein 2012-04-18 18:09:54 UTC
The spec should make clear that it is a non-goal to create an inert mechanism for XML documents, and that the behavior of parsing template children by the XML parser is exactly as if the template element had been created via createElement and children appended to it (i.e. nothing special).
Comment 1 Rafael Weinstein 2012-08-16 18:39:44 UTC
I'm actually not sure it makes sense to mention XML or not. Thoughts?
Comment 2 Samuel Bronson 2012-09-25 16:45:11 UTC
If <template> is going to be treated as just another element in the XHTML syntax, it *would* probably be a good idea to state that directly in <http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/templates/index.html#definitions>; rather than relying on the reader getting that out of:

  "The template contents must be declared using the HTML syntax in an HTML document."

Incidentally, why is that a non-goal?  (Is there an ML thread about it?)
Comment 3 Rafael Weinstein 2012-10-04 00:03:32 UTC
@Samuel, in XHTML, the template element will behave the same placed in the DOM, however, the difference is that XML parser allows for no element-specific parsing behavior, thus the XML parser is incapable of directing tokens to the |content| of the template.

Thus, the following:

<template><div></div></template>

when served in XHTML will produce a template with a div firstChild, where as HTML will produce a template with no children and a |content| DocumentFragment with a div as its firstChild.
Comment 4 Rafael Weinstein 2012-10-04 00:04:53 UTC
The spec is clear that the parser changes apply only to HTML. Upon reflection, it seems obvious that the XML parser isn't changed because it is never mentioned.