$x->span("hi")
= <span>hi</span>
$x->xml("span", "hi")
= <span>hi</span>
$x->span(array('class'=>'test'), "hi")
= <span class="test">hi<span>
$x->span("XML",
$x->i("Fast"),
$x->b("Create")
)
= <span>XML<i>Fast</i><b>Create</b></span>
$x->span('')
= <span></span>
$x->br()
= <br />
$body = $x->div( $x->p("hello") );
$x->body($body);
$x->quote("a > b") To convert HTML special tags (if quote option is false)
$x->noquote(" ") To not convert HTML special tags (if quote option is true)
$x->comment( $x->p("hello") ) To make XML comments
$x->cdata("alert(\"Let's Go !\");") To make CDATA section
$x->getXML() To get the XML output
$x->isValid() To control your XML with the DTD
$x->toXML() To write and control XML
$x->importXML() To convert XML text to XML driver format
$x->exportXML() To convert XML driver format to XML text
Use the internal tool( Require XML_DTD package )
Or define an external program (like xmllint)
Text : return strings
XML_Tree : return XML_Tree objects( Require XML_Tree package )
Or make your own ! :-)
$x->news(
$x->title("Title"),
$x->desc("Description")
)
Replaced by :
<div class="news">
<h1><span>Title</span></h1>
<p>Description</p>
</div>
'translate' => array(
'news' => array('<div class="news">', '</div>'),
'title' => array('<h1><span>', '</span></h1>'),
'desc' => array('<p>', '</p>'),
)
You can also use shortcuts :
'news' => array('<div class="news">', '</div>')
shortcut : 'news' => array()
'desc' => array('<p>', '</p>')
shortcut : 'desc' => array('p')
$x->title("Title")
= <h1><span>Title</span></h1>
$x->_title("Title")
= <title>Title</title>
Attributes and contents are automatically quoted, but you can set option 'quote' to false and use $x->quote()
Set the 'indent' option to true to make XML indentation( Require XML_Beautifier package )
Set the the destination file in the 'file' option
Each driver has these basic options :
'version' To set the xml version (default = '1.0')
'encoding' To set the xml encoding (default = 'UTF-8')
'standalone' To set the xml standalone (default = 'no')
'doctype' To set the doctype (doctype constants exists)
'quote' To quote attributes and contents (default = true)
But you can replace overloading by a tags list(see Example 5)
Give the name of the HTML file and the output file
Select the HTML text, call the macro and your selected text will be rewrited to FastCreate syntax !
