2.9. XML-Syntax Mode

This is a special compiler mode enabled by the xmlsyntaxMode configuration directive. It adds several XML-style tag delimiters that may be used to make your template fully XML-compilant. Standard { and } delimiters are still available. Remember that this is only an emulation. OPT does not have, if fact, a real XML parser, and it is not able to detect many of invalid XML syntax usages.

The delimiters defined by this mode are:

<namespace:YOURCODEHERE>
</namespace:YOURCODEHERE>
<namespace:YOURCODEHERE/>

By default, OPT registers only the opt namespace, but if you use some unofficial add-ons, they might have their own ones. A sample section in this mode looks like this:

Example 2.70. Sections and XML Syntax Mode

<ul>
<opt:section name="list">
<li>{$list.item}</li>
</opt:section>
</ul>

XML syntax mode enables also two additional configuration directives: strictSyntax (all the instructions are forced to use native parameter parser) and entities (parsing HTML entities).

In OPT 1.0.0, the CDATA section was also parsed by OPT, like the {literal} instruction, but starting from 1.0.1, it is not parsed anymore because of problems with XHTML code generating.