-
Notifications
You must be signed in to change notification settings - Fork 20
Nodes Find
Thomas Weinert edited this page Jul 29, 2014
·
4 revisions
FluentDOM\Nodes find(string|DOMNode|DOMNodelist $selector[, bool $useDocumentContext = FALSE]);
Searches for descendant elements that match the specified expression.
If the $selector
is an node or a list of nodes all descendants that
match that node/node list are returned.
$xml = <<<'XML'
<html>
<head>
<title>Examples: FluentDOM\Query::find()</title>
</head>
<body>
<p><span>Hello</span>, how are you?</p>
<p>Me? I am <span>good</span>.</p>
</body>
</html>
XML;
echo FluentDOM($xml)
->find('//p')
->find('span')
->addClass('red');
<?xml version="1.0"?>
<html>
<head>
<title>Examples: FluentDOM\Query::find()</title>
</head>
<body>
<p><span class="red">Hello</span>, how are you?</p>
<p>Me? I am <span class="red">good</span>.</p>
</body>
</html>
- Home
- Getting Started
- Tasks
- Plugins
- Functions
- Lists
- Creator (5.1)
- CSS Selectors
- Convertors
- Loaders
- Serializers (5.1)
- Transformers (5.1)
- Extended DOM
- XMLReader (6.1)
- XMLWriter (6.1)
- Interfaces