The DOMXPath object doesn't create a reference to the document. If you load a new xml using either load, loadXML or loadHTML functions the DOMXPath object will still query and evaluate over the source in the DOMDocument when it was created.
(PHP 5, PHP 7, PHP 8)
DOMXPath::__construct — Yeni bir DOMXPath nesnesi oluşturur
Yeni bir DOMXPath nesnesi oluşturur.
The DOMXPath object doesn't create a reference to the document. If you load a new xml using either load, loadXML or loadHTML functions the DOMXPath object will still query and evaluate over the source in the DOMDocument when it was created.