wiki:WikiStart
Last modified 5 years ago Last modified on 05/28/09 20:22:39

Official Source Code Repository Has Moved

As of May 28, 2009, the official source code repository and bug tracking database for QueryPath is located at GitHub. FedoraHosted? has been a wonderful starting point, but we need both the advanced issue tracker and the increased flexibility that GitHub? offers.

QueryPath: Find Your Way

QueryPath is a PHP library resembling jQuerycompare. It implements much of the jQuery API, but it is oriented toward server-side programming. It can be used for parsing or generating HTML and XML (including RSS Example, SVG Example, and similar formats). The QueryPathDataBase layer makes it easy to query a database and insert the results into HTML or XML documents. A plugin architecture makes it easy to extend.

QueryPath uses a chainable API (sometimes called a Fluent Interface). Following jQuery, it uses succinct and short idioms, making it easy to accomplish complex tasks in only a few lines of code.

Here's a sample of QueryPath in action:

<?php
require_once 'QueryPath/QueryPath.php';

qp('./test.html')->find('title')->text('Welcome')->writeHTML();
?>

This fragment loads the QueryPath library, and then executes a single jQuery chain. The chain opens a file, test.html, and then finds the <title/> element. The text inside of that element is then set to Welcome, and the entire document is then written to standard out (that is, it is sent to the client).

Read the QueryPathTutorial for an introduction to QueryPath.

Download QueryPath

Get the source, documentation, examples, and unit tests all in one file:

Download QueryPath 1.2 (TGZ)(ZIP).

See InstallQueryPath for installation instructions.

Older Releases

What You Need to Know

  • QueryPath is written in PHP 5, and it uses the DOM library that comes standard with PHP 5. The QPDB library, an extension that adds database support, uses PDO, another standard component of PHP 5. (QueryPath will not run on PHP 4)
  • QueryPath is made available under the GNU Lesser GPL (LGPL) or (at your choice) an MIT-like license. We encourage you to contribute your changes back, though, so that we can all work together to make a better library.
  • QueryPath has no license fees associated with it. Just download it and use it.

The Community

You may wish to join one of the two QueryPath groups/lists:

Find out more at the QueryPathCommunity page.

Other Sources

The Drupal QueryPath module is located at http://drupal.org/project/querypath. The TechnoSophos blog often has posts on QueryPath