<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.2//EN" "document-v12.dtd"> <document> <header> <title>XPath and XPath Search Plugins</title> </header> <body> <section> <title>Description</title> <p> The XPath and XPathSearch plugin allow you to search your blog using <a href="http://www.w3.org/TR/xpath">XPath</a> queries. The XPath plugin differs from the XPathSearch plugin in that a different URL parameter is used for the XPathSearch plugin. The XPath Search plugin is an extension of the Simple Search plugin in that if a query starts with a leading '/', then the plugin assumes an XPath syntax is being used, otherwise the search is handled by the Simple Search plugin. </p> <section> <title>Installation and Setup</title> <p> In your global <code>plugin.properties</code> file, add the following line: </p> <source> xpath=org.blojsom.plugin.trackback.XPathPlugin xpath-search=org.blojsom.plugin.xpath.XPathSearchPlugin </source> <p>You may then add "xpath" or "xpath-search" to one of the flavor-based plugin chains. If you are using the XPath Search plugin to replace the Simple Search plugin, then replace the Simple Search plugin short name (usually "simple-search) with the XPath Search plugin short name. These plugin chains can be found in the individual user's <code>plugin.properties</code> file. For example: </p> <source> html.blojsom-plugin-chain=xpath </source> </section> <section> <title>Usage and URL Parameters</title> <section> <title>Usage</title> <p> We will demonstrate examples in a short tutorial to extract informaiton from your blog entries using XPath syntax. For the time being, check out these blog entries: <a href="http://www.javaslash.org/blog/?permalink=xpathblojsom.txt">XPath and blojsom</a> and <a href="http://www.javaslash.org/blog/?permalink=fordavey.txt">XPath and blojsom followup</a>. </p> </section> <section> <title>URL parameters</title> <p> The following table describes the URL parameters that affect the output of the XPath and XPath Search plugin. </p> <table> <tr> <th>URL parameter</th> <th>Accepted values</th> <th>Usage</th> </tr> <tr> <td>xpath</td> <td>XPath query</td> <td>Used to search blog entries if using the XPath plugin.</td> </tr> <tr> <td>query</td> <td>XPath query</td> <td>Same as the Simple Search plugin if using the XPath Search plugin.</td> </tr> </table> </section> </section> </section> </body> </document>