A DOM document must have a root element (and only one) underneath the text will come.
A DOM document fragment can have any number of elements of any type. Use a document fragment instead. The new Serializer API contains a method for serializing a document fragment precisely for these cases. Cheers arkin Pierpaolo Fumagalli wrote: > > [EMAIL PROTECTED] wrote: > > > > Pier wrote > > >Good, so I can have a document with only a big text node as a child > > >node? That's what the spec says? I'm all for it. So, it's a bug in > > >Xerces DOM. > > > > This particular construct is forbidden by the DOM Level 1 spec, which lists > > what node types are allowed as children for each of the other node types, > > and what exception should be raised if an attempt is made to add one of the > > forbidden types as a child node. > > Ok... So we get back to my first idea, that those sanity check ARE > required from the spec, and we cannot build NON-XML documents using DOM > (as Stefano said)... > > Pier... right now REALLY confused...
