Skip to content
Thomas Weinert edited this page Jul 30, 2014 · 2 revisions

FluentDOM\Nodes::$xpath

The FluentDOM\Nodes::$xpath provides an FluentDOM\Xpath instance attached to the node list. Namespaces registered on the Nodes instance will be registered on the Xpath instance, too.

If the internal dom document changes, because of a loading action, the Xpath instance will be recreated automatically.

Usage

$fd = new FluentDOM\Nodes(
  '<message>Hello World!</message>'
);
echo $fd->xpath->evaluate('string(//message)');

Output

Hello World!
Clone this wiki locally