Loading:


    xslt_set_scheme_handlers

    void xslt_set_scheme_handlers  ( resource $xh  , array $handlers  )

    Rejestr systemu obsługi (XPath handlers) do dokumentu.

    Parametry:


    xh-
    XSLT procesor Link identyfikator, utworzone z xslt_create ().

    handlers-Tablica z poniższych kluczy: "get_all", "open", "get", "put", and "close".

    Każdy wpis musi być funkcją lub nazwą tablicy w następującym formacie: array ($ obj, "metoda").

    Zauważ, że w dana tablica nie musi zawierać wszystkich różnych elementów systemu obsługi (choć może), musi tylko być zgodne z "handler" => "function" w formacie opisanym powyżej.

    Każda z poszczególnych funkcji systemu obsługi zawarta jest w formatach poniżej:

    string   get_all(resource processor, string scheme, string rest)
    resource open(resource processor, string scheme, string rest)
    int get(resource processor, resource fp, string &data)
    int put(resource processor, resource fp, string data)
    void close(resource processor, resource fp)

     



    Napisz Artyku³

    Listing

    <?php

    // Definition of the handler
    function mySchemeHandler($processor, $scheme, $rest)
    {
    $rest = substr($rest,1);/ / Usunięcie pierwszego / dodawane automatycznie przez silnik
        if ($scheme == 'file_exists') {
        / / Wynik jest osadzony w małych ciągach xml
        return '<?xml version="1.0" encoding="UTF-8"?><root>' . (file_exists($rest) ? 'true' : 'false') . '</root>';
        }
    }

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

    ?>
     




    Dodano przez: igor
    Ranga: Administrator serwisu Punktów: 0
    Komentarze użytkowników
      • Tre¶æ komentarza
        Kod do komentarza (opcjonalnie)
        PHP JavaScript MySQL Smarty SQL HTML CSS ActionScript
        Autor
        Token
        token

         

         








    funkcje.net
    Wszelkie prawa zastrzeżone©. | Funkcje.net 2008-2025 v.1.5 | design: diviXdesign & rainbowcolors