koara / koara-xml
Koara to Xml parser written in PHP
0.15.0
2017-07-03 03:11 UTC
Requires
- php: >=5.4.0
- koara/koara: ^0.15.0
Requires (Dev)
- phpunit/phpunit: ~4.8 || ~5.1
This package is not auto-updated.
Last update: 2024-11-13 21:00:52 UTC
README
Koara-php-xml
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.
Getting started
-
Download ZIP file
-
Composer
$ composer require koara/koara-xml
Usage
<?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(); ?>
Configuration
You can configure the Renderer:
-
$renderer->setDeclarationTag($declarationTag)
Default:null
Add an XML Declaration Tag add the top of the generated output.