Menu

Using Orca without --enable-xslt

Help
warriorGod
2006-12-21
2013-04-16
  • warriorGod

    warriorGod - 2006-12-21

    Yes, my host doesnt have php configured with this extension. Well there was nothing left, but to modify the code. Because this forum application is so nice and sexy it just had to be done. With this modification in place, you can use orca in an default PHP/mysql instalation:

    line 96, file:BxXslTransform.php

    replace

    $xh = xslt_create();
    xslt_setopt($xh, XSLT_SABOPT_IGNORE_DOC_NOT_FOUND);
    $res = xslt_process ($xh, 'arg:/_xml', $this->_xsl, NULL, $args);
    xslt_free($xh);

    with

    $doc = domxml_open_mem($this->_xml);
    $stylesheet = domxml_xslt_stylesheet_file($this->_xsl);
    $res = $stylesheet->process($doc, $params);

    and
    line 120+- , same file:

    replace

    $xh = xslt_create();
    $res = xslt_process ($xh, $this->_xml, $this->_xsl, NULL, $args);
    xslt_setopt($xh, XSLT_SABOPT_IGNORE_DOC_NOT_FOUND);
    xslt_free($xh);

    with

    $doc = domxml_open_file($this->_xml);
    $stylesheet = domxml_xslt_stylesheet_file($this->_xsl);
    $res = $stylesheet->process($doc, $params);

    and one more:

    line 55, file: util.inc.php

    replace

    $xslt->process();

    with

    $doc = $xslt->process();
    echo str_replace(Array('<![CDATA[',']]>'),Array('/*<![CDATA[*/','/*]]>*/'),$doc->dump_mem());

    This last section takes care of the CDATA keyword and coments it, so it conforms to the XHTML standard. Dont know if this is a bug or difference introduced by diferent transformations.

    Hope this saves some one some time :) I just couldnt wait to start using it!

     
    • warriorGod

      warriorGod - 2006-12-21

      Forgot to post this information before:

      http://www.sitepoint.com/print/transform-php-xslt
      It describes the process of installing the extensions needed to run orca unmodified.

       
    • Orca

      Orca - 2007-02-21

      Thank you a lot

      In Orca 1.1 this was implemented by default -  if sablot xslt extention is not found .. Orca 1.1 use another method of transformation. Like you described.

       

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.