<?xml version="1.0" encoding="ISO-8859-1"?>
<slide fontsize="6em">
	<title>DOM - not so cool</title>


	<example fontsize="1.5em"><![CDATA[<?php
$doc = domxml_open_file('book.xml');
$root = $doc->child_nodes();
$root = $root[0];
$books = $root->child_nodes();


foreach ($books as $book) {
    if (@$book->tagname == 'book') {
        $content = $book->child_nodes();
        foreach ($content as $elem) {
            if (@$elem->tagname == 'author') {
                $author = $elem->get_content();
            }
            if (@$elem->tagname == 'title') {
                $title = $elem->get_content();
            }
        }
        echo "{$title} was written by {$author}\n";
    }
}
?>]]></example>

</slide>
