Edgewall Software

Changes between Version 21 and Version 22 of GenshiTutorial


Ignore:
Timestamp:
Aug 29, 2007, 8:49:41 PM (17 years ago)
Author:
michael@…
Comment:

Adding link to Wikipedia's article on XPath

Legend:

Unmodified
Added
Removed
Modified
  • GenshiTutorial

    v21 v22  
    683683 Finally, this is an example for using a more complex XPath pattern. This `select()` incantation here returns a stream that contains all child elements of the original `<head>`, except for those elements that have the local name “title”. If we didn't add that predicate, the output stream would contain two `<title>` tags, and we don't want that.
    684684
    685 If you've done a bit of XSLT, match templates should look familiar. Otherwise, you may want to familiarize yourself with the basics of XPath 1—note though that Genshi only implements a subset of the full spec as explained in [wiki:Documentation/xpath.html Using XPath in Genshi]. And just play around with match templates; at the core, the concept is actually very simple and consistent.
     685If you've done a bit of XSLT, match templates should look familiar. Otherwise, you may want to familiarize yourself with the basics of [http://en.wikipedia.org/wiki/XPath XPath 1]—note though that Genshi only implements a subset of the full spec as explained in [wiki:Documentation/xpath.html Using XPath in Genshi]. And just play around with match templates; at the core, the concept is actually very simple and consistent.
    686686
    687687Now we need to update the page templates: they no longer need the header and footer, and we'll have to include the `layout.html` file. For the inclusion, we add the namespace prefix for XInclude, and an `xi:include` element.