[TYPO3-50-general] Templating Engine - Validation and Autocompletion

Sebastian KurfŸürst sebastian at typo3.org
Fri Oct 24 23:53:49 CEST 2008


Hi Ernesto,

> Nice work, I would say! Thanks for your efford!
I'm glad you like it!

> Indeed it is a pretty "cutting edge" stuff we are dealing with. I did
> some quick research on embedding XHTML inside other XML documents so
> that everything could be validated and I didn't find any example which
> didn't embeded the whole XHTML strucure (including head,body).
Yes, and that's only a part of the problem:
If we did something like:

<f3:template>
	<!-- now, HTML is allowed and would be validated -->
	<html>
	<head>...</head>
	<body>
		<f3:for each...>
			<!-- this would _still_ be invalid, because the
			     body tag does not declare a child named
			     f3:for -->
		</f3:for>
	</body>
	</html>	

So, my conclusion was - as soon as we mix our tags and the XHTML tags, 
we need to either
a) extend XHTML -> see my first mail, IMHO that's quite a huge effort, 
and really difficult
b) write our own Schema for "XHTML Lite" which loosens many constraints 
XHTML sets (but which still might be improved in the future)

> The more I think about it, the more I expect that we cannot "add" the
> <f3> tags to a valid XHTML-document, because it might not even be XHTML
> but other template (maybe RSS or other XML dialect) we are creating. So
> <f3:template> might be the "top level element" on any template anyway?
I'm not sure about this. I think the most natural way would be if you 
could decide if you wanted to render the whole template, or just certain
<f3:section>...</f3:section> area (however we'll call them lateron).

> Usually a template won't even be a complete XHTML template, but just a
> "snippet":
> 
> <f3:template>
> 	<div>
> 		<f3:for each="$posts" as="post">
> 			<h1>{post.title}</h1>
> 		</f3:for>
> 	</div>
> </f3:template>
Yes, but I think the f3:template around does not really provide new 
information here, thus it can be omitted (Anyways, in case you still 
need some tag to have a namespace declaration, it could still work).
So I'd prefer a solution here where we say "The wrapping 
<f3:template>-Tag is optional, but you can use it if you want f.e. 
autocompletion in eclipse.

Greets,
Sebastian


More information about the TYPO3-project-5_0-general mailing list