Skip to content

struzik-vladislav/xpath-extended

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XPath Extended

Additional functions for XPath.

Usage

Initialisation

<?php

use XPath\DOMXPath;

$xpath = new DOMXPath($domdocument);

XPath\quote('string')

Quotes a string for use in a query.

<?php

$needle = 'abd\'efg';
$expr = sprintf('//root:root/root:node[php:functionString("XPath\quote", text()) = \'%s\']', $needle);
$list = $xpath->query($expr);