Matthew Wilson wrote:
> 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?
> 
> Any tips appreciated.

I don't think you can. All the tags are hardcoded. I would just get the 
html document then parse it with regular expression to substute the 
tags. (thats what I have to do to get mozblog to upload the correct url 
for the images. I couldn't use the relative url feature since the 
document does not exist on disk)

But it would be good if editor people makes all tags well formed. So 
moving to xml/xhtml is easier.

> 
> Matthew Wilson

Mike


Reply via email to