public function setElement($document, $element = null)
    {
        if (empty($document)) {
            // Make sure we always have an element to query against which should not return any returns.
            $document = new DOMDocument();
            $document->loadXML('<dummy/>');
        }
        $this->document = $document;

        if (empty($element)) {
            $element = $this->document->documentElement;
        }
        $this->element = $element;
    }
public function setElement($document, $element = null)
    {
        if (empty($document)) {
            // Make sure we always have an element to query against which should not return any returns.
            $document = new DOMDocument();
            $document->loadXML('<dummy/>');
        }
        $this->document = $document;

        if (empty($element)) {
            $element = $this->document->documentElement;
        }
        $this->element = $element;
    }
public function setElement ( $ document , $ element = null ) { if ( empty ( $ document ) ) { // Make sure we always have an element to query against which should not return any returns. $ document = new DOMDocument ( ) ; $ document -> loadXML ( '<dummy/>' ) ; } $ this -> document = $ document ; if ( empty ( $ element ) ) { $ element = $ this -> document -> documentElement ; } $ this -> element = $ element ; }
Sets the document and element for the node.

@param DOMDocument $document
@param DOMElement $element
Sets the document and element for the node .