public function addXPathHandler($xpath, $cb, $obj = null)
    {
        if (preg_match_all("/\(?{[^\}]+}\)?(\/?)[^\/]+/", $xpath, $regs)) {
            $ns_tags = $regs[0];
        } else {
            $ns_tags = [$xpath];
        }
        foreach ($ns_tags as $ns_tag) {
            list($l, $r) = explode("}", $ns_tag);
            if ($r !== null) {
                $xpart = [substr($l, 1), $r];
            } else {
                $xpart = [null, $l];
            }
            $xpath_array[] = $xpart;
        }
        $this->xpathhandlers[] = [$xpath_array, $cb, $obj, $xpath];
    }
public function addXPathHandler($xpath, $cb, $obj = null)
    {
        if (preg_match_all("/\(?{[^\}]+}\)?(\/?)[^\/]+/", $xpath, $regs)) {
            $ns_tags = $regs[0];
        } else {
            $ns_tags = [$xpath];
        }
        foreach ($ns_tags as $ns_tag) {
            list($l, $r) = explode("}", $ns_tag);
            if ($r !== null) {
                $xpart = [substr($l, 1), $r];
            } else {
                $xpart = [null, $l];
            }
            $xpath_array[] = $xpart;
        }
        $this->xpathhandlers[] = [$xpath_array, $cb, $obj, $xpath];
    }
public function addXPathHandler ( $ xpath , $ cb , $ obj = null ) { if ( preg_match_all ( "/\(?{[^\}]+}\)?(\/?)[^\/]+/" , $ xpath , $ regs ) ) { $ ns_tags = $ regs [ 0 ] ; } else { $ ns_tags = [ $ xpath ] ; } foreach ( $ ns_tags as $ ns_tag ) { list ( $ l , $ r ) = explode ( "}" , $ ns_tag ) ; if ( $ r !== null ) { $ xpart = [ substr ( $ l , 1 ) , $ r ] ; } else { $ xpart = [ null , $ l ] ; } $ xpath_array [ ] = $ xpart ; } $ this -> xpathhandlers [ ] = [ $ xpath_array , $ cb , $ obj , $ xpath ] ; }
Add XPath Handler

@param string $xpath
@param \Closure $cb
@param null $obj
Add XPath Handler