> result += u'<pre id="%s">%s %s</pre>\n' % (count, tlineno,
> tline)
> count += 1
> return result
> which passes the XHTML to the line:
> thtml = genshi.XML(ttext)
> which is where the Junk after Document element comes in.
Yes, because you don't have a root element. If you intend that to
work, you'd need to have something like a <div> around the whole thing.
> Is there a Genshi method to either transform the HTML or a better line
> that genshi.XML which would make the markup machine readably happy?
See http://genshi.edgewall.org/wiki/ApiDocs/0.4.x/genshi.builder
which will also handling escaping <, >, & for you.
Tim