PHP Class eZ\Publish\Core\FieldType\RichText\Normalizer\DocumentTypeDefinition

Note: if input already contains DTD it won't be accepted for normalization.
Inheritance: extends eZ\Publish\Core\FieldType\RichText\Normalizer
Datei anzeigen Open project: ezsystems/ezpublish-kernel

Public Methods

Method Description
__construct ( $documentElement, $namespace, $dtdPath )
accept ( string $input ) : boolean Accept if $input looks like XML document, with configured document element and default namespace, but without DTD.
normalize ( string $input ) : string Normalizes given $input by adding DTD with character entity definition.

Private Methods

Method Description
getExpression ( ) : string Computes and returns regular expression pattern for matching and replacement.

Method Details

__construct() public method

public __construct ( $documentElement, $namespace, $dtdPath )

accept() public method

Accept if $input looks like XML document, with configured document element and default namespace, but without DTD.
public accept ( string $input ) : boolean
$input string
return boolean

normalize() public method

Normalizes given $input by adding DTD with character entity definition.
public normalize ( string $input ) : string
$input string
return string