On 18 Feb 2002 17:34:38 GMT, [EMAIL PROTECTED] (Akkana) wrote:

>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.

This works pretty well, but I end up with lots of editor-specific
gubbins of the form

_moz_dirty="true"
type="_moz"

which I can remove with regexps - but how do I know what other bits
and pieces might appear?

Matthew Wilson

Reply via email to