XSLT not yet working for the Drupal querypath module

Skip to first unread message


Aug 31, 2010, 5:10:02 PM8/31/10
to devel-querypath, mca...@gmail.com
Hi Matt,

Several days ago I asked whether XSLT is working in QueryPath, and you
sent me a file to test, using PHPUnit. I don't have experience yet
with unit testing, but I was able to get XSLT working fine in
Querypath 2.01, running on straight PHP. However, I have not been
able to get XSLT working for the Drupal querypath module, although
XPATH is working fine.


* Is Version 1.5 the version of QueryPath contained in the querypath
module for Drupal 6?

* If so, is that version not able to support XSLT when running within

* Is it possible to fix the Drupal querypath module, so that XSLT is

* Alternatively, can the QueryPath 2.0.1 module be substituted for the
QueryPath file that is in the Drupal querypath module?
Note: I tried to make this substitution, but it did not fix the lack
of XSLT problem, and there were then errors because some of the files
paths specified were incorrect.

* In practice, should the QueryPath 2.0.1 be able to work within the
Drupal querypath module - if the file paths are corrected - or are
there fundamental incompatibilities.

* Can you please update the Drupal querypath module, so that it uses
QP 2.0.1, and/or so that XSLT works?

Also, in one of your recent slide presentations,

you said that Drupal 7 QueryPath module is done. When will that be

Thanks very much

Mike Caudy


Aug 31, 2010, 6:13:00 PM8/31/10
to devel-querypath

The version of QueryPath version currently released has QP 2.01 (I
just made the D7 version available, too, which includes 2.1Alpha1)

I wonder if the issue is that the extension isn't loaded. For
performance reasons, I don't load any of the extensions except for the
database extension.

To use XSL in Drupal, you should be able to write a function like

function mymodule_xslt($xml, $xslt) {

// The extension isn't loaded by default, so we load it.
require_once drupal_get_path('module', 'querypath') . '/QueryPath/

$transformed = qp($xml)->xslt($xslt)->top()->xml();

Does that work? If not, have you checked to make sure the server has
XSLT support? Can you give me any information about how it is failing?

Keep me posted.

>        http://www.slideshare.net/mbutcher/querypath-its-like-php-jquery-in-d...
Reply all
Reply to author
0 new messages