FluentDOM\Document::createElementNS PHP Method

createElementNS() public method

public createElementNS ( string $namespaceURI, string $qualifiedName, string | null $content = null ) : Element
$namespaceURI string
$qualifiedName string
$content string | null
return Element
    public function createElementNS($namespaceURI, $qualifiedName, $content = null)
    {
        $node = parent::createElementNS($namespaceURI, $qualifiedName);
        $this->appendContent($node, $content);
        return $node;
    }

Usage Example

Example #1
0
 /**
  * Load the json string into an DOMDocument
  *
  * @param mixed $source
  * @param string $contentType
  * @param array|\Traversable|Options $options
  * @return Document|Result|NULL
  */
 public function load($source, $contentType, $options = [])
 {
     if (FALSE !== ($json = $this->getJson($source, $contentType))) {
         $document = new Document('1.0', 'UTF-8');
         $document->appendChild($root = $document->createElementNS(self::XMLNS, 'json:json'));
         $this->transferTo($root, $json);
         return $document;
     }
     return NULL;
 }
All Usage Examples Of FluentDOM\Document::createElementNS