You are here

final protected function XmlEncoder::isElementNameValid in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Encoder/XmlEncoder.php \Symfony\Component\Serializer\Encoder\XmlEncoder::isElementNameValid()

Checks the name is a valid xml element name.

Parameters

string $name:

Return value

bool

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 243

Class

XmlEncoder
Encodes XML data.

Namespace

Symfony\Component\Serializer\Encoder

Code

protected final function isElementNameValid($name) {
  return $name && false === strpos($name, ' ') && preg_match('#^[\\pL_][\\pL0-9._:-]*$#ui', $name);
}