didou Tue Dec 28 04:24:31 2004 EDT
Modified files: /phpdoc/en/reference/xsl reference.xml /phpdoc/en/reference/xsl/functions xsl-xsltprocessor-get-parameter.xml xsl-xsltprocessor-has-exslt-support.xml xsl-xsltprocessor-import-stylesheet.xml xsl-xsltprocessor-register-php-functions.xml xsl-xsltprocessor-remove-parameter.xml xsl-xsltprocessor-set-parameter.xml xsl-xsltprocessor-transform-to-doc.xml xsl-xsltprocessor-transform-to-uri.xml xsl-xsltprocessor-transform-to-xml.xml Log: Fix ref.xsl docs to reflect only the OO side of the extension Document all functions, parameters Switch to the new documentation structure
http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/reference.xml?r1=1.7&r2=1.8&ty=u Index: phpdoc/en/reference/xsl/reference.xml diff -u phpdoc/en/reference/xsl/reference.xml:1.7 phpdoc/en/reference/xsl/reference.xml:1.8 --- phpdoc/en/reference/xsl/reference.xml:1.7 Wed Aug 25 04:19:15 2004 +++ phpdoc/en/reference/xsl/reference.xml Tue Dec 28 04:24:31 2004 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.7 $ --> +<!-- $Revision: 1.8 $ --> <reference id="ref.xsl"> <title>XSL functions</title> <titleabbrev>XSL</titleabbrev> @@ -9,13 +9,13 @@ <section id="xsl.intro"> &reftitle.intro; <para> - The XSL extension implements the XSL standard, performing - XSLT transformations using the <ulink url="&url.libxslt;"> - libxslt library</ulink> + The XSL extension implements the XSL standard, performing <ulink + url="&url.xslt;">XSLT transformations</ulink> using the <ulink + url="&url.libxslt;">libxslt library</ulink> </para> </section> -<section id="xsl.requirements"> + <section id="xsl.requirements"> &reftitle.required; <para> This extension uses <productname>libxslt</productname> which can be @@ -26,94 +26,96 @@ &reference.xsl.configure; - <section id="xsl.examples"> - &reftitle.examples; + <section id='xsl.classes'> + &reftitle.classes; <para> - In this small tutorial we will learn how to transform an XML - document into HTML. </para> + + <section id='xsl.class.xsltprocessor'> + <title><classname>XSLTProcessor</classname></title> + <para> + </para> + <section id='xsl.class.xsltprocessor.methods'> + &reftitle.methods; + <itemizedlist> + <listitem> + <para><xref linkend="function.xsl-xsltprocessor-get-parameter" /> - Get value of a parameter</para> + </listitem> + <listitem> + <para><xref linkend="function.xsl-xsltprocessor-has-exslt-support" /> - Determine if PHP has EXSLT support</para> + </listitem> + <listitem> + <para><xref linkend="function.xsl-xsltprocessor-import-stylesheet" /> - Import stylesheet</para> + </listitem> + <listitem> + <para><xref linkend="function.xsl-xsltprocessor-register-php-functions" /> - Enables the ability to use PHP functions as XSLT functions</para> + </listitem> + <listitem> + <para><xref linkend="function.xsl-xsltprocessor-remove-parameter" /> - Remove parameter</para> + </listitem> + <listitem> + <para><xref linkend="function.xsl-xsltprocessor-set-parameter" /> - Set value for a parameter</para> + </listitem> + <listitem> + <para><xref linkend="function.xsl-xsltprocessor-transform-to-doc" /> - Transform to DOMDocument</para> + </listitem> + <listitem> + <para><xref linkend="function.xsl-xsltprocessor-transform-to-uri" /> - Transform to URI</para> + </listitem> + <listitem> + <para><xref linkend="function.xsl-xsltprocessor-transform-to-xml" /> - Transform to XML</para> + </listitem> + </itemizedlist> + </section> + </section> + </section> + + <section id="xsl.examples"> + &reftitle.examples; <para> - <example> - <title>A simple XSL tree</title> - <programlisting role="xml"> -<![CDATA[ -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - <xsl:output method="html" encoding="iso-8859-1" indent="no"/> - <xsl:template match="collection"> - Hey! Welcome to my sweet CD collection! - <xsl:apply-templates/> - </xsl:template> - <xsl:template match="cd"> - <h1><xsl:value-of select="title"/></h1> - <h2>by <xsl:value-of select="artist"/></h2> - <h3> - <xsl:value-of select="year"/></h3> - </xsl:template> -</xsl:stylesheet> -]]> - </programlisting> - </example> + Many examples in this reference require both an XML and an XSL file. + We will use <filename>collection.xml</filename> and + <filename>collection.xsl</filename> that contains the following: </para> <para> <example> - <title>Corresponding XML tree</title> + <title>collection.xml</title> <programlisting role="xml"> <![CDATA[ <collection> <cd> - <title>PHP Rock</title> - <artist>Joe Coder</artist> - <year>2003</year> + <title>Fight for your mind</title> + <artist>Ben Harper</artist> + <year>1995</year> </cd> <cd> - <title>Squashing Typos on a Winter's Eve</title> - <artist>kennyt</artist> - <year>2004</year> + <title>Electric Ladyland</title> + <artist>Jimi Hendrix</artist> + <year>1997</year> </cd> </collection> ]]> </programlisting> </example> - </para> - <para> <example> - <title>Making XML into HTML</title> - <simpara> - The following PHP code uses the XML and XSL extensions to - transform XML into presentable HTML. - </simpara> - <programlisting role="php"> + <title>collection.xsl</title> + <programlisting role="xml"> <![CDATA[ -<?php -/* Load the two XML sources */ -$xml = new DomDocument; // from /ext/dom -$xml->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 -?> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:param name="owner" select="'Nicolas Eliaszewicz'"/> + <xsl:output method="html" encoding="iso-8859-1" indent="no"/> + <xsl:template match="collection"> + Hey! Welcome to <xsl:value-of select="$owner"/>'s sweet CD collection! + <xsl:apply-templates/> + </xsl:template> + <xsl:template match="cd"> + <h1><xsl:value-of select="title"/></h1> + <h2>by <xsl:value-of select="artist"/> - <xsl:value-of select="year"/></h2> + <hr /> + </xsl:template> +</xsl:stylesheet> ]]> </programlisting> - <simpara> - This should produce an HTML fragment similar to the following: - </simpara> - <screen> -<![CDATA[ -Hey! Welcome to my sweet CD collection! - -<h1>PHP Rock</h1> -<h2>by Joe Coder</h2> -<h3> - 2003</h3> - -<h1>Squashing Typos on a Winter's Eve</h1> -<h2> by kennyt</h2> -<h3> - 2004</h3> -]]> - </screen> </example> </para> </section> http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-get-parameter.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-get-parameter.xml diff -u phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-get-parameter.xml:1.4 phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-get-parameter.xml:1.5 --- phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-get-parameter.xml:1.4 Wed Aug 25 04:19:17 2004 +++ phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-get-parameter.xml Tue Dec 28 04:24:31 2004 @@ -1,31 +1,65 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> - <refentry id="function.xsl-xsltprocessor-get-parameter"> - <refnamediv> - <refname>xsl_xsltprocessor_get_parameter</refname> - <refpurpose>Get value of a parameter</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <para>Procedural style</para> - <methodsynopsis> - <type>string</type><methodname>xsl_xsltprocessor_get_parameter</methodname> - <methodparam><type>string</type><parameter>namespace</parameter></methodparam> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>xsltprocessor</classname></ooclass> - <methodsynopsis> - <type>string</type> - <methodname>getParameter</methodname> - <methodparam><type>string</type><parameter>namespace</parameter></methodparam> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - &warn.undocumented.func; - </refsect1> - </refentry> +<!-- $Revision: 1.5 $ --> +<refentry id="function.xsl-xsltprocessor-get-parameter"> + <refnamediv> + <refname>XSLTProcessor->getParameter()</refname> + <refpurpose>Get value of a parameter</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>XSLTProcessor</classname></ooclass> + <methodsynopsis> + <type>string</type> + <methodname>getParameter</methodname> + <methodparam><type>string</type><parameter>namespaceURI</parameter></methodparam> + <methodparam><type>string</type><parameter>localName</parameter></methodparam> + </methodsynopsis> + </classsynopsis> + <para> + Gets a parameter if previously set by <xref + linkend="function.xsl-xsltprocessor-set-parameter" />. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>namespaceURI</parameter></term> + <listitem> + <para> + The namespace URI of the XSLT parameter. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>localName</parameter></term> + <listitem> + <para> + The local name of the XSLT parameter. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The value of the parameter or &null; if it's not set. + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><xref linkend="function.xsl-xsltprocessor-set-parameter" /></member> + <member><xref linkend="function.xsl-xsltprocessor-remove-parameter" /></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-has-exslt-support.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-has-exslt-support.xml diff -u phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-has-exslt-support.xml:1.3 phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-has-exslt-support.xml:1.4 --- phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-has-exslt-support.xml:1.3 Wed Aug 25 04:19:17 2004 +++ phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-has-exslt-support.xml Tue Dec 28 04:24:31 2004 @@ -1,39 +1,41 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> - <refentry id="function.xsl-xsltprocessor-has-exslt-support"> - <refnamediv> - <refname>xsl_xsltprocessor_has_exslt_support</refname> - <refpurpose>Determine if PHP has EXSLT support</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <para>Procedural style</para> - <methodsynopsis> - <type>bool</type><methodname>xsl_xsltprocessor_has_exslt_support</methodname> - <void/> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>xsltprocessor</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>hasExsltSupport</methodname> - <void/> - </methodsynopsis> - </classsynopsis> - <para> - <function>xsl_xsltprocessor_has_exslt_support</function> returns &true; - if PHP was built with the <ulink url="&url.exsltlib;">EXSLT library - </ulink>, &false; otherwise. - </para> - <para> - <example> - <title><function>xsl_xsltprocessor_has_exslt_support</function> Example</title> - <programlisting role="php"> +<!-- $Revision: 1.4 $ --> +<refentry id="function.xsl-xsltprocessor-has-exslt-support"> + <refnamediv> + <refname>XSLTProcessor->hasExsltSupport()</refname> + <refpurpose>Determine if PHP has EXSLT support</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>XSLTProcessor</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>hasExsltSupport</methodname> + <void/> + </methodsynopsis> + </classsynopsis> + <para> + This method determine if PHP was built with the <ulink + url="&url.exsltlib;">EXSLT library</ulink>. + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Testing EXSLT support</title> + <programlisting role="php"> <![CDATA[ <?php -$proc = new xsltprocessor; +$proc = new XSLTProcessor; if (!$proc->hasExsltSupport()) { die('EXSLT support not available'); } @@ -42,11 +44,11 @@ ?> ]]> - </programlisting> - </example> - </para> - </refsect1> - </refentry> + </programlisting> + </example> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-import-stylesheet.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-import-stylesheet.xml diff -u phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-import-stylesheet.xml:1.5 phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-import-stylesheet.xml:1.6 --- phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-import-stylesheet.xml:1.5 Fri Nov 19 05:51:46 2004 +++ phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-import-stylesheet.xml Tue Dec 28 04:24:31 2004 @@ -1,30 +1,47 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> - <refentry id="function.xsl-xsltprocessor-import-stylesheet"> - <refnamediv> - <refname>xsl_xsltprocessor_import_stylesheet</refname> - <refpurpose>Import stylesheet</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <para>Procedural style</para> - <methodsynopsis> - <type>bool</type><methodname>xsl_xsltprocessor_import_stylesheet</methodname> - <methodparam><type>XSLTProcessor</type><parameter>xsl</parameter></methodparam> - <methodparam><type>object</type><parameter>index</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>xsltprocessor</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>importStylesheet</methodname> - <methodparam><type>object</type><parameter>index</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - &warn.undocumented.func; - </refsect1> - </refentry> +<!-- $Revision: 1.6 $ --> +<refentry id="function.xsl-xsltprocessor-import-stylesheet"> + <refnamediv> + <refname>XSLTProcessor->importStylesheet()</refname> + <refpurpose>Import stylesheet</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>XSLTProcessor</classname></ooclass> + <methodsynopsis> + <void/> + <methodname>importStylesheet</methodname> + <methodparam><type>DOMDocument</type><parameter>stylesheet</parameter></methodparam> + </methodsynopsis> + </classsynopsis> + <para> + This method import the stylesheet into the + <classname>XSLTProcessor</classname> for transformations. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>stylesheet</parameter></term> + <listitem> + <para> + The imported style sheet as a <classname>DOMDocument</classname> object. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.void; + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-register-php-functions.xml?r1=1.2&r2=1.3&ty=u Index: phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-register-php-functions.xml diff -u phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-register-php-functions.xml:1.2 phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-register-php-functions.xml:1.3 --- phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-register-php-functions.xml:1.2 Wed Aug 25 04:19:17 2004 +++ phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-register-php-functions.xml Tue Dec 28 04:24:31 2004 @@ -1,32 +1,32 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.2 $ --> - <refentry id="function.xsl-xsltprocessor-register-php-functions"> - <refnamediv> - <refname>xsl_xsltprocessor_register_php_functions</refname> - <refpurpose>Enables the ability to use PHP functions as XSLT functions</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <para>Procedural style</para> - <methodsynopsis> - <type>void</type><methodname>xsl_xsltprocessor_register_php_functions</methodname> - <void/> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>xsltprocessor</classname></ooclass> - <methodsynopsis> - <type>void</type> - <methodname>registerPHPFunctions</methodname> - <void/> - </methodsynopsis> - </classsynopsis> - <para> - <function>xsl_xsltprocessor_register_php_functions</function> enables the - ability to use PHP functions as XSLT functions within XSL stylesheets. - </para> - </refsect1> - </refentry> +<!-- $Revision: 1.3 $ --> +<refentry id="function.xsl-xsltprocessor-register-php-functions"> + <refnamediv> + <refname>XSLTProcessor->registerPHPFunctions()</refname> + <refpurpose>Enables the ability to use PHP functions as XSLT functions</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>XSLTProcessor</classname></ooclass> + <methodsynopsis> + <type>void</type> + <methodname>registerPHPFunctions</methodname> + <void/> + </methodsynopsis> + </classsynopsis> + <para> + This method enables the ability to use PHP functions as XSLT functions + within XSL stylesheets. + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.void; + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-remove-parameter.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-remove-parameter.xml diff -u phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-remove-parameter.xml:1.3 phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-remove-parameter.xml:1.4 --- phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-remove-parameter.xml:1.3 Wed Aug 25 04:19:17 2004 +++ phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-remove-parameter.xml Tue Dec 28 04:24:31 2004 @@ -1,31 +1,65 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> - <refentry id="function.xsl-xsltprocessor-remove-parameter"> - <refnamediv> - <refname>xsl_xsltprocessor_remove_parameter</refname> - <refpurpose>Remove parameter</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <para>Procedural style</para> - <methodsynopsis> - <type>bool</type><methodname>xsl_xsltprocessor_remove_parameter</methodname> - <methodparam><type>string</type><parameter>namespace</parameter></methodparam> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>xsltprocessor</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>removeParameter</methodname> - <methodparam><type>string</type><parameter>namespace</parameter></methodparam> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - &warn.undocumented.func; - </refsect1> - </refentry> +<!-- $Revision: 1.4 $ --> +<refentry id="function.xsl-xsltprocessor-remove-parameter"> + <refnamediv> + <refname>XSLTProcessor->removeParameter()</refname> + <refpurpose>Remove parameter</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>XSLTProcessor</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>removeParameter</methodname> + <methodparam><type>string</type><parameter>namespaceURI</parameter></methodparam> + <methodparam><type>string</type><parameter>localName</parameter></methodparam> + </methodsynopsis> + </classsynopsis> + <para> + Removes a parameter, if set. This will make the processor use the + default value for the parameter as specified in the stylesheet. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>namespaceURI</parameter></term> + <listitem> + <para> + The namespace URI of the XSLT parameter. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>localName</parameter></term> + <listitem> + <para> + The local name of the XSLT parameter. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><xref linkend="function.xsl-xsltprocessor-set-parameter" /></member> + <member><xref linkend="function.xsl-xsltprocessor-get-parameter" /></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-set-parameter.xml?r1=1.3&r2=1.4&ty=u Index: phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-set-parameter.xml diff -u phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-set-parameter.xml:1.3 phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-set-parameter.xml:1.4 --- phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-set-parameter.xml:1.3 Wed Aug 25 04:19:17 2004 +++ phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-set-parameter.xml Tue Dec 28 04:24:31 2004 @@ -1,33 +1,113 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> - <refentry id="function.xsl-xsltprocessor-set-parameter"> - <refnamediv> - <refname>xsl_xsltprocessor_set_parameter</refname> - <refpurpose>Set value for a parameter</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <para>Procedural style</para> - <methodsynopsis> - <type>bool</type><methodname>xsl_xsltprocessor_set_parameter</methodname> - <methodparam><type>string</type><parameter>namespace</parameter></methodparam> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - <methodparam><type>string</type><parameter>value</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>xsltprocessor</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>setParameter</methodname> - <methodparam><type>string</type><parameter>namespace</parameter></methodparam> - <methodparam><type>string</type><parameter>name</parameter></methodparam> - <methodparam><type>string</type><parameter>value</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - &warn.undocumented.func; - </refsect1> - </refentry> +<!-- $Revision: 1.4 $ --> +<refentry id="function.xsl-xsltprocessor-set-parameter"> + <refnamediv> + <refname>XSLTProcessor->setParameter()</refname> + <refpurpose>Set value for a parameter</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>XSLTProcessor</classname></ooclass> + <methodsynopsis> + <type>bool</type> + <methodname>setParameter</methodname> + <methodparam><type>string</type><parameter>namespace</parameter></methodparam> + <methodparam><type>mixed</type><parameter>name</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>value</parameter></methodparam> + </methodsynopsis> + </classsynopsis> + <para> + Sets the value of one or more parameters to be used in subsequent + transformations with <classname>XSLTProcessor</classname>. If the + parameter doesn't exist in the stylesheet it will be ignored. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>namespaceURI</parameter></term> + <listitem> + <para> + The namespace URI of the XSLT parameter. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>localName</parameter></term> + <listitem> + <para> + The local name of the XSLT parameter. This can be either a string + representing the parameter name or an array of + <literal>name => value</literal> pairs. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>value</parameter></term> + <listitem> + <para> + The new value of the XSLT parameter. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + &return.success; + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Changing the owner before the transformation</title> + <programlisting role="php"> +<![CDATA[ +<?php + +$collections = array( + 'Marc Rutkowski' => 'marc', + 'Olivier Parmentier' => 'olivier' +); + +$xsl = new DOMDocument; +$xsl->load('collection.xsl'); + +// Configure the transformer +$proc = new XSLTProcessor; +$proc->importStyleSheet($xsl); // attach the xsl rules + +foreach ($collections as $name => $file) { + // Load the XML source + $xml = new DOMDocument; + $xml->load('collection_' . $file . '.xml'); + + $proc->setParameter('', 'owner', $name); + $proc->transformToURI($xml, 'file:///tmp/' . $file . '.html'); +} + +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><xref linkend="function.xsl-xsltprocessor-get-parameter" /></member> + <member><xref linkend="function.xsl-xsltprocessor-remove-parameter" /></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-doc.xml?r1=1.5&r2=1.6&ty=u Index: phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-doc.xml diff -u phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-doc.xml:1.5 phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-doc.xml:1.6 --- phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-doc.xml:1.5 Wed Aug 25 04:19:17 2004 +++ phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-doc.xml Tue Dec 28 04:24:31 2004 @@ -1,29 +1,91 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> - <refentry id="function.xsl-xsltprocessor-transform-to-doc"> - <refnamediv> - <refname>xsl_xsltprocessor_transform_to_doc</refname> - <refpurpose>Transform to document</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <para>Procedural style</para> - <methodsynopsis> - <type>bool</type><methodname>xsl_xsltprocessor_transform_to_doc</methodname> - <methodparam><type>object</type><parameter>doc</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>xsltprocessor</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>transformToDoc</methodname> - <methodparam><type>object</type><parameter>doc</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - &warn.undocumented.func; - </refsect1> - </refentry> +<!-- $Revision: 1.6 $ --> +<refentry id="function.xsl-xsltprocessor-transform-to-doc"> + <refnamediv> + <refname>XSLTProcessor->transformToDoc()</refname> + <refpurpose>Transform to a DOMDocument</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>XSLTProcessor</classname></ooclass> + <methodsynopsis> + <type>DOMDocument</type> + <methodname>transformToDoc</methodname> + <methodparam><type>DOMNode</type><parameter>doc</parameter></methodparam> + </methodsynopsis> + </classsynopsis> + <para> + Transforms the source node to a <classname>DOMDocument</classname> applying + the stylesheet given by the <xref + linkend="function.xsl-xsltprocessor-import-stylesheet" /> method. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>doc</parameter></term> + <listitem> + <para> + The node to be transformed. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The resulting <classname>DOMDocument</classname> or &false; on error. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Transforming to a DOMDocument</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// Load the XML source +$xml = new DOMDocument; +$xml->load('collection.xml'); + +$xsl = new DOMDocument; +$xsl->load('collection.xsl'); + +// Configure the transformer +$proc = new XSLTProcessor; +$proc->importStyleSheet($xsl); // attach the xsl rules + +echo trim($proc->transformToDoc($xml)->firstChild->wholeText); + +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Hey! Welcome to Nicolas Eliaszewicz's sweet CD collection! +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><xref linkend="function.xsl-xsltprocessor-transform-to-uri" /></member> + <member><xref linkend="function.xsl-xsltprocessor-transform-to-xml" /></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-uri.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-uri.xml diff -u phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-uri.xml:1.4 phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-uri.xml:1.5 --- phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-uri.xml:1.4 Wed Aug 25 04:19:17 2004 +++ phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-uri.xml Tue Dec 28 04:24:31 2004 @@ -1,31 +1,92 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> - <refentry id="function.xsl-xsltprocessor-transform-to-uri"> - <refnamediv> - <refname>xsl_xsltprocessor_transform_to_uri</refname> - <refpurpose>Transform to URI</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <para>Procedural style</para> - <methodsynopsis> - <type>bool</type><methodname>xsl_xsltprocessor_transform_to_uri</methodname> - <methodparam><type>object</type><parameter>doc</parameter></methodparam> - <methodparam><type>string</type><parameter>uri</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>xsltprocessor</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>transformToUri</methodname> - <methodparam><type>object</type><parameter>doc</parameter></methodparam> - <methodparam><type>string</type><parameter>uri</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - &warn.undocumented.func; - </refsect1> - </refentry> +<!-- $Revision: 1.5 $ --> +<refentry id="function.xsl-xsltprocessor-transform-to-uri"> + <refnamediv> + <refname>XSLTProcessor->transformToURI()</refname> + <refpurpose>Transform to URI</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <classsynopsis> + <ooclass><classname>XSLTProcessor</classname></ooclass> + <methodsynopsis> + <type>int</type> + <methodname>transformToURI</methodname> + <methodparam><type>DOMDocument</type><parameter>doc</parameter></methodparam> + <methodparam><type>string</type><parameter>uri</parameter></methodparam> + </methodsynopsis> + </classsynopsis> + <para> + Transforms the source node to an URI applying the stylesheet given by the + <xref linkend="function.xsl-xsltprocessor-import-stylesheet" /> method. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>doc</parameter></term> + <listitem> + <para> + The transformed document. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>uri</parameter></term> + <listitem> + <para> + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Returns the number of bytes written or &false; if an error occured. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Transforming to a HTML file</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// Load the XML source +$xml = new DOMDocument; +$xml->load('collection.xml'); + +$xsl = new DOMDocument; +$xsl->load('collection.xsl'); + +// Configure the transformer +$proc = new XSLTProcessor; +$proc->importStyleSheet($xsl); // attach the xsl rules + +$proc->transformToURI($xml, 'file:///tmp/out.html'); + +?> +]]> + </programlisting> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><xref linkend="function.xsl-xsltprocessor-transform-to-doc" /></member> + <member><xref linkend="function.xsl-xsltprocessor-transform-to-xml" /></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/diff.php/phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-xml.xml?r1=1.4&r2=1.5&ty=u Index: phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-xml.xml diff -u phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-xml.xml:1.4 phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-xml.xml:1.5 --- phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-xml.xml:1.4 Wed Aug 25 04:19:17 2004 +++ phpdoc/en/reference/xsl/functions/xsl-xsltprocessor-transform-to-xml.xml Tue Dec 28 04:24:31 2004 @@ -1,29 +1,93 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> - <refentry id="function.xsl-xsltprocessor-transform-to-xml"> - <refnamediv> - <refname>xsl_xsltprocessor_transform_to_xml</refname> - <refpurpose>Transform to XML</refpurpose> - </refnamediv> - <refsect1> - <title>Description</title> - <para>Procedural style</para> - <methodsynopsis> - <type>bool</type><methodname>xsl_xsltprocessor_transform_to_xml</methodname> - <methodparam><type>object</type><parameter>doc</parameter></methodparam> - </methodsynopsis> - <para>Object oriented style (method)</para> - <classsynopsis> - <ooclass><classname>xsltprocessor</classname></ooclass> - <methodsynopsis> - <type>bool</type> - <methodname>transformToXml</methodname> - <methodparam><type>object</type><parameter>doc</parameter></methodparam> - </methodsynopsis> - </classsynopsis> - &warn.undocumented.func; - </refsect1> - </refentry> +<!-- $Revision: 1.5 $ --> +<refentry id="function.xsl-xsltprocessor-transform-to-xml"> + <refnamediv> + <refname>XSLTProcessor->transformToXML()</refname> + <refpurpose>Transform to XML</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <classsynopsis> + <ooclass><classname>XSLTProcessor</classname></ooclass> + <methodsynopsis> + <type>string</type> + <methodname>transformToXML</methodname> + <methodparam><type>DOMDocument</type><parameter>doc</parameter></methodparam> + </methodsynopsis> + </classsynopsis> + <para> + Transforms the source node to a string applying the stylesheet given by + the <xref linkend="function.xsl-xsltprocessor-import-stylesheet" /> method. + </para> + </refsect1> + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>doc</parameter></term> + <listitem> + <para> + The transformed document. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + The result of the transformation as a string or &false; on error. + </para> + </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Transforming to a string</title> + <programlisting role="php"> +<![CDATA[ +<?php + +// Load the XML source +$xml = new DOMDocument; +$xml->load('collection.xml'); + +$xsl = new DOMDocument; +$xsl->load('collection.xsl'); + +// Configure the transformer +$proc = new XSLTProcessor; +$proc->importStyleSheet($xsl); // attach the xsl rules + +echo $proc->transformToXML($xml); + +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Hey! Welcome to Nicolas Eliaszewicz's sweet CD collection! + +<h1>Fight for your mind</h1><h2>by Ben Harper - 1995</h2><hr> +<h1>Electric Ladyland</h1><h2>by Jimi Hendrix - 1997</h2><hr> +]]> + </screen> + </example> + </para> + </refsect1> + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><xref linkend="function.xsl-xsltprocessor-transform-to-doc" /></member> + <member><xref linkend="function.xsl-xsltprocessor-transform-to-uri" /></member> + </simplelist> + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: