Matthew Wilson writes:
> I have an XUL window which uses an <editor> to embed an HTML editor. I
> then use editorShell.GetContentsAs('text/html', 0) to retrieve the
> contents of the window.
> 
> What I need is a way of making sure that what I receive is
> well-formed, in the XML sense, for example, I get <br/> instead of
> <br>, and so on. Can I do anything to the editor to ensure that this
> is the case? Or would I have to do walk the DOM tree myself?

You might want to look at the nsXMLContentSerializer.  I'm not sure
if it is currently used anywhere, but you might be able to use it to do
the work of walking the dom and converting to XML-style tags instead of
using the normal html shortcuts that nsHTMLContentSerializer uses.

        ...Akkana

Reply via email to