Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. XmlEncoder.php

function XmlEncoder::isElementNameValid

Checks the name is a valid xml element name.

1 call to XmlEncoder::isElementNameValid()
XmlEncoder::buildXml in vendor/symfony/serializer/Encoder/XmlEncoder.php
Parse the data and convert it to DOMElements.

File

vendor/symfony/serializer/Encoder/XmlEncoder.php, line 215

Class

XmlEncoder
@author Jordi Boggiano <j.boggiano@seld.be> @author John Wards <jwards@whiteoctober.co.uk> @author Fabian Vogler <fabian@equivalence.ch> @author Kévin Dunglas <dunglas@gmail.com> @author Dany Maillard…

Namespace

Symfony\Component\Serializer\Encoder

Code

protected final function isElementNameValid(string $name) : bool {
    return $name && !str_contains($name, ' ') && preg_match('#^[\\pL_][\\pL0-9._:-]*$#ui', $name);
}
RSS feed
Powered by Drupal