XML_FastCreate - Example 5

Use the same syntax without overloading

PHP source file

Others examples

With Zend Optimizer, the overload system will crash !

But you can disable overloading and keep the same syntax.

You must define the list of tags before include() into $_GLOBALS['XML_FASTCREATE_NO_OVERLOAD'] :

$_GLOBALS['XML_FASTCREATE_NO_OVERLOAD'] = array(
'html', 'head', 'title', 'body', 'style', 'div',
'h1', 'h3', 'p', 'a', 'br', 'hr', 'img', 'pre'
);
require_once 'XML/FastCreate/Text.php';
$x = new XML_FastCreate_Text();

If you use translation tags, add them to the list.

If a tag is a PHP reserved word, prefix it by underscore in the tags list and when you call it.

Tags lists exists for HTML 4.01 and XHTML 1.0, you can include the list like this :

require_once 'XML/FastCreate/tags/XHTML_1_0_STRICT.php';
require_once 'XML/FastCreate/Text.php';
$x = new XML_FastCreate_Text();