InterJinn

Development Framework For PHP

Jinn Compiler Tags

To make the web designer's life easy, a standard compiler for the JinnTemplate system is included which provides the interface to many of the most common structures available in a templating system. These tags will be pivotal in the development process of any massive Web site are are quite similar to the HTML tags with which you are already comfortable. For that matter, you will find they follow almost the same rules except that they are more strict than their HTML tag counterparts. This strictness just enforces that all tags must be closed, attributes be contained in double quotes ("), and tag names are case-sensitive. This functionality is similar to XML; however, they are viewed as isolated entities within a document. You will not need to use special entities (unless you display a valid tag) as you would in XML since the parser only parses out valid tags and everything else is treated as content.

The reason for ignoring the XML standard with respect to how a tag functions is that by only parsing out the valid tags we allow a document to be viewed in layers of context. This is important for allowing developers to design a cascade of compilers that may act upon the input. Another reason is that it makes it possible to update your content without needing to first worry about the well-formed-ness of the HTML structure. Because the LXML (Layered XML) functionality operates in a layered fashion, it becomes simple for a developer to create a simple compiler that handles only the relevant tags.

The LXML parser comes in two flavours - a PHP encoded version, and a PHP C extension version. If you compile in the C extension then you will notice a template compile time improvement of as much as ten times. The reason for both is to provide speed for those who can compile in extensions, and identical functionality for those stuck with an ISP package.

You will notice that all of the tag names consist of the jinn: prefix. This refers to the tag's space. If you create your own compiler and support tags, then you will define your own space. This makes it possible to clearly define tags of the same name but which should not be processed by the same compiler.