This is a tiny library for emitting XML. Or XHTML.
Its intended use is to replace HTML/PHP template code with something easier to read and write and manipulate.
e.g. instead of
<p>Hi my name is <?php echo htmlspecialchars($name); ?></p>
you would construct a PAXML value like:
$value = ['p', 'Hi my name is ', $name];
and then output it using
EarthIT_PAXML::emit($value);
If you need a Nife_Blob, make one like so:
$blob = new EarthIT_PAXML_PAXMLBlob($value);
Scalars represent text.
Arrays represent elements.
The 0th element of an array gives the tag name.
Subsequent numerically-keyed elements of an array give sub-tags.
String-keyed elements of an array give attribute values.
['p', 'style'=>'color: green', 'I like ', ['span', 'style'=>'color: red', 'food'], '.']
Will be emitted as:
<p style="color: green">I like <span style="color: red">food</span>.</p>