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

Breadcrumb

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

function XMLSerializer::addToken

1 call to XMLSerializer::addToken()
XMLSerializer::toXML in vendor/theseer/tokenizer/src/XMLSerializer.php

File

vendor/theseer/tokenizer/src/XMLSerializer.php, line 63

Class

XMLSerializer

Namespace

TheSeer\Tokenizer

Code

private function addToken(Token $token) : void {
    if ($this->previousToken
        ->getLine() < $token->getLine()) {
        $this->writer
            ->endElement();
        $this->writer
            ->startElement('line');
        $this->writer
            ->writeAttribute('no', (string) $token->getLine());
        $this->previousToken = $token;
    }
    if ($token->getValue() !== '') {
        $this->writer
            ->startElement('token');
        $this->writer
            ->writeAttribute('name', $token->getName());
        $this->writer
            ->writeRaw(\htmlspecialchars($token->getValue(), \ENT_NOQUOTES | \ENT_DISALLOWED | \ENT_XML1));
        $this->writer
            ->endElement();
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal