bzr branch
http://gegoxaren.bato24.eu/bzr/lenasys/0.1
1
by Henrik G.
First seed of Lenasys ... Needs to be Organized Further |
1 |
<span class="description"> |
2 |
<br> |
|
3 |
<div class="descriptionheading">Overview</div> |
|
4 |
This example shows how we can change the context node for the XPATH processing so that it executes from another node than the root node. |
|
5 |
<br><br> |
|
6 |
<div class="descriptionheading">Context Nodes</div> |
|
7 |
In PHP the XPATH engine uses the root node as the default context node.<br/><br/> |
|
8 |
In newer versions of PHP we can add an optional context node from the document which allows us to execute a query from |
|
9 |
any node in the document.<br/><br/> |
|
10 |
In this case we use <span class="interestingdescription">$node</span> as the context node and thus are executing ./color for each car, and not for the root of the document. |
|
11 |
<br><br> |
|
12 |
<div class='exampleheading'>Web Page Output:<br><br> |
|
13 |
<img src='DomExample3b.png'> |
|
14 |
</div> |
|
15 |
||
16 |
</span> |