Mercurial > genshi > mirror
comparison markup/plugin.py @ 151:fb71efbd6ad4 trunk
The convention for an unknown position is `(None, -1, -1)`.
author | cmlenz |
---|---|
date | Tue, 15 Aug 2006 22:03:39 +0000 |
parents | 537f819c547b |
children | 7b1f07496bf7 |
comparison
equal
deleted
inserted
replaced
150:d35688d16831 | 151:fb71efbd6ad4 |
---|---|
25 tag_name = element.tag | 25 tag_name = element.tag |
26 if tag_name.startswith('{'): | 26 if tag_name.startswith('{'): |
27 tag_name = tag_name[1:] | 27 tag_name = tag_name[1:] |
28 tag_name = QName(tag_name) | 28 tag_name = QName(tag_name) |
29 | 29 |
30 yield (Stream.START, (tag_name, element.items()), | 30 yield (Stream.START, (tag_name, element.items()), (None, -1, -1)) |
31 ('<string>', 0, 0)) | |
32 if element.text: | 31 if element.text: |
33 yield Stream.TEXT, element.text, ('<string>', 0, 0) | 32 yield Stream.TEXT, element.text, (None, -1, -1) |
34 for child in element.getchildren(): | 33 for child in element.getchildren(): |
35 for item in ET(child): | 34 for item in ET(child): |
36 yield item | 35 yield item |
37 yield Stream.END, tag_name, ('<string>', 0, 0) | 36 yield Stream.END, tag_name, (None, -1, -1) |
38 if element.tail: | 37 if element.tail: |
39 yield Stream.TEXT, element.tail, ('<string>', 0, 0) | 38 yield Stream.TEXT, element.tail, (None, -1, -1) |
40 | 39 |
41 | 40 |
42 class TemplateEnginePlugin(object): | 41 class TemplateEnginePlugin(object): |
43 """Implementation of the plugin API.""" | 42 """Implementation of the plugin API.""" |
44 | 43 |