Mercurial > genshi > genshi-test
comparison doc/streams.txt @ 857:24733a5854d9
Avoid unicode literals in `repr`s of `QName` and `Namespace` when not necessary.
author | cmlenz |
---|---|
date | Thu, 12 Nov 2009 15:09:26 +0000 |
parents | 4376010bb97e |
children |
comparison
equal
deleted
inserted
replaced
856:1e2be9fb3348 | 857:24733a5854d9 |
---|---|
46 .. code-block:: pycon | 46 .. code-block:: pycon |
47 | 47 |
48 >>> for kind, data, pos in stream: | 48 >>> for kind, data, pos in stream: |
49 ... print('%s %r %r' % (kind, data, pos)) | 49 ... print('%s %r %r' % (kind, data, pos)) |
50 ... | 50 ... |
51 START (QName(u'p'), Attrs([(QName(u'class'), u'intro')])) (None, 1, 0) | 51 START (QName('p'), Attrs([(QName('class'), u'intro')])) (None, 1, 0) |
52 TEXT u'Some text and ' (None, 1, 17) | 52 TEXT u'Some text and ' (None, 1, 17) |
53 START (QName(u'a'), Attrs([(QName(u'href'), u'http://example.org/')])) (None, 1, 31) | 53 START (QName('a'), Attrs([(QName('href'), u'http://example.org/')])) (None, 1, 31) |
54 TEXT u'a link' (None, 1, 61) | 54 TEXT u'a link' (None, 1, 61) |
55 END QName(u'a') (None, 1, 67) | 55 END QName('a') (None, 1, 67) |
56 TEXT u'.' (None, 1, 71) | 56 TEXT u'.' (None, 1, 71) |
57 START (QName(u'br'), Attrs()) (None, 1, 72) | 57 START (QName('br'), Attrs()) (None, 1, 72) |
58 END QName(u'br') (None, 1, 77) | 58 END QName('br') (None, 1, 77) |
59 END QName(u'p') (None, 1, 77) | 59 END QName('p') (None, 1, 77) |
60 | 60 |
61 | 61 |
62 Filtering | 62 Filtering |
63 ========= | 63 ========= |
64 | 64 |
377 the attribute names and values associated with the tag (excluding namespace | 377 the attribute names and values associated with the tag (excluding namespace |
378 declarations): | 378 declarations): |
379 | 379 |
380 .. code-block:: python | 380 .. code-block:: python |
381 | 381 |
382 START, (QName(u'p'), Attrs([(QName(u'class'), u'intro')])), pos | 382 START, (QName('p'), Attrs([(QName('class'), u'intro')])), pos |
383 | 383 |
384 END | 384 END |
385 --- | 385 --- |
386 The closing tag of an element. | 386 The closing tag of an element. |
387 | 387 |
388 The ``data`` item of end events consists of just a ``QName`` instance | 388 The ``data`` item of end events consists of just a ``QName`` instance |
389 describing the qualified name of the tag: | 389 describing the qualified name of the tag: |
390 | 390 |
391 .. code-block:: python | 391 .. code-block:: python |
392 | 392 |
393 END, QName(u'p'), pos | 393 END, QName('p'), pos |
394 | 394 |
395 TEXT | 395 TEXT |
396 ---- | 396 ---- |
397 Character data outside of elements and comments. | 397 Character data outside of elements and comments. |
398 | 398 |