The following code:
# movediv.py
from genshi.template import MarkupTemplate
template = """<html xmlns="
http://www.w3.org/1999/xhtml"
xmlns:py="
http://genshi.edgewall.org/" lang="en">
<py:match path="div[@id='altlinks']">
<?python altlinks = select('*|text()') ?>
</py:match>
<py:match path="div[@id='ctxtnav']">
<div id="ctxtnav" class="nav">
${select('*|text()')}
${altlinks}
</div>
</py:match>
<div id="altlinks">
ALT LINKS
</div>
<div id="ctxtnav">
CTXTNAV
</div>
</html>"""
t = MarkupTemplate(template)
s = t.generate()
print s.render()
# end
Outputs the following for me on Genshi trunk:
$ python movediv.py
<html xmlns="
http://www.w3.org/1999/xhtml" lang="en">
<div id="ctxtnav" class="nav">
CTXTNAV
ALT LINKS
</div>
</html>
Which seems to do what people want? Not sure why the original poster
thought this didn't work?
Schiavo
Simon