Excellent, thank you Heiko. I had taken a quick look at the class and
thought it would be quite hard to override. One small change in case
anyone else needs to do this. css needs to be set to None.
Thank again
Rob
On Oct 9, 10:22 am, Heiko Hees <[EMAIL PROTECTED]> wrote:
> Hi,
>
> > I would like to render just a fragment of xhtml. I would like to parse
> > the wiki text, then just render the summary, without the header and
> > containing tags. I have managed to use mwlib.xhtmlwriter.MWXHTMLWriter
> > but there is no way to prevent it adding the html, head, css and body
> > tags as they're all done in the constructor. Is there an alternative
> > for just rendering fragments?
>
> why not just inherit ?
>
> something like this should do it (untested):
>
> class YourWriter(MWXHTMLWriter):
> header = ""
> css = ""
> def __init__(self, **kargs):
> MWXHTMLWriter.__init__(self, **kargs)
> self.root = self.xmlbody = ET.Element("div")
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"mwlib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mwlib?hl=en
-~----------~----~----~----~------~----~------~--~---