About
The Dom_Template class is the key Object that the entire Tropotek Framework depends on. As a template system I think the Dom_Template gives Developers and Designers a nicely defined boundary to ease communication and separate responsibility.
Designers can learn how build their own templates fast and easily, once they are given to the developer he can read the template an instantly know what variables are required and where they go. Now the communication between developers and designers is streamlined and less bugs can creep in.
The Dom_Template lib relies heavily on the PHP DOM Lib, it is in essence a wrapper around the DOMDocument object to allow us to create many templates rapidly per page load. The DOM_Template rendering system speed is fast and compared to other template systems.
Being based on the DOM it allows for the creation of templates for any XML based documents not just HTML. As XML is the base protocol, it means that for HTML pages we need to implement the XHTML protocol and ensure our HTML documents are coded to follow the XHTML strict rules.
Some of the common things that make a template fall over (or error out) is because tags are not closed or the use of html entities, XML does not understand entities like . You should get used to using   numbered entities. The only entities XML understands that are common are & < and >.
Before you continue, it is recommended that you have a basic understanding of how the DOM works before using the DOM_Template system... So look on the net and get some books on the topic, trust me you will not regret it. But to use the template system you do not need to be fluent at the DOM and its tools, that's why we built the DOM_Template to take away the tedious implementation of node traversing functions.
The Dom_Template utilises three tag attributes that can be added to any tag in your template, they are `VAR`, `CHOICE`, `REPEAT`. By employing these tags into your XHTML document you can get it ready for the Dom_Template parser.
You will notice that we do not use any XML name-spacing in our templates, that is because the final template that is rendered will not have these attributes in them on the final render stage they are removed so we are left with a valid XHTML/XML document.
To get an understanding of what can be done with the Dom_Template system this site and its Wiki has been created using these libs.