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

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

A base class for XML document handlers. More...

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

## Protected Member Functions
| 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
| $useInternalErrors
| $errorTypes

## Detailed Description

A base class for XML document handlers.

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

Definition at line 18 of file XmlBase.php.

## Member Function Documentation

## ◆ collectErrors()

eZ\Publish\Core\FieldType\RichText\XmlBase::collectErrors | ( |  | ) |
| protected

Returns formatted errors from libxml error buffer and restores previous setting for libxml error handling.

Before calling this method error recording must be started by calling startRecordingErrors().

See also
  startRecordingErrors()

@uses ::formatLibXmlError()

Exceptions

Definition at line 100 of file XmlBase.php.

References eZ\Publish\Core\FieldType\RichText\XmlBase\formatLibXmlError().

Referenced by eZ\Publish\Core\FieldType\RichText\Converter\Xslt\convert(), and eZ\Publish\Core\FieldType\RichText\Validator\validate().

## ◆ formatLibXmlError()

eZ\Publish\Core\FieldType\RichText\XmlBase::formatLibXmlError | ( | LibXMLError | $error | ) |
| protected

Formats libxml error object as a string.

Example: Error in 6:0: Expecting an element title, got nothing

Parameters

  \LibXMLError | $error |

Returns
  string

Definition at line 63 of file XmlBase.php.

Referenced by eZ\Publish\Core\FieldType\RichText\XmlBase\collectErrors().

## ◆ loadFile()

eZ\Publish\Core\FieldType\RichText\XmlBase::loadFile | ( |  | $path | ) |
| protected

Returns DOMDocument object loaded from given XML file $path.

Parameters

  string | $path |

Returns
  \DOMDocument

Definition at line 46 of file XmlBase.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Converter\Xslt\getXSLTProcessor(), and eZ\Publish\Core\FieldType\RichText\Validator\schematronValidate().

## ◆ startRecordingErrors()

eZ\Publish\Core\FieldType\RichText\XmlBase::startRecordingErrors | ( |  | ) |
| protected

Enables user handling of libxml errors and clears error buffer.

Previous setting for libxml error handling is remembered.

This method is intended to be used together with collectErrors().

Definition at line 80 of file XmlBase.php.

Referenced by eZ\Publish\Core\FieldType\RichText\Converter\Xslt\convert(), and eZ\Publish\Core\FieldType\RichText\Validator\validate().

## Member Data Documentation

## ◆ $errorTypes

eZ\Publish\Core\FieldType\RichText\XmlBase::$errorTypes
| protected

Initial value:
= [
LIBXML_ERR_WARNING => 'Warning',
LIBXML_ERR_ERROR => 'Error',
LIBXML_ERR_FATAL => 'Fatal error',
]

Definition at line 33 of file XmlBase.php.

## ◆ $useInternalErrors

eZ\Publish\Core\FieldType\RichText\XmlBase::$useInternalErrors
| protected

Definition at line 26 of file XmlBase.php.

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

- XmlBase.php

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