xsl-list
[Top] [All Lists]

RE: [xsl] XSLT arguments in PHP 5

2006-06-21 13:24:58
Hi, 

The question was if you can hand over directly a tree of
nodes (e.g. a tree build via the PHP DOM API, or a parsed XML document),
or if this technique is bound to work only on the serialized form.

Rob Richards just clarified this on the xml(_at_)gnome(_dot_)org list:
The custom stream-based wrappers can only hand over the serialized form.
If one wants to pass node trees (packed in a node set or result tree
fragment or sequence or whatever) to the transformation, one has
to use extension functions.
Quoting Rob:
"There are examples in the PHP manual for the registerPHPFunctions()
method that explictly demonstrate PHP returning nodes to an in progress
transformation."

Cheers,

Kasimier

-----Original Message-----
From: Martynas Jusevicius 
[mailto:martynas(_dot_)jusevicius(_at_)gmail(_dot_)com] 

Node trees? What do you mean? Node-sets, document fragments? Is a
document not a node-tree?
This approach basicaly imitates files, so you could pass anything you
want. Another thing is what the document() function expects.
I only see it working in combination with document() function, that
would mean no document fragments.

On 6/21/06, Buchcik, Kasimier <k(_dot_)buchcik(_at_)4commerce(_dot_)de> wrote:
Hi,

Great!

Someone raised a similar question some weeks ago; it seemed
like there was no way to pass node trees into PHP 5.
Can this stream-based mechanism be tweaked to allow for passing
node trees as well, or is it restricted to in-memory XML documents?

Regards,

Kasimier

-----Original Message-----
From: Martynas Jusevicius 
[mailto:martynas(_dot_)jusevicius(_at_)gmail(_dot_)com]

Thanks for trying, but I finally managed to get 
stream-based solution
working :) Thanks to this:
http://alexandre.alapetite.net/doc-alex/xslt-php4-php5/xslt-ph
p4-to-php5.php.txt

On 6/21/06, Buchcik, Kasimier <k(_dot_)buchcik(_at_)4commerce(_dot_)de> 
wrote:
Hi,

-----Original Message-----
From: Martynas Jusevicius 
[mailto:martynas(_dot_)jusevicius(_at_)gmail(_dot_)com]

Well, I want to pass dinamically formed XML as side-documents
for my stylesheet.

In PHP4's processing function there was an option of 
passing such
arguments and later accessing them through
Sablotron-specific scheme
"document('arg:/...)".

Ah. This can be made workable with Libxslt/Libxml2.

I'm looking for an alternative in PHP5. Are saying it is not
possible yet? :/

I don't know if it's currently possible with PHP 5. I can only
provide info about Libxml2's side. So others will be of
more help here.

Quoting Zend: "All the XML extensions now support PHP streams
throughout, even if you try to access a stream not
directly from PHP.
<...> Basically, you can access a PHP stream everywhere
where you can
access a normal file."
So I thought I might implement my own stream wrapper and
use it with
document(). I have no luck here though.

[...]

Cheers,

Kasimier







--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>