diff --git a/reference/xslt/functions/xslt-set-scheme-handlers.xml b/reference/xslt/functions/xslt-set-scheme-handlers.xml index ec1adec290..aa38e67ae8 100644 --- a/reference/xslt/functions/xslt-set-scheme-handlers.xml +++ b/reference/xslt/functions/xslt-set-scheme-handlers.xml @@ -1,20 +1,68 @@ - + xslt_set_scheme_handlers Set the scheme handlers for the XSLT processor - + &reftitle.description; voidxslt_set_scheme_handlers - resourceprocessor + resourcexh arrayhandlers - &warn.undocumented.func; + Registers the scheme handlers (XPath handlers) for the document. + + + + + &reftitle.parameters; + + + + xh + + + The XSLT processor link identifier, created with + xslt_create. + + + + + handlers + + + An array with the following keys: "get_all", "open", "get", "put", + and "close". + + + Every entry must be a function name or an array in the following + format: array($obj, "method"). + + + Note that the given array does not need to contain all of the + different scheme handler elements (although it can), but it only needs + to conform to the "handler" => "function" format described above. + + + Each of the individual scheme handler functions called are in the + formats below: + + + + + + + @@ -25,6 +73,67 @@ + + &reftitle.examples; + + + <function>xslt_set_scheme_handlers</function> example + + For example, here is an implementation of the "file_exists()" PHP function. + + +' . (file_exists($rest) ? 'true' : 'false') . ''; + } +} + +$SchemeHandlerArray = array('get_all' => 'mySchemeHandler'); + +// Start the engine +$params = array(); +$xh = xslt_create(); + +xslt_set_scheme_handlers($xh, $SchemeHandlerArray); + +$result = xslt_process($xh, "myFile.xml", "myFile.xsl", NULL, array(), $params); +xslt_free($xh); + +echo $result; + +?> +]]> + + + Then, inside the stylesheet, you can test whether a certain file exists with: + + + + + +]]> + + + + + + + &reftitle.seealso; + + + xslt_set_scheme_handler + + + +