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);

?>


>  
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to