XSLT not yet working for the Drupal querypath module

12 views
Skip to first unread message

michael_caudy

unread,
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.

Questions:

* 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
Drupal?

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

* 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,
http://www.slideshare.net/mbutcher/querypath-its-like-php-jquery-in-drupal?from=ss_embed

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

Thanks very much

Mike Caudy

Matt

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

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
this:

function mymodule_xslt($xml, $xslt) {

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

$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.

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