Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\FieldType\RichText\Validator Class Reference

Validates XML document using ISO Schematron (as XSLT stylesheet), XSD and RELAX NG schemas. More...

Inheritance diagram for eZ\Publish\Core\FieldType\RichText\Validator:

## Public Member Functions
| __construct (array $schemas)
| validate (DOMDocument $document)
| Performs validation on given $document using injected schema files and returns validation errors. More...

## Protected Member Functions
| validateBySchema (DOMDocument $document, $schema)
| Performs validation on given $document using given $schema file and returns validation errors. More...
| schematronValidate (DOMDocument $document, $filename)
| Validates given $document using XSLT stylesheet converted from ISO Schematron schema and returns an array or error messages. More...
| formatSVRLFailure (DOMElement $failedAssert)
| Returns SVRL assertion failure as a string. More...
Protected Member Functions inherited from eZ\Publish\Core\FieldType\RichText\XmlBase
| loadFile ($path)
| Returns DOMDocument object loaded from given XML file $path. More...
| formatLibXmlError (LibXMLError $error)
| Formats libxml error object as a string. More...
| startRecordingErrors ()
| Enables user handling of libxml errors and clears error buffer. More...
| collectErrors ()
| Returns formatted errors from libxml error buffer and restores previous setting for libxml error handling. More...

## Protected Attributes
| $schemas
Protected Attributes inherited from eZ\Publish\Core\FieldType\RichText\XmlBase
| $useInternalErrors
| $errorTypes

## Detailed Description

Validates XML document using ISO Schematron (as XSLT stylesheet), XSD and RELAX NG schemas.

Deprecated:
  since 7.4, use \EzSystems\EzPlatformRichText\eZ\RichText\Validator\Validator from EzPlatformRichTextBundle.

Definition at line 20 of file RichText/Validator.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\FieldType\RichText\Validator::__construct | ( | array | $schemas | ) |

Parameters

  string[] | $schemas | Paths to schema files to use for validation

Definition at line 32 of file RichText/Validator.php.

References eZ\Publish\Core\FieldType\RichText\Validator\$schemas.

## Member Function Documentation

## ◆ formatSVRLFailure()

eZ\Publish\Core\FieldType\RichText\Validator::formatSVRLFailure | ( | DOMElement | $failedAssert | ) |
| protected

Returns SVRL assertion failure as a string.

Parameters

  \DOMElement | $failedAssert |

Returns
  string

Definition at line 147 of file RichText/Validator.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Validator\schematronValidate().

## ◆ schematronValidate()

eZ\Publish\Core\FieldType\RichText\Validator::schematronValidate | ( | DOMDocument | $document,
|  |  | $filename
| ) |  |
| protected

Validates given $document using XSLT stylesheet converted from ISO Schematron schema and returns an array or error messages.

Parameters

  \DOMDocument | $document |
  string | $filename |

Returns
  string[]

Definition at line 118 of file RichText/Validator.php.

References eZ\Publish\Core\FieldType\RichText\Validator\formatSVRLFailure(), and eZ\Publish\Core\FieldType\RichText\XmlBase\loadFile().

Referenced by eZ\Publish\Core\FieldType\RichText\Validator\validateBySchema().

## ◆ validate()

eZ\Publish\Core\FieldType\RichText\Validator::validate | ( | DOMDocument | $document | ) |

Performs validation on given $document using injected schema files and returns validation errors.

Handles ISO Schematron (as XSLT stylesheet), XSD and RELAX NG schemas.

Exceptions

Definition at line 48 of file RichText/Validator.php.

References eZ\Publish\Core\FieldType\RichText\XmlBase\collectErrors(), eZ\Publish\Core\FieldType\RichText\XmlBase\startRecordingErrors(), and eZ\Publish\Core\FieldType\RichText\Validator\validateBySchema().

## ◆ validateBySchema()

eZ\Publish\Core\FieldType\RichText\Validator::validateBySchema | ( | DOMDocument | $document,
|  |  | $schema
| ) |  |
| protected

Performs validation on given $document using given $schema file and returns validation errors.

Exceptions

Definition at line 78 of file RichText/Validator.php.

References eZ\Publish\Core\FieldType\RichText\Validator\schematronValidate().

Referenced by eZ\Publish\Core\FieldType\RichText\Validator\validate().

## Member Data Documentation

## ◆ $schemas

eZ\Publish\Core\FieldType\RichText\Validator::$schemas
| protected

Definition at line 27 of file RichText/Validator.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Validator\__construct().

The documentation for this class was generated from the following file:

- RichText/Validator.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.