dev-master
9999999-devsmall xml prettyfier that uses no libs
WTFPL
The Requires
- php >=7.0.0
The Development Requires
xml beautifier prettyfier nolibs
Wallogit.com
2017 © Pedro Peláez
small xml prettyfier that uses no libs
Xml prettifier that uses no libs or packages., (*1)
You can add this library as a local, per-project dependency to your project using Composer:, (*2)
composer require kasparsu/prettyxml
If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:, (*3)
composer require --dev kasparsu/prettyxml
The Prettyfier class can be used to generate a formated representation of the raw XML input:, (*4)
<?php
$pretty = new \Kasparsu\PrettyXml\Prettyfier('<apply><csymbol encoding="OpenMath"><msub><mi>P</mi><mn>1</mn></msub></csymbol><ci>x</ci></apply>', "\t");
print $pretty->prettify();
The code above yields the output below:, (*5)
<apply>
<csymbol encoding="OpenMath">
<msub>
<mi>P</mi>
<mn>1</mn>
</msub>
</csymbol>
<ci>x</ci>
</apply>
You can run docker enviroment using, (*6)
docker-compose up -d
to run tests use, (*7)
docker-compose exec app vendor/bin/phpunit
to run examples, (*8)
docker-compose exec app php example/example.php docker-compose exec app php example/example3mb.php docker-compose exec app php example/example200kb.php
small xml prettyfier that uses no libs
WTFPL
xml beautifier prettyfier nolibs