I'm thinking of building my own XML editor. I want to do color schemes in the textbox. I was thinking if I could develop a stylesheet that would do the colorscheme for me, that would be great, but as far as I know, I can only parse valid XML. That means that I would have to wait until the user is done typing.

And If they are done typing and they put in invalid XML, how can I maintain that color scheme? If I can't do this with XSL/DOM, I'll just build by own string parsing routines, but if it can be done I'd like to know how.