protected function initNamespace(DOMDocument $document, $namespace_prefix = null)
    {
        // @todo: check for conflicting namespace prefixes
        $this->document_namespace = trim($document->documentElement->namespaceURI);
        $namespace_prefix = trim($namespace_prefix);

        if ($this->hasNamespace()) {
            $this->namespace_prefix = empty($namespace_prefix) ? $this->getDefaultNamespacePrefix() : $namespace_prefix;

            $this->registerNamespace(
                $this->namespace_prefix,
                $this->document_namespace
            );
        }
    }
protected function initNamespace(DOMDocument $document, $namespace_prefix = null)
    {
        // @todo: check for conflicting namespace prefixes
        $this->document_namespace = trim($document->documentElement->namespaceURI);
        $namespace_prefix = trim($namespace_prefix);

        if ($this->hasNamespace()) {
            $this->namespace_prefix = empty($namespace_prefix) ? $this->getDefaultNamespacePrefix() : $namespace_prefix;

            $this->registerNamespace(
                $this->namespace_prefix,
                $this->document_namespace
            );
        }
    }
protected function initNamespace ( DOMDocument $ document , $ namespace_prefix = null ) { // @todo: check for conflicting namespace prefixes $ this -> document_namespace = trim ( $ document -> documentElement -> namespaceURI ) ; $ namespace_prefix = trim ( $ namespace_prefix ) ; if ( $ this -> hasNamespace ( ) ) { $ this -> namespace_prefix = empty ( $ namespace_prefix ) ? $ this -> getDefaultNamespacePrefix ( ) : $ namespace_prefix ; $ this -> registerNamespace ( $ this -> namespace_prefix , $ this -> document_namespace ) ; } }
Get the namespace of the document, if defined.

@param DOMDocument $document     Document to query on

@return string
Get the namespace of the document if defined .