Re: Re: xsl + xml

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Colin Guthrie escribió:
José Manuel Peso Echarri wrote:
Hi people,

I  am looking for a library that mix xsl and xml producing output in
xhtml at server side.
I have readed about sablotron and libxsl, but i am confused.

Which is the best alternative in perfomance terms for the versions 4.2,
4.3?
is there some way for preprocess xsl or let ir in memory or any way for
improve the resources usage?

Dunno about v4, but for v5 at least:

$xsl = DOMDocument::loadXML($xslt_as_a_string);
$xsltproc = new XSLTProcessor;
$xsltproc->importStyleSheet($xsl);
echo $xsltproc->transformToXML($my_xml_dom_doc);

If anybody is interested in the code:

There is in DOM form(compile --with-dom-xslt and libxslt):
$xslDom = domxml_xslt_stylesheet_file($this->xsl);
       $params = array();
       $result = $this->xslDom->process($xml, $params);
       $this->assertEquals($this->html,$result->dumpmem());

There is in Sablotron form( compiling with --enable-xslt and sablotron ext):
$arguments = array('/_xml' => file_get_contents($this->xml), '/_xsl' => file_get_contents($this->xsl)); $xh = xslt_create(); $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL,arguments); xslt_free($xh);

Of course, all in PHP4


I had tested this two API for processing XSL, but now my question is about the improvement of resources usage.

I want to use eaccelerator extension for caching the xsl_stylessheet objects and give the xmls continuosly for getting xhtml. It not works correctly, because the xsl object contains a handler (that is not serializable).

Any way for caching in memory xsl objects ?


Regards,
Jose
Or something like that..... going form memory, so there may be more
appropriate commands etc.

Col.



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux