# Why not attach XMLReader / XMLWriter to open php streams?

- Thread: https://externals.io/message/48817
- Original archive: https://news-web.php.net/php.internals/48817
- Started by Hans-Peter Oeri on 2010-06-17T13:59:41+00:00
- Messages: 2
- 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

---

## #48817 — Hans-Peter Oeri — 2010-06-17T13:59:41+00:00

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

Hi!

As documented - and several searches did not lead to a different result
- XMLReader and XMLWriter can only work on an URI. That would be a php
stream opened and closed by themselves.

For several workflows, e.g. with php://temp, it would be nice to be able
to "attach" XMLReader/XMLWriter to a pre-opened php stream. I would
describe it as letting them work "on a stream" instead of "on an uri".

As I didn't find anything about it: Is there a reason for not supporting
'stream resources'? Other extension, like e.g. curl, do.

HPO

---

## #48825 — Rob Richards — 2010-06-18T13:29:43+00:00

URL: https://externals.io/message/48817#48825 · In reply to: #48817

Hans-Peter Oeri wrote:
> Hi!
>
> As documented - and several searches did not lead to a different result
> - XMLReader and XMLWriter can only work on an URI. That would be a php
> stream opened and closed by themselves.
>
> For several workflows, e.g. with php://temp, it would be nice to be able
> to "attach" XMLReader/XMLWriter to a pre-opened php stream. I would
> describe it as letting them work "on a stream" instead of "on an uri".
>
> As I didn't find anything about it: Is there a reason for not supporting
> 'stream resources'? Other extension, like e.g. curl, do.
>
> HPO
>
>   

There never was a real need for this. Can easily be done by creating 
your own stream wrapper and feeding the already opened streamed through it.

Rob
