Re: XML vs Everything Else

From: Date: Wed, 04 Sep 2002 13:04:18 +0000
Subject: Re: XML vs Everything Else
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-115169@lists.php.net to get a copy of this message
Rodrigo Dominguez wrote:
I'm writting an application, a control panel for a web site, and it will be great if I can separe data from presentation, I know that I have to work with XML and XSL but I didn't understand how it works. Can you give me a simple example? Let guess that a client request index.php, and I have index.xml for the data, index.xsl for the data transformation and index.php, how it works? From the php manaul:
<?php // Allocate a new XSLT processor $xh = xslt_create(); // Process the document if (xslt_process($xh, 'sample.xml', 'sample.xsl', 'result.xml')) { print "SUCCESS, sample.xml was transformed by sample.xsl into result.xml"; print ", result.xml has the following contents\n<br>\n"; print "<pre>\n"; readfile('result.xml'); print "</pre>\n"; } else { print "Sorry, sample.xml could not be transformed by sample.xsl into"; print " result.xml the reason is that " . xslt_error($xh) . " and the "; print "error code is " . xslt_errno($xh); } xslt_free($xh); ?>


« previous php.general (#115169) next »