|
From: Joe E. <jen...@fl...> - 2001-06-13 01:02:06
|
Cameron Laird wrote:
> [is there a way]
> to get TclDOM to create a document withOUT a
> <!DOCTYPE ...>
Serialize the document element node
instead of the root node:
package require dom
set doc [dom::DOMImplementation create]
dom::node appendChild $doc [dom::document createElement $doc FOO]
# To include <!DOCTYPE ...> declaration:
dom::DOMImplementation serialize $doc
# To omit it:
dom::DOMImplementation serialize \
[dom::document cget $doc -documentElement]
I think that dom::c has a bug where [dom::DOMImplementation serialize]
can end up writing out _two_ <!DOCTYPE ...> declarations
under certain circumstances; I haven't looked into this yet.
--Joe English
jen...@fl...
|