At 08:11 AM 12/17/99 -0800, I wrote: >I think someone's being a bit too careful. The DOM API absolutely allows you >to create things that can't be serialized as well-formed XML. There was >a lot of discussion of this and it's a deliberate decision, not an accident. > >Hmm... there may be some other gotchas in the DOM spec that prevent you >from emitting *arbitrary* text, e.g. syntax-char escaping. I'll check.
OK, I checked with my local DOM expert who said: - if you're creating documents, you're using level 2 DOM, which means that the spec's not frozen and if it's getting in the way it can be fixed - at the current time, the createDocument method creates a document along with a root element, so if you just serialize that, you're always going to get at least one start-tag & end-tag - the chair of the DOM WG says that if this is a problem, someone should post a convincing use-case to [EMAIL PROTECTED] right now and they'll see what they can do Having said all that, I understand why a DOM implementation might have these checks. It seems very handy to have a facility to check that what I'm cooking up really is XML (if I want it to be). It seems really wrong though to have this happen at run-time *as* I add the nodes; slows things down and gets in the way. I'd want those methods to be batch kind of things that I can invoke when I'm finished building the doc and before I serialize. -Tim
