cvs: presentations / xmlandphp-vpug-oct-2003.xml /slides/php5intro simplexml1.xml /slides/xmlandphp dom.helpers.php dom.php dom.xml
dtdvalidation.xml evaluate_dom.xml evaluate_sax.xml evaluate_simplexml.xml sax.xml soap.xml titlepage-vpug-oct2003.xml validation.xml xpath.php
xsl.php xslt-api.xml xslt.xml

From: Date: Thu, 09 Oct 2003 07:53:38 +0000
Subject: cvs: presentations / xmlandphp-vpug-oct-2003.xml /slides/php5intro simplexml1.xml /slides/xmlandphp dom.helpers.php dom.php dom.xml
dtdvalidation.xml evaluate_dom.xml evaluate_sax.xml evaluate_simplexml.xml sax.xml soap.xml titlepage-vpug-oct2003.xml validation.xml xpath.php
xsl.php xslt-api.xml xslt.xml
Groups: php.pres 
Request: Send a blank email to pres+get-833@lists.php.net to get a copy of this message
shane Thu Oct 9 03:53:38 2003 EDT Added files: /presentations xmlandphp-vpug-oct-2003.xml /presentations/slides/xmlandphp evaluate_simplexml.xml soap.xml titlepage-vpug-oct2003.xml validation.xml xsl.php xslt-api.xml Modified files: /presentations/slides/php5intro simplexml1.xml /presentations/slides/xmlandphp dom.helpers.php dom.php dom.xml dtdvalidation.xml evaluate_dom.xml evaluate_sax.xml sax.xml xpath.php xslt.xml Log: user group talk update xml slides for current api

Index: presentations/slides/php5intro/simplexml1.xml diff -u presentations/slides/php5intro/simplexml1.xml:1.1 presentations/slides/php5intro/simplexml1.xml:1.2 --- presentations/slides/php5intro/simplexml1.xml:1.1 Sun Jun 29 22:39:41 2003 +++ presentations/slides/php5intro/simplexml1.xml Thu Oct 9 03:53:37 2003 @@ -3,9 +3,7 @@ <list> <bullet>Simple XML is Simply Brilliant</bullet> <bullet>No more SAX parsing</bullet> -<bullet>Use Simple API or DOM</bullet> -<bullet>Combine with XSLT, XPath, other LibXML capabilities</bullet> -<bullet>Future PEAR::SOAP to be based on Simple XML</bullet> +<bullet>Supports DTD validation and XPath queries</bullet> </list> <example title="Book XML File" filename="book.xml" type="XML"/> <example title="Book PHP File" filename="book.php" type="php" result="1"/> Index: presentations/slides/xmlandphp/dom.helpers.php diff -u presentations/slides/xmlandphp/dom.helpers.php:1.1 presentations/slides/xmlandphp/dom.helpers.php:1.2 --- presentations/slides/xmlandphp/dom.helpers.php:1.1 Sun Apr 20 23:21:45 2003 +++ presentations/slides/xmlandphp/dom.helpers.php Thu Oct 9 03:53:38 2003 @@ -3,12 +3,12 @@ function process_item($item) { - $id = $item->get_attribute('id'); + $id = $item->getAttribute('id'); echo '<a href="'; printf(URL, $id); echo '">'; - $children = $item->children(); + $children = $item->childNodes; foreach ($children as $element) { if ($element instanceof domelement) { process_subelement($element); @@ -19,9 +19,9 @@ function process_subelement($element) { - $name = $element->tagname; - $e = array_shift($element->children()); - $data = trim($e->content); + $name = $element->tagName; + $e = array_shift($element->childNodes); + $data = trim($e->nodeValue); switch ($name) { case 'title': Index: presentations/slides/xmlandphp/dom.php diff -u presentations/slides/xmlandphp/dom.php:1.1 presentations/slides/xmlandphp/dom.php:1.2 --- presentations/slides/xmlandphp/dom.php:1.1 Sun Apr 20 23:21:45 2003 +++ presentations/slides/xmlandphp/dom.php Thu Oct 9 03:53:38 2003 @@ -1,10 +1,11 @@ <?php include_once('dom.helpers.php'); -$doc = xmldocfile('thedata.xml'); +$doc = new domdocument(); +$doc->load('thedata.xml'); -$wishlist = $doc->root(); -$nodes = $wishlist->children(); +$wishlist = $doc->documentElement; +$nodes = $wishlist->childNodes; foreach ($nodes as $node) { if ($node instanceof domelement) { Index: presentations/slides/xmlandphp/dom.xml diff -u presentations/slides/xmlandphp/dom.xml:1.2 presentations/slides/xmlandphp/dom.xml:1.3 --- presentations/slides/xmlandphp/dom.xml:1.2 Mon Apr 21 15:56:22 2003 +++ presentations/slides/xmlandphp/dom.xml Thu Oct 9 03:53:38 2003 @@ -6,5 +6,8 @@ <bullet>Designed for Java, Cross-Language Standard</bullet> <bullet>PHP Extension uses %libXML% by Daniel Veillard</bullet> </list> - +<list> +<bullet>PHP 5 features a vastly superior DOM extension</bullet> +<bullet>DOM 3 compliance</bullet> +</list> </slide> Index: presentations/slides/xmlandphp/dtdvalidation.xml diff -u presentations/slides/xmlandphp/dtdvalidation.xml:1.1 presentations/slides/xmlandphp/dtdvalidation.xml:1.2 --- presentations/slides/xmlandphp/dtdvalidation.xml:1.1 Thu Apr 24 00:34:59 2003 +++ presentations/slides/xmlandphp/dtdvalidation.xml Thu Oct 9 03:53:38 2003 @@ -4,25 +4,19 @@ </blurb> <example title="Parse &amp; Validate"> <![CDATA[<?php -$d = xmldocfile( - 'validate.xml', - DOMXML_LOAD_VALIDATING, - $errors -); -if (!$d) { - echo "<pre>"; - var_dump($errors); - echo "</pre>"; -} +$dom = new domDocument; +$dom->validateOnParse = true; +$dom->load('note-invalid.xml'); ?>]]> </example> <example title="Parse Then Validate"> <![CDATA[<?php -$d = xmldocfile('validate.xml'); -if (!$d->validate($errors)) { - echo "<pre>"; - var_dump($errors); - echo "</pre>"; +$dom = new domDocument; +$dom->load('note.xml'); +if (!$dom->validate('note.dtd')) { + print "Document note.dtd is not valid\n"; +} else { + print "Document note.dtd is valid\n"; } ?>]]> </example> Index: presentations/slides/xmlandphp/evaluate_dom.xml diff -u presentations/slides/xmlandphp/evaluate_dom.xml:1.2 presentations/slides/xmlandphp/evaluate_dom.xml:1.3 --- presentations/slides/xmlandphp/evaluate_dom.xml:1.2 Thu Apr 24 00:34:59 2003 +++ presentations/slides/xmlandphp/evaluate_dom.xml Thu Oct 9 03:53:38 2003 @@ -5,11 +5,12 @@ <bullet>Standard Encapsulation</bullet> <bullet>Parser Optimizations/Result Caching Available</bullet> <bullet>You Can Query Documents with Xpath</bullet> +<bullet>PHP 5 Extension is great, DOM 3 compliant</bullet> </list> <list title="Cons"> <bullet>Must Fully Visualize Document</bullet> -<bullet>(Overly) Complex</bullet> -<bullet>PHP Extension is Buggy</bullet> +<bullet>(Overly ?) Complex</bullet> +<bullet>PHP 4 Extension is Buggy, not DOM compliant</bullet> <bullet>Requires Object Oriented Paradigms</bullet> </list> </slide> Index: presentations/slides/xmlandphp/evaluate_sax.xml diff -u presentations/slides/xmlandphp/evaluate_sax.xml:1.1 presentations/slides/xmlandphp/evaluate_sax.xml:1.2 --- presentations/slides/xmlandphp/evaluate_sax.xml:1.1 Sun Apr 20 20:16:30 2003 +++ presentations/slides/xmlandphp/evaluate_sax.xml Thu Oct 9 03:53:38 2003 @@ -1,12 +1,15 @@ <slide> <title>SAX: Pros and Cons</title> <list title="Pros"> -<bullet>Always Available</bullet> +<bullet>Always Available (PHP 4)</bullet> <bullet>Partial Visualization</bullet> <bullet>Can Discard Unneeded Information</bullet> </list> <list title="Cons"> <bullet>Slower Parse Stage</bullet> <bullet>Higher Memory Consumption (per-unit)</bullet> +</list> +<list title="PHP 5 Update"> +<bullet>If XML support is compiled in, SAX, DOM and SimpleXML available</bullet> </list> </slide> Index: presentations/slides/xmlandphp/sax.xml diff -u presentations/slides/xmlandphp/sax.xml:1.1 presentations/slides/xmlandphp/sax.xml:1.2 --- presentations/slides/xmlandphp/sax.xml:1.1 Mon Apr 21 15:56:22 2003 +++ presentations/slides/xmlandphp/sax.xml Thu Oct 9 03:53:38 2003 @@ -5,6 +5,7 @@ <bullet>Event Driven</bullet> <bullet>Streaming</bullet> <bullet>Non-blocking</bullet> -<bullet>PHP Extension uses %Expat% by James Clark</bullet> +<bullet>PHP 4 Extension uses %Expat% by James Clark</bullet> +<bullet>PHP 5 Extensions use %libXML%</bullet> </list> </slide> Index: presentations/slides/xmlandphp/xpath.php diff -u presentations/slides/xmlandphp/xpath.php:1.1 presentations/slides/xmlandphp/xpath.php:1.2 --- presentations/slides/xmlandphp/xpath.php:1.1 Thu Apr 24 00:34:59 2003 +++ presentations/slides/xmlandphp/xpath.php Thu Oct 9 03:53:38 2003 @@ -1,11 +1,13 @@ <?php -$doc = xmldocfile('data.rss'); -$ctx = $doc->xpath_new_context(); +$doc = new domdocument(); +$doc->load('data.rss'); -$node = $ctx->xpath_eval( +$ctx = new domXpath($doc); + +$node = $ctx->query( '/rss/channel/item/title/text()' ); echo 'Title: '; -echo $node->nodeset[0]->content; +echo $node[0]->nodeValue; echo "\n"; ?> Index: presentations/slides/xmlandphp/xslt.xml diff -u presentations/slides/xmlandphp/xslt.xml:1.1 presentations/slides/xmlandphp/xslt.xml:1.2 --- presentations/slides/xmlandphp/xslt.xml:1.1 Thu Apr 24 00:34:59 2003 +++ presentations/slides/xmlandphp/xslt.xml Thu Oct 9 03:53:38 2003 @@ -2,4 +2,12 @@ <blurb> XSLT is a language designed to facilitate XML transformations, in XML itself. </blurb> +<list> +<bullet>Uses DOM extension</bullet> +<bullet>Supports most EXSLT (www.exslt.org)</bullet> +<bullet>Transform DOM to DOM, File or XML</bullet> +</list> + +<example filename="xsl.php" fontsize="1.5em"/> + </slide> Index: presentations/xmlandphp-vpug-oct-2003.xml +++ presentations/xmlandphp-vpug-oct-2003.xml <presentation template="php" navmode="html" > <topic>PHP</topic> <title>XML and PHP 5</title> <event>Vancouver User Group</event> <location>BC, Canada</location> <date>Oct 9, 2003</date> <speaker>Shane Caraveo</speaker> <email>shane@php.net</email> <url>http://talks.php.net/</url> <slide>slides/xmlandphp/titlepage-vpug-oct2003.xml</slide> <slide>slides/xmlandphp/what1.xml</slide> <slide>slides/xmlandphp/what2.xml</slide> <slide>slides/xmlandphp/sample.xml</slide> <slide>slides/xmlandphp/interface.xml</slide> <slide>slides/xmlandphp/sax.xml</slide> <slide>slides/xmlandphp/callback.xml</slide> <slide>slides/xmlandphp/glue.xml</slide> <slide>slides/xmlandphp/parseinto.xml</slide> <slide>slides/xmlandphp/pear.xml</slide> <slide>slides/xmlandphp/pear1.xml</slide> <slide>slides/xmlandphp/pear2.xml</slide> <slide>slides/xmlandphp/dom.xml</slide> <slide>slides/xmlandphp/domglue.xml</slide> <slide>slides/xmlandphp/helpers.xml</slide> <slide>slides/xmlandphp/xpath.xml</slide> <slide>slides/xmlandphp/validation.xml</slide> <slide>slides/php5intro/simplexml1.xml</slide> <slide>slides/php5intro/simplexml2.xml</slide> <slide>slides/xmlandphp/evaluate_sax.xml</slide> <slide>slides/xmlandphp/evaluate_dom.xml</slide> <slide>slides/xmlandphp/evaluate_simplexml.xml</slide> <slide>slides/xmlandphp/xslt.xml</slide> <slide>slides/xmlandphp/xslt1.xml</slide> <slide>slides/xmlandphp/xslt2.xml</slide> <slide>slides/xmlandphp/xslt-api.xml</slide> <slide>slides/xmlandphp/soap.xml</slide> </presentation> Index: presentations/slides/xmlandphp/evaluate_simplexml.xml +++ presentations/slides/xmlandphp/evaluate_simplexml.xml <slide> <title>SimpleXML: Pros and Cons</title> <list title="Pros"> <bullet>Simple structures, PHP style objects</bullet> <bullet>Parser Optimizations/Result Caching Available</bullet> <bullet>You Can Query Documents with Xpath</bullet> </list> <list title="Cons"> <bullet>Must Fully Visualize Document</bullet> <bullet>(Overly ?) Simple, lacking some flexibility</bullet> <bullet>Pre-PHP 5 beta 2 implementation has issues</bullet> <bullet>Some ambiguities in structures</bullet> </list> </slide> Index: presentations/slides/xmlandphp/soap.xml +++ presentations/slides/xmlandphp/soap.xml <slide title="SOAP"> <blurb> Where is it? </blurb> <list> <bullet>WSDL Code Generation improved</bullet> <bullet>Schema Code Generation added!</bullet> <bullet>Less focus on RPC, more on Document messaging</bullet> <bullet>Smaller code base, easier to extend</bullet> <bullet>Will make use of streams for transport api's</bullet> <bullet>Uses DOM, may use SimpleXML alternately in the future</bullet> <bullet>Cleaner code, better organized</bullet> <bullet>Makes use of new OO support in PHP 5</bullet> <bullet>Alpha Release late October 2003</bullet> </list> </slide> Index: presentations/slides/xmlandphp/titlepage-vpug-oct2003.xml +++ presentations/slides/xmlandphp/titlepage-vpug-oct2003.xml <slide fontsize="3.5em"> <title>Welcome</title> <blurb> </blurb> <blurb align="center" fontsize="6.0em">XML and PHP 5</blurb> <blurb align="center" fontsize="4.0em">Vancouver User Group</blurb> <blurb align="center">Oct 9, 2003</blurb> <link align="center" leader="Shane Caraveo, " text="shane@php.net" href="mailto:shane@php.net"/> </slide> Index: presentations/slides/xmlandphp/validation.xml +++ presentations/slides/xmlandphp/validation.xml <slide title="Document Validation"> <blurb> %LibXML% supports DTD, Schema and RelaxNG validation, during parsing, and post parsing. </blurb> <list> <bullet>boolean attribute DOMDocument->validateOnParse</bullet> <bullet>boolean DOMDocument->validate(string filename)</bullet> <bullet>boolean DOMDocument->schemaValidate(string filename)</bullet> <bullet>boolean DOMDocument->relaxNGValidate(string filename)</bullet> </list> <example title="Parse &amp; Validate"> <![CDATA[<?php $dom = new domDocument; $dom->validateOnParse = true; $dom->load('note-invalid.xml'); ?>]]> </example> <example title="Parse Then Validate"> <![CDATA[<?php $dom = new domDocument; $dom->load('note.xml'); if (!$dom->validate('note.dtd')) { print "Document note.dtd is not valid\n"; } else { print "Document note.dtd is valid\n"; } ?>]]> </example> </slide> Index: presentations/slides/xmlandphp/xsl.php +++ presentations/slides/xmlandphp/xsl.php <?php $xslDom = new domdocument; $xslDom->load('rss.xsl'); $xmlDom = new domdocument; $xmlDom->load('data.rss'); $xsl = new xsltprocessor; $xsl->importStylesheet($xslDom); print $xsl->transformToXML($xmlDom); ?> Index: presentations/slides/xmlandphp/xslt-api.xml +++ presentations/slides/xmlandphp/xslt-api.xml <slide title="XSLT API"> <list title="class XSLTProcessor"> <bullet>importStylesheet(DOMDocument doc)</bullet> <bullet>transformToDoc(DOMDocument doc, [boolean clone]) returns domdocument</bullet> <bullet>transformToURI(DOMDocument doc, string URI, [boolean clone]) returns int</bullet> <bullet>transformToXML(DOMDocument doc, [boolean clone]) returns string </bullet> <bullet>setParameter(string namespace, string name, string value)</bullet> <bullet>getParameter(string namespace, string name) returns string</bullet> <bullet>removeParameter(string namespace, string name) returns boolean</bullet> </list> </slide>
« previous php.pres (#833) next »