Koara is a modular lightweight markup language. This project can render the koara AST to Xml in php.
The AST is created by the core koara parser.
-
Download ZIP file
-
Composer
$ composer require koara/koara-xml
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Koara\Parser;
use Koara\Xml\XmlRenderer;
$parser = new Parser();
$result = $parser->parse("Hello World!");
$renderer = new XmlRenderer();
$result->accept($renderer);
echo $renderer->getOutput();
?>
You can configure the Renderer:
-
$renderer->setDeclarationTag($declarationTag)
Default:null
Add an XML Declaration Tag add the top of the generated output.