From 9e528680d88ec3716f489b3fbc7a5930ad168075 Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Mon, 11 Jun 2007 00:05:27 +0000 Subject: [PATCH] ref.xslt: switch to new doc style git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@237384 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../xslt/functions/xslt-backend-info.xml | 30 ++- .../xslt/functions/xslt-backend-name.xml | 48 ++-- .../xslt/functions/xslt-backend-version.xml | 50 ++-- reference/xslt/functions/xslt-create.xml | 44 +-- reference/xslt/functions/xslt-errno.xml | 42 ++- reference/xslt/functions/xslt-error.xml | 67 +++-- reference/xslt/functions/xslt-free.xml | 42 ++- reference/xslt/functions/xslt-getopt.xml | 42 ++- reference/xslt/functions/xslt-process.xml | 143 ++++++++-- reference/xslt/functions/xslt-set-base.xml | 72 ++++- .../xslt/functions/xslt-set-encoding.xml | 41 ++- .../xslt/functions/xslt-set-error-handler.xml | 74 +++-- reference/xslt/functions/xslt-set-log.xml | 81 +++--- reference/xslt/functions/xslt-set-object.xml | 44 ++- .../xslt/functions/xslt-set-sax-handler.xml | 53 +++- .../xslt/functions/xslt-set-sax-handlers.xml | 254 ++++++++++-------- .../functions/xslt-set-scheme-handler.xml | 53 +++- .../functions/xslt-set-scheme-handlers.xml | 16 +- reference/xslt/functions/xslt-setopt.xml | 127 +++++---- 19 files changed, 954 insertions(+), 369 deletions(-) diff --git a/reference/xslt/functions/xslt-backend-info.xml b/reference/xslt/functions/xslt-backend-info.xml index 7408b4a1b1..5fb0f79bfe 100755 --- a/reference/xslt/functions/xslt-backend-info.xml +++ b/reference/xslt/functions/xslt-backend-info.xml @@ -1,29 +1,41 @@ - + xslt_backend_info Returns the information on the compilation settings of the backend - - Description + + + &reftitle.description; stringxslt_backend_info - xslt_backend_info returns a string with - information about the compilation setting of the backend - or an error string when no information available. + xslt_backend_info gets information about the + compilation settings of the backend. - + + + &reftitle.returnvalues; + + Returns a string with information about the compilation setting of the + backend or an error string when no information available. + + + + &reftitle.seealso; - xslt_backend_name&listendand; - xslt_backend_version. + + xslt_backend_name + xslt_backend_version + + + xslt_backend_name Returns the name of the backend - - Description + + + &reftitle.description; stringxslt_backend_name - xslt_backend_name will always return - Sablotron. + xslt_backend_name gets the name of the backend. - + + + &reftitle.returnvalues; + + Returns Sablotron. + + + + &reftitle.examples; - - <function>xslt_backend_name</function> example - + + + <function>xslt_backend_name</function> example + ]]> - - - - - &reftitle.seealso; - - xslt_backend_info&listendand; - xslt_backend_version. + + + + + &reftitle.seealso; + + + xslt_backend_info + xslt_backend_version + + + + + xslt_backend_version Returns the version number of Sablotron - - Description + + + &reftitle.description; stringxslt_backend_version - xslt_backend_version returns the version - number of Sablotron if available, - &false; otherwise. + xslt_backend_version gets the version + number of Sablotron. - + + + &reftitle.returnvalues; + + Returns the version number, or &false; if not available. + + + + &reftitle.examples; - - <function>xslt_backend_version</function> example - + + + <function>xslt_backend_version</function> example + ]]> - - - - - &reftitle.seealso; - - xslt_backend_name&listendand; - xslt_backend_info. + + + + + &reftitle.seealso; + + + xslt_backend_info + xslt_backend_name + + + + - + xslt_create Create a new XSLT processor - - Description + + + &reftitle.description; resourcexslt_create @@ -17,11 +17,20 @@ other XSLT functions. - + + + &reftitle.returnvalues; + + Returns an XSLT processor link identifier on success, or &false; on error. + + + + &reftitle.examples; - - <function>xslt_create</function> example - + + + <function>xslt_create</function> example + ]]> - - - - - &reftitle.seealso; - - xslt_free. + + + + + &reftitle.seealso; + + + xslt_free + + + + - + xslt_errno Returns an error number - - Description + + + &reftitle.description; intxslt_errno resourcexh @@ -17,12 +17,40 @@ passed XSLT processor. - - &reftitle.seealso; + + + &reftitle.parameters; - xslt_error. + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + + + &reftitle.returnvalues; + + Returns the error code, as an integer. + + + + + &reftitle.seealso; + + + xslt_error + + + + - + xslt_error Returns an error string - - Description + + + &reftitle.description; stringxslt_error resourcexh @@ -17,14 +17,40 @@ passed XSLT processor. - + + + &reftitle.parameters; + + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + + + + + &reftitle.returnvalues; + + Returns the error message, as a string. + + + + &reftitle.examples; - - - Handling errors using the <function>xslt_error</function> and - <function>xslt_errno</function> functions. - - + + + + Handling errors using the <function>xslt_error</function> and + <function>xslt_errno</function> functions. + + ]]> - - - - - &reftitle.seealso; - - xslt_errno. + + + + + &reftitle.seealso; + + + xslt_errno + + + + - + xslt_free Free XSLT processor - - Description + + + &reftitle.description; voidxslt_free resourcexh @@ -16,12 +16,40 @@ Free the XSLT processor identified by the given handle. - - &reftitle.seealso; + + + &reftitle.parameters; - xslt_create + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.seealso; + + + xslt_create + + + + + xslt_getopt Get options on a given xsl processor - - Description + + + &reftitle.description; intxslt_getopt resourceprocessor @@ -16,12 +17,41 @@ processor. - - &reftitle.seealso; + + + &reftitle.parameters; - xslt_setopt. + + + processor + + + The XSLT processor link identifier, created with + xslt_create. + + + + + + + &reftitle.returnvalues; + + Returns the options, a bitmask constructed with the + XSLT_SABOPT_XXX constants. + + + + + &reftitle.seealso; + + + xslt_setopt + + + + - + xslt_process Perform an XSLT transformation - - Description + + + &reftitle.description; mixedxslt_process resourcexh @@ -18,31 +18,124 @@ arrayparameters - The xslt_process function is the crux of the new - XSLT extension. It allows you to perform an XSLT transformation using + The xslt_process function is the crux of the XSLT + extension. It allows you to perform an XSLT transformation using almost any type of input source - the containers. This is accomplished through the use of argument buffers -- a concept taken from the Sablotron XSLT processor (currently the only XSLT processor this extension supports). The input containers default to a filename 'containing' the document to be - processed. The result container defaults to a filename for the transformed - document. If the result container is not specified - i.e. - &null; - than the result is returned. + processed. + + + + &reftitle.parameters; - - - As of PHP 4.0.6, this function no longer takes XML strings in - xmlcontainer or - xslcontainer. Passing a string containing XML - to either of these parameters will result in a segmentation fault in - Sablotron versions up to and including version 0.95. - - + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + xmlcontainer + + + Path to XML file or placeholder for the XML argument. + + + + + xslcontainer + + + Path to XSL file or placeholder for the XML argument. + + + + + resultcontainer + + + The result container defaults to a filename for the transformed + document. If the result container is not specified - i.e. &null; + - than the result is returned. + + + + + arguments + + + Instead of files as the XML and XSLT arguments to the xslt_process + function, you can specify "argument place holders" which are then substituted by values + given in the arguments array. + + + + + parameters + + + An array for any top-level parameters that will be passed to the XSLT + document. These parameters can then be accessed within your XSL files + using the <xsl:param name="parameter_name"> + instruction. The parameters must be UTF-8 encoded and their values will be + interpreted as strings by the Sablotron processor. + In other words - you cannot pass node-sets as parameters to the XSLT document. + + + + Containers can also be set via the arguments array (see below). + + + + &reftitle.returnvalues; + + &return.success; If the result container is not specified - i.e. + &null; - than the result is returned. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 4.0.6 + + This function no longer takes XML strings in + xmlcontainer or + xslcontainer. Passing a string containing XML + to either of these parameters will result in a segmentation fault in + Sablotron versions up to and including version 0.95. + + + + + + + + + + &reftitle.examples; The simplest type of transformation with the xslt_process function is the transformation of an @@ -166,15 +259,6 @@ xslt_free($xh); - - Finally, the last argument to the xslt_process - function represents an array for any top-level parameters that you want to - pass to the XSLT document. These parameters can then be accessed within - your XSL files using the <xsl:param name="parameter_name"> - instruction. The parameters must be UTF-8 encoded and their values will be - interpreted as strings by the Sablotron processor. - In other words - you cannot pass node-sets as parameters to the XSLT document. - Passing PHP variables to XSL files @@ -229,8 +313,13 @@ My node set : <foo>bar</foo> + + + + &reftitle.notes; ¬e.xslt.windows; + - + xslt_set_base Set the base URI for all XSLT transformations - - Description + + + &reftitle.description; voidxslt_set_base resourcexh @@ -19,13 +19,71 @@ access external resources. It is also used to resolve URIs for the <xsl:include> and <xsl:import> elements. + + + + &reftitle.parameters; - As of 4.3, the default base URI is the directory of the executing script. - In effect, it is the directory name value of the __FILE__ - constant. Prior to 4.3, the default base URI was less predictable. + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + uri + + + The base URI to be used. + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 4.3.0 + + As of PHP 4.3.0, the default base URI is the directory of the executing script. + In effect, it is the directory name value of the __FILE__ + constant. The default base URI is less predictable with older versions. + + + + + + + + + + &reftitle.notes; ¬e.xslt.windows; + - + xslt_set_encoding Set the encoding for the parsing of XML documents - - Description + + + &reftitle.description; voidxslt_set_encoding resourcexh @@ -20,6 +20,39 @@ encoding support. + + + &reftitle.parameters; + + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + encoding + + + An output encoding, e.g iso-8859-1. + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + - + xslt_set_error_handler Set an error handler for a XSLT processor - - Description + + + &reftitle.description; voidxslt_set_error_handler - resourcexh - mixedhandler + resourcexh + mixedhandler Set an error handler function for the XSLT processor given by @@ -19,20 +19,50 @@ error occurs in the XSLT transformation (this function is also called for notices). + + + + &reftitle.parameters; - The user function needs to accept four parameters: the XSLT processor, - the error level, the error code and an array of messages. The function - can be shown as: - - error_handler - resourcexh - interror_level - interror_code - arraymessages - + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + handler + + + The user function needs to accept four parameters: the XSLT processor, + the error level, the error code and an array of messages. The function + can be shown as: + + error_handler + resourcexh + interror_level + interror_code + arraymessages + + + + + - + + + &reftitle.returnvalues; + + &return.void; + + + + &reftitle.examples; <function>xslt_set_error_handler</function> Example @@ -101,13 +131,17 @@ array(4) { - + + &reftitle.seealso; - xslt_set_object if you want to use an - object method as handler. + + xslt_set_object if you want to use an + object method as handler + + - + xslt_set_log Set the log file to write log messages to - - Description + + + &reftitle.description; voidxslt_set_log resourcexh mixedlog - - - - xh - - - A reference to the XSLT parser. - - - - - log - - - This parameter is either a boolean value which toggles logging on and - off, or a string containing the logfile in which log errors too. - - - - This function allows you to set the file in which you want XSLT log messages to, XSLT log messages are different than error messages, in @@ -46,13 +26,52 @@ which enables logging, then if you want to set the log file to debug to, you must then pass it a string containing the filename. + + + + &reftitle.parameters; + + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + log + + + This parameter is either a boolean value which toggles logging on and + off, or a string containing the logfile in which log errors too. + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.notes; ¬e.xslt.windows; - + + &reftitle.examples; - - Using the XSLT Logging features - + + + Using the XSLT Logging features + ]]> - - + + + + + xslt_set_object Sets the object in which to resolve callback functions - - Description + + + &reftitle.description; boolxslt_set_object resourceprocessor @@ -25,7 +26,41 @@ of object. - + + + &reftitle.parameters; + + + + processor + + + The XSLT processor link identifier, created with + xslt_create. + + + + + obj + + + An object. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; Using your own error handler as a method @@ -60,6 +95,7 @@ class my_xslt_processor { + - + xslt_set_sax_handler Set SAX handlers for a XSLT processor - - Description + + + &reftitle.description; voidxslt_set_sax_handler resourcexh @@ -15,10 +15,31 @@ Set SAX handlers on the resource handle given by - xh. SAX handlers should be a two dimensional array - with the format (all top level elements are optional): - - + xh. + + + + + &reftitle.parameters; + + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + handlers + + + SAX handlers should be a two dimensional array + with the format (all top level elements are optional): + + @@ -41,10 +62,22 @@ array( [character] => character data handler ) ]]> - - + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + - + xslt_set_sax_handlers Set the SAX handlers to be called when the XML document gets processed - - Description + + + &reftitle.description; voidxslt_set_sax_handlers resourceprocessor @@ -19,9 +19,32 @@ processor resource. - handlers should be an array in the following format: - - + Using xslt_set_sax_handlers doesn't look very different than + running a SAX parser like xml_parse on the result of an + xslt_process transformation. + + + + + &reftitle.parameters; + + + + processor + + + The XSLT processor link identifier, created with + xslt_create. + + + + + handlers + + + handlers should be an array in the following format: + + ]]> - - - Where the functions follow the syntax described for the scheme handler - functions. - - - - The given array does not need to contain all of the different sax - handler elements (although it can), but it only needs to conform to - "handler" => "function" format described above. - - - - Each of the individual SAX handler functions are in the format below: - - - - - start_doc - resourceprocessor - - - - - - - end_doc - resourceprocessor - - - - - - - start_element - resourceprocessor - stringname - arrayattributes - - - - - - - end_element - resourceprocessor - stringname - - - - - - - start_namespace - resourceprocessor - stringprefix - stringuri - - - - - - - end_namespace - resourceprocessor - stringprefix - - - - - - - comment - resourceprocessor - stringcontents - - - - - - - pi - resourceprocessor - stringtarget - stringcontents - - - - - - - characters - resourceprocessor - stringcontents - - - - - - - Using xslt_set_sax_handlers doesn't look very different than - running a SAX parser like xml_parse on the result of an - xslt_process transformation. + + + Where the functions follow the syntax described for the scheme handler + functions. + + + + The given array does not need to contain all of the different sax + handler elements (although it can), but it only needs to conform to + "handler" => "function" format described above. + + + + Each of the individual SAX handler functions are in the format below: + + + + + start_doc + resourceprocessor + + + + + + + end_doc + resourceprocessor + + + + + + + start_element + resourceprocessor + stringname + arrayattributes + + + + + + + end_element + resourceprocessor + stringname + + + + + + + start_namespace + resourceprocessor + stringprefix + stringuri + + + + + + + end_namespace + resourceprocessor + stringprefix + + + + + + + comment + resourceprocessor + stringcontents + + + + + + + pi + resourceprocessor + stringtarget + stringcontents + + + + + + + characters + resourceprocessor + stringcontents + + + + + + + + - + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.examples; <function>xslt_set_sax_handlers</function> Example @@ -328,6 +359,7 @@ $exec = new data_sax_handler($xml, $xsl); + - + xslt_set_scheme_handler Set Scheme handlers for a XSLT processor - - Description + + + &reftitle.description; voidxslt_set_scheme_handler resourcexh @@ -15,10 +15,31 @@ Set Scheme handlers on the resource handle given by - xh. Scheme handlers should be an array with the - format (all elements are optional): - - + xh. + + + + + &reftitle.parameters; + + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + handlers + + + Scheme handlers should be an array with the + format (all elements are optional): + + get all handler, @@ -28,10 +49,22 @@ array( [close] => close handler ) ]]> - - + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + - + xslt_set_scheme_handlers Set the scheme handlers for the XSLT processor - - Description + + + &reftitle.description; voidxslt_set_scheme_handlers resourceprocessor @@ -17,6 +17,14 @@ &warn.undocumented.func; + + + &reftitle.returnvalues; + + &return.void; + + + + xslt_setopt Set options on a given xsl processor - - Description + + + &reftitle.description; mixedxslt_setopt resourceprocessor @@ -15,46 +16,77 @@ xslt_setopt sets the options specified by newmask on the given processor. + + + + + &reftitle.parameters; + + + + processor + + + The XSLT processor link identifier, created with + xslt_create. + + + + + newmask + + + newmask is a bitmask constructed with the + following constants: + + + + XSLT_SABOPT_PARSE_PUBLIC_ENTITIES - Tell the + processor to parse public entities. By default this has been turned + off. + + + + + XSLT_SABOPT_DISABLE_ADDING_META - Do not add + the meta tag "Content-Type" for HTML output. The default is set + during the compilation of the processor. + + + + + XSLT_SABOPT_DISABLE_STRIPPING - Suppress the + whitespace stripping (on data files only). + + + + + XSLT_SABOPT_IGNORE_DOC_NOT_FOUND - Consider + unresolved documents (the document() function) non-lethal. + + + + + + + + + + + + &reftitle.returnvalues; + Returns the number of previous mask is possible, &true; otherwise, &false; in case of an error. - - newmask is a bitmask constructed with the following - constants: - - - - XSLT_SABOPT_PARSE_PUBLIC_ENTITIES - Tell the processor - to parse public entities. By default this has been turned off. - - - - - XSLT_SABOPT_DISABLE_ADDING_META - Do not add the meta - tag "Content-Type" for HTML output. The default is set during the compilation - of the processor. - - - - - XSLT_SABOPT_DISABLE_STRIPPING - Suppress the whitespace - stripping (on data files only). - - - - - XSLT_SABOPT_IGNORE_DOC_NOT_FOUND - Consider unresolved - documents (the document() function) non-lethal. - - - - - + + &reftitle.examples; - - <function>xslt_setopt</function> Example - + + + <function>xslt_setopt</function> Example + ]]> - - - - - &reftitle.seealso; - - xslt_getopt. + + + + + &reftitle.seealso; + + + xslt_getopt + + + +