comparison doc/xpath.txt @ 230:24757b771651

Renamed Markup to Genshi in repository.
author cmlenz
date Mon, 11 Sep 2006 15:07:07 +0000
parents 09f869a98149
children ebc7c1a3bc4d
comparison
equal deleted inserted replaced
229:110d69dbbda3 230:24757b771651
1 .. -*- mode: rst; encoding: utf-8 -*- 1 .. -*- mode: rst; encoding: utf-8 -*-
2 2
3 ===================== 3 =====================
4 Using XPath in Markup 4 Using XPath in Genshi
5 ===================== 5 =====================
6 6
7 Markup provides basic XPath_ support for matching and querying event streams. 7 Genshi provides basic XPath_ support for matching and querying event streams.
8 8
9 .. _xpath: http://www.w3.org/TR/xpath 9 .. _xpath: http://www.w3.org/TR/xpath
10 10
11 11
12 .. contents:: Contents 12 .. contents:: Contents
16 16
17 ----------- 17 -----------
18 Limitations 18 Limitations
19 ----------- 19 -----------
20 20
21 Due to the streaming nature of the processing model, Markup uses only a subset 21 Due to the streaming nature of the processing model, Genshi uses only a subset
22 of the `XPath 1.0`_ language. 22 of the `XPath 1.0`_ language.
23 23
24 .. _`XPath 1.0`: http://www.w3.org/TR/xpath 24 .. _`XPath 1.0`: http://www.w3.org/TR/xpath
25 25
26 In particular, only the following axes are supported: 26 In particular, only the following axes are supported:
29 * ``child`` 29 * ``child``
30 * ``descendant`` 30 * ``descendant``
31 * ``descendant-or-self`` 31 * ``descendant-or-self``
32 * ``self`` 32 * ``self``
33 33
34 This means you can't use the ``parent``, ancestor, or sibling axes in Markup 34 This means you can't use the ``parent``, ancestor, or sibling axes in Genshi
35 (the ``namespace`` axis isn't supported either, but what you'd ever need that 35 (the ``namespace`` axis isn't supported either, but what you'd ever need that
36 for I don't know). Basically, any path expression that would require buffering 36 for I don't know). Basically, any path expression that would require buffering
37 of the stream is not supported. 37 of the stream is not supported.
38 38
39 Predicates are of course supported, but Path expressions *inside* predicates 39 Predicates are of course supported, but Path expressions *inside* predicates
62 Querying Streams 62 Querying Streams
63 ---------------- 63 ----------------
64 64
65 :: 65 ::
66 66
67 from markup.input import XML 67 from genshi.input import XML
68 68
69 doc = XML('''<doc> 69 doc = XML('''<doc>
70 <items count="2"> 70 <items count="2">
71 <item status="new"> 71 <item status="new">
72 <summary>Foo</summary> 72 <summary>Foo</summary>
Copyright (C) 2012-2017 Edgewall Software