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

Breadcrumb

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

function OutputRules::namespaceAttrs

Write the namespace attributes.

Parameters

\DOMNode $ele The element being written.:

1 call to OutputRules::namespaceAttrs()
OutputRules::openTag in vendor/masterminds/html5/src/HTML5/Serializer/OutputRules.php
Write the opening tag.

File

vendor/masterminds/html5/src/HTML5/Serializer/OutputRules.php, line 300

Class

OutputRules
Generate the output html5 based on element rules.

Namespace

Masterminds\HTML5\Serializer

Code

protected function namespaceAttrs($ele) {
    if (!$this->xpath || $this->xpath->document !== $ele->ownerDocument) {
        $this->xpath = new \DOMXPath($ele->ownerDocument);
    }
    foreach ($this->xpath
        ->query('namespace::*[not(.=../../namespace::*)]', $ele) as $nsNode) {
        if (!in_array($nsNode->nodeValue, $this->implicitNamespaces)) {
            $this->wr(' ')
                ->wr($nsNode->nodeName)
                ->wr('="')
                ->wr($nsNode->nodeValue)
                ->wr('"');
        }
    }
}

API Navigation

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