php-extended/php-html-transformer-cdata-filter

A filter for html trees that removes cdata nodes

2.0.1 2020-03-30 08:08 UTC

This package is auto-updated.

Last update: 2020-03-30 06:09:06 UTC


README

A filter for html trees that removes cdata nodes.

Installation

The installation of this library is made via composer. Download composer.phar from their website. Then add to your composer.json :

	"require": {
		...
		"php-extended/php-html-transformer-cdata-filter": "^2",
		...
	}

Then run php composer.phar update to install this library. The autoloading of all classes of this library is made through composer's autoloader.

Basic Usage

To filter a dom node, do the following :


use PhpExtended\HtmlTransformerCDataFilter;

/* @var $dom \PhpExtended\Html\HtmlAbstractNodeInterface */
$filter = new HtmlTransformerCdataFilter();
$filtered = $filter->transform($dom);
// $filtered instanceof \PhpExtended\Html\HtmlAbstractNodeInterface
// but without cdata nodes

License

MIT (See license file).