From 24e65da40000f8255bf1cb6a4a0ad85b2cbd91d1 Mon Sep 17 00:00:00 2001 From: Ken Date: Sun, 28 Mar 2004 06:42:32 +0000 Subject: [PATCH] Adding a bit of documentation for /ext/xsl. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@154729 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/xsl/reference.xml | 139 ++++++++++++++++++++++++++++++++++++ 1 file changed, 139 insertions(+) create mode 100644 reference/xsl/reference.xml diff --git a/reference/xsl/reference.xml b/reference/xsl/reference.xml new file mode 100644 index 0000000000..a947578567 --- /dev/null +++ b/reference/xsl/reference.xml @@ -0,0 +1,139 @@ + + + + XSL functions + XSL + + +
+ &reftitle.intro; + &warn.experimental; + + The XSL extension implements the XSL standard, performing + XSLT transformations using the libxslt library. + +
+ +
+ &reftitle.install; + + PHP 5 includes XSL by default, but it can be enabled + explicitly by adding the argument + . + DIR is the libxslt installation directory. + +
+ +
+ &reftitle.examples; + + In this small tutorial we will learn how to transform an XML + document into HTML. + +
+ + A simple XSL tree + + + + + Hey! Welcome to my sweet CD collection! + + + +

+

by

+

-

+
+ +]]> +
+
+ + Corresponding XML tree + + + + PHP Rock + Joe Coder + 2003 + + + Squashing Typos on a Winter's Eve + kennyt + 2004 + + +]]> + + +
+ + Making XML into HTML + + The following PHP code uses the XML and XSL extensions to + transform XML into presentable HTML. + + +load('example.xml'); + +$xsl = new DomDocument; +$xsl->load('example.xsl'); + +/* Configure the transformer */ +$proc = new xsltprocessor; +$proc->importStyleSheet($xsl); // attach the xsl rules +echo $proc->transformToXML($xml); // actual transformation +?> +]]> + + + This should produce an HTML fragment similar to the following: + + +PHP Rock +

by Joe Coder

+

- 2003

+ +

Squashing Typos on a Winter's Eve

+

by kennyt

+

- 2004

+]]> +
+
+
+
+ +&reference.xsl.functions; + +
+ +