/lenasys/0.1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/0.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<html>
<body>
<pre>
<?PHP
	$dom = new DomDocument;
	$dom->preserveWhiteSpace = FALSE;

	$file = 'example1b.xml';
	$loadstate=$dom->load($file);	
	
	$xp = new DOMXPath($dom);
	
	
	$xpathString="//car";
	echo "<b>Example: ".$xpathString."</b><br>";
	$nodes = $xp->query($xpathString);
	foreach ($nodes as $node) {

			$innerdom = new DomDocument;
			$otherxml=$dom->saveXML($node);
			$innerdom->loadXML($otherxml);
			$innerxp = new DOMXPath($innerdom);

			$xpathString="/car/*";
			echo "<b>  Inner Example: ".$xpathString."</b><br>";
			$innernodes = $innerxp->query($xpathString);
			foreach ($innernodes as $innernode) {			
					echo "    Name:".$innernode->nodeName."<br>";
			}
  }


  
?>
</pre>
</body>
</html>