Re: [PHP] Re: xsl + xml

2006-10-04 Thread José Manuel Peso

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.

  




[PHP] Re: xsl + xml

2006-09-20 Thread Colin Guthrie
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);

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

Col.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: xsl + xml

2006-09-20 Thread Tony Marston
http://www.tonymarston.net/php-mysql/domxml.html
http://www.tonymarston.net/php-mysql/sablotron.html
http://www.tonymarston.net/php-mysql/dom.html
http://www.tonymarston.net/php-mysql/xsl.html

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

José Manuel Peso Echarri [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 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?

 Thanks

 Regards,
 Jose 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php