# Scheme handlers for XSLT in progress.

- Thread: https://externals.io/message/5144
- Original archive: https://news-web.php.net/php.internals/5144
- Started by Adam Dickmeiss on 2003-10-31T10:23:34+00:00
- Messages: 7
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #5144 — Adam Dickmeiss — 2003-10-31T10:23:34+00:00

URL: https://externals.io/message/5144#5144

Hi,

we miss the scheme facility from PHP4's XSLT extension. So, we are 
making a new one for PHP5's XSL extension, i.e. interfacing libXSLT's 
xsltRegisterExtModuleFunction. If nobody else have done it/is doing it 
we'd like to contribute.

-- Adam

---

## #5146 — Christian Stocker — 2003-10-31T10:38:33+00:00

URL: https://externals.io/message/5144#5146 · In reply to: #5144

> Hi,
> 
> we miss the scheme facility from PHP4's XSLT extension. So, we are 
> making a new one for PHP5's XSL extension, i.e. interfacing libXSLT's 
> xsltRegisterExtModuleFunction. If nobody else have done it/is doing it 
> we'd like to contribute.

Can't you just use the stream-wrappers provided by PHP5? These are very 
well supported even in xslt. What's the difference between them and the 
sablotron way? Besides the different API in PHP userland?

chregu

---

## #5147 — Adam Dickmeiss — 2003-10-31T11:20:40+00:00

URL: https://externals.io/message/5144#5147 · In reply to: #5146

Christian Stocker wrote:

>
>
> 
>
> > […]
>
>
> Can't you just use the stream-wrappers provided by PHP5? These are 
> very well supported even in xslt. What's the difference between them 
> and the sablotron way? Besides the different API in PHP userland?
>
> chregu

Don't know the stream-wrappers, but from what I can see it doesn't do 
what we need. We want to be called by XSLT (with args etc) when XSLT 
meets registered elements&NS. So if you want a stylesheet with side 
effects, say that search in a database, just chaning the stream of XML 
doesn't help. XSLT must be in control - must have processed the args to 
the handler A stream approach is "separate" pass. Again, I may have 
misunderstood something, so we'd really like to know if it can be 
achived already..

-- Adam

---

## #5150 — Christian Stocker — 2003-10-31T15:19:31+00:00

URL: https://externals.io/message/5144#5150 · In reply to: #5147

Just as an update to this question

According to Adam, the stream-wrapper support in ext/xsl seems to have 
the same possibilities as the schemes support in the former sablotron 
extension. But he will further look into it and keep us/me updated about 
the outcome ;)

<extremely_shameless_plug>
I will talk about stream-wrapper support in ext/dom and ext/xsl in my 
talk next week at the php conference (and in the slides/examples 
published afterwards) ;)
</extremely_shameless_plug>

chregu



> Christian Stocker wrote:
> 
> > […]
> 
> 
> Don't know the stream-wrappers, but from what I can see it doesn't do 
> what we need. We want to be called by XSLT (with args etc) when XSLT 
> meets registered elements&NS. So if you want a stylesheet with side 
> effects, say that search in a database, just chaning the stream of XML 
> doesn't help. XSLT must be in control - must have processed the args to 
> the handler A stream approach is "separate" pass. Again, I may have 
> misunderstood something, so we'd really like to know if it can be 
> achived already..
> 
> -- Adam
> 
> > […]
> 

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  chregu@bitflux.ch  |  gnupg-keyid 0x5CE1DECB

---

## #5183 — Adam Dickmeiss — 2003-11-04T14:16:59+00:00

URL: https://externals.io/message/5144#5183 · In reply to: #5150

Christian Stocker wrote:

> Just as an update to this question
>
> According to Adam, the stream-wrapper support in ext/xsl seems to have 
> the same possibilities as the schemes support in the former sablotron 
> extension. But he will further look into it and keep us/me updated 
> about the outcome ;)
>
I've wrapped made a stream class with methods stream_open, stream_read, 
stream_tell, stream_eof, stream_seek, stream_stat, stream_close. When I 
use this handler from within XSLT I get :
*Warning*: xsltprocessor::importStylesheet() [function.importStylesheet 
<http://peanut:8080/tkl5/function.importStylesheet>]: 
tkl_file_stream::url_stat is not implemented! in 
*/home/adam/proj/httpd/htdocs/tkl5/xsl-ex2.php* on line *70*
What's url_stat supposed to do? Prototype?

-- Adam

---

## #5184 — Adam Dickmeiss — 2003-11-04T14:42:42+00:00

URL: https://externals.io/message/5144#5184 · In reply to: #5183

Adam Dickmeiss wrote:

> Christian Stocker wrote:
>
> > […]
> I've wrapped made a stream class with methods stream_open, 
> stream_read, stream_tell, stream_eof, stream_seek, stream_stat, 
> stream_close. When I use this handler from within XSLT I get :
> *Warning*: xsltprocessor::importStylesheet() 
> [function.importStylesheet 
> <http://peanut:8080/tkl5/function.importStylesheet>]: 
> tkl_file_stream::url_stat is not implemented! in 
> */home/adam/proj/httpd/htdocs/tkl5/xsl-ex2.php* on line *70*
> What's url_stat supposed to do? Prototype?

Looking at the PHP source, I decided to use:
    function url_stat ($path)
    {
        return array();
    }
with satisfactory results, so far.

-- Adam


 

>
> -- Adam

---

## #5185 — Christian Stocker — 2003-11-04T15:28:20+00:00

URL: https://externals.io/message/5144#5185 · In reply to: #5184

> Adam Dickmeiss wrote:
> 
> > […]
> 
> 
> Looking at the PHP source, I decided to use:
>    function url_stat ($path)
>    {
>        return array();
>    }
> with satisfactory results, so far.

Yep, it's supposed to have the same format as the array returned by 
 `fstat()`. But an empty array is ok ;)

chregu

> 
> -- Adam
> 
> 
> 
> 
> > […]
> 

-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  chregu@bitflux.ch  |  gnupg-keyid 0x5CE1DECB
