<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: DOM vs. Template</title>
	<atom:link href="http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/</link>
	<description>News, opinion, and fresh thinking for web developers and designers. The official podcast of sitepoint.com.</description>
	<lastBuildDate>Sat, 07 Nov 2009 23:35:20 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Ren</title>
		<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/comment-page-1/#comment-824331</link>
		<dc:creator>Ren</dc:creator>
		<pubDate>Tue, 11 Nov 2008 00:22:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=3025#comment-824331</guid>
		<description>&lt;blockquote&gt;Is there any reason not to use class or id?&lt;/blockquote&gt;

After some tinkering, it&#039;s possible, but not sure its desirable. 

Would have a quicker template engine if it didn&#039;t have to look up template variables for every class or id it sees. 

The tinkering code is at http://homepage.ntlworld.com/jared.williams/php/template.php

2 classes, TemplateCompiler which compiles a html template down to a Template instance which could be cached to save the XML parsing/processing. 

Several limitations in the implementation, like no attribute values can be changed (due to limitations in XmlWriter)</description>
		<content:encoded><![CDATA[<blockquote><p>Is there any reason not to use class or id?</p></blockquote>
<p>After some tinkering, it&#8217;s possible, but not sure its desirable. </p>
<p>Would have a quicker template engine if it didn&#8217;t have to look up template variables for every class or id it sees. </p>
<p>The tinkering code is at <a href="http://homepage.ntlworld.com/jared.williams/php/template.php" rel="nofollow">http://homepage.ntlworld.com/jared.williams/php/template.php</a></p>
<p>2 classes, TemplateCompiler which compiles a html template down to a Template instance which could be cached to save the XML parsing/processing. </p>
<p>Several limitations in the implementation, like no attribute values can be changed (due to limitations in XmlWriter)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Godar</title>
		<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/comment-page-1/#comment-804205</link>
		<dc:creator>Godar</dc:creator>
		<pubDate>Mon, 06 Oct 2008 09:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=3025#comment-804205</guid>
		<description>@Troels
First, Thanks for having look at the project ;-)

There is really no need to use standard attributes in the template source files as long as it conforms to the XML standards. Those attributes are removed at render time and do not get rendered to the browser anyway. There could be an argument to use namespacing but for now it seems to work ok without all that over-complication.

The main aim was to produce a template language that a designer could learn fast then create/maintain templates for the developer with minimal developer consultation.

With the three tag language it is easy to explain how things work:

  * VAR: text and attribute values are replaced
  * CHOICE: Element blocks are shown or hidden
  * REPEAT: Used for all repeating data (tables. lists, results, etc)</description>
		<content:encoded><![CDATA[<p>@Troels<br />
First, Thanks for having look at the project ;-)</p>
<p>There is really no need to use standard attributes in the template source files as long as it conforms to the XML standards. Those attributes are removed at render time and do not get rendered to the browser anyway. There could be an argument to use namespacing but for now it seems to work ok without all that over-complication.</p>
<p>The main aim was to produce a template language that a designer could learn fast then create/maintain templates for the developer with minimal developer consultation.</p>
<p>With the three tag language it is easy to explain how things work:</p>
<p>  * VAR: text and attribute values are replaced<br />
  * CHOICE: Element blocks are shown or hidden<br />
  * REPEAT: Used for all repeating data (tables. lists, results, etc)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Troels Knak-Nielsen</title>
		<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/comment-page-1/#comment-802915</link>
		<dc:creator>Troels Knak-Nielsen</dc:creator>
		<pubDate>Fri, 03 Oct 2008 08:39:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=3025#comment-802915</guid>
		<description>@thr
That sounds interesting. I kind of like the prospect of only allowing access through classes (And perhaps id&#039;s), because it forces one to use the abstracted accessors. That way you are reasonably sure that you can replace the template later on. I wonder how such a strict strategy would stack up in practice, though.

@uhh
XLS solves a different problem really. And quite frankly, I think that it is a good example of over-engineering.

@Godar
I took a short look at your project. I see that you use non-standard attributes in the HTML. Is there any reason not to use class or id?</description>
		<content:encoded><![CDATA[<p>@thr<br />
That sounds interesting. I kind of like the prospect of only allowing access through classes (And perhaps id&#8217;s), because it forces one to use the abstracted accessors. That way you are reasonably sure that you can replace the template later on. I wonder how such a strict strategy would stack up in practice, though.</p>
<p>@uhh<br />
XLS solves a different problem really. And quite frankly, I think that it is a good example of over-engineering.</p>
<p>@Godar<br />
I took a short look at your project. I see that you use non-standard attributes in the HTML. Is there any reason not to use class or id?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Godar</title>
		<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/comment-page-1/#comment-802890</link>
		<dc:creator>Godar</dc:creator>
		<pubDate>Fri, 03 Oct 2008 06:51:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=3025#comment-802890</guid>
		<description>We just released a PHP DOM Template Engine at &lt;a href=&quot;http://www.domtemplate.com/&quot; rel=&quot;nofollow&quot;&gt;www.domtemplate.com&lt;/a&gt; it uses three tags var,choice and repeat to access a standard XHTML document. It works well in an object environment and is easy for a designer to understand so they can build templates for an application as well.

Its aim is to ensure designers can work in along side the developers.</description>
		<content:encoded><![CDATA[<p>We just released a PHP DOM Template Engine at <a href="http://www.domtemplate.com/" rel="nofollow">http://www.domtemplate.com</a> it uses three tags var,choice and repeat to access a standard XHTML document. It works well in an object environment and is easy for a designer to understand so they can build templates for an application as well.</p>
<p>Its aim is to ensure designers can work in along side the developers.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: uhh</title>
		<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/comment-page-1/#comment-800350</link>
		<dc:creator>uhh</dc:creator>
		<pubDate>Fri, 26 Sep 2008 09:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=3025#comment-800350</guid>
		<description>XSL anyone?</description>
		<content:encoded><![CDATA[<p>XSL anyone?</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Josh</title>
		<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/comment-page-1/#comment-800308</link>
		<dc:creator>Josh</dc:creator>
		<pubDate>Fri, 26 Sep 2008 06:20:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=3025#comment-800308</guid>
		<description>&lt;blockquote&gt;The main advantage is the HTML prototypes produced by web designers are actually usable and can even be maintained by the same people during production, without the need of any php knowledge.&lt;/blockquote&gt;

Designers around the world will undoubtedly rejoice. Finally creating templates wil be p*** easy for those hallowed and somewhat mythical creative types who are masters in the dark arts of CSS and HTML/XHTML standards with which they regularly transform simple paragraphs and headers into veritable disneyland like user interfaces, nonchalantly float divs with pinpoint accuracy through the gauntlet of CSS positioning, bestow their Utopian semantic vision upon us with weighty intellectual authority, but somehow lack the mental capacity or nous to handle a couple of echo statements.</description>
		<content:encoded><![CDATA[<blockquote><p>The main advantage is the HTML prototypes produced by web designers are actually usable and can even be maintained by the same people during production, without the need of any php knowledge.</p></blockquote>
<p>Designers around the world will undoubtedly rejoice. Finally creating templates wil be p*** easy for those hallowed and somewhat mythical creative types who are masters in the dark arts of CSS and HTML/XHTML standards with which they regularly transform simple paragraphs and headers into veritable disneyland like user interfaces, nonchalantly float divs with pinpoint accuracy through the gauntlet of CSS positioning, bestow their Utopian semantic vision upon us with weighty intellectual authority, but somehow lack the mental capacity or nous to handle a couple of echo statements.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: p.vernooij</title>
		<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/comment-page-1/#comment-799976</link>
		<dc:creator>p.vernooij</dc:creator>
		<pubDate>Thu, 25 Sep 2008 12:36:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=3025#comment-799976</guid>
		<description>I&#039;ve created something similar like this, since i really liked the way i could manipulate the DOM in JavaScript. Why not in PHP?

I&#039;ve used XPATH queries to select elements where content should be injected. ID&#039;s are also supported.

The main advantage is the HTML prototypes produced by web designers are actually usable and can even be maintained by the same people during production, without the need of any php knowledge.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve created something similar like this, since i really liked the way i could manipulate the DOM in JavaScript. Why not in PHP?</p>
<p>I&#8217;ve used XPATH queries to select elements where content should be injected. ID&#8217;s are also supported.</p>
<p>The main advantage is the HTML prototypes produced by web designers are actually usable and can even be maintained by the same people during production, without the need of any php knowledge.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: thr</title>
		<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/comment-page-1/#comment-799876</link>
		<dc:creator>thr</dc:creator>
		<pubDate>Thu, 25 Sep 2008 06:48:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=3025#comment-799876</guid>
		<description>Hi!

I (even more) recently posted an updated version of the pQuery library that allows you to keep the presentation generation code and the presentation markup in the same file, here&#039;s the post: &lt;a href=&quot;http://loveandtheft.org/2008/09/20/php-templating-in-53/&quot; rel=&quot;nofollow&quot;&gt;http://loveandtheft.org/2008/09/20/php-templating-in-53/&lt;/a&gt;

I still relies on the DOM-structure, meaning you&#039;ll be doing something like: &lt;code&gt;$root-&gt;li-&gt;something = &quot;Something else&quot;;&lt;/code&gt; But I have a local development version that is complete with a CSS selector, so you techincally can do this instead: &lt;code&gt;$root(&quot;#post-list li&quot;)-&gt;title = &quot;My title for something&quot;;&lt;/code&gt; which puts an abstraction layer in form of dom #id&#039;s and css-classes allowing you to move them around (in effect changing where the output gets pushed into the template without changing the php attached to it).

/ Fredrik Holmström</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>I (even more) recently posted an updated version of the pQuery library that allows you to keep the presentation generation code and the presentation markup in the same file, here&#8217;s the post: <a href="http://loveandtheft.org/2008/09/20/php-templating-in-53/" rel="nofollow">http://loveandtheft.org/2008/09/20/php-templating-in-53/</a></p>
<p>I still relies on the DOM-structure, meaning you&#8217;ll be doing something like: <code>$root-&gt;li-&gt;something = "Something else";</code> But I have a local development version that is complete with a CSS selector, so you techincally can do this instead: <code>$root("#post-list li")-&gt;title = "My title for something";</code> which puts an abstraction layer in form of dom #id&#8217;s and css-classes allowing you to move them around (in effect changing where the output gets pushed into the template without changing the php attached to it).</p>
<p>/ Fredrik Holmström</p>]]></content:encoded>
	</item>
	<item>
		<title>By: romrom</title>
		<link>http://www.sitepoint.com/blogs/2008/09/25/dom-vs-template/comment-page-1/#comment-799734</link>
		<dc:creator>romrom</dc:creator>
		<pubDate>Thu, 25 Sep 2008 00:08:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.sitepoint.com/blogs/?p=3025#comment-799734</guid>
		<description>hi there,
there is a MVC framework that uses DOM and which implemented the jQuery API.
but the project is very youth and the documentation is still only in french
&lt;a href=&quot;http://sloth-project.org&quot; rel=&quot;nofollow&quot;&gt;http://sloth-project.org&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>hi there,<br />
there is a MVC framework that uses DOM and which implemented the jQuery API.<br />
but the project is very youth and the documentation is still only in french<br />
<a href="http://sloth-project.org" rel="nofollow">http://sloth-project.org</a></p>]]></content:encoded>
	</item>
</channel>
</rss>
