From: Cameron L. <cl...@st...> - 2001-06-13 17:15:04
|
From jen...@fl... Tue Jun 12 20:19:32 2001 . . . > [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] . . . Thank you, Joe. What I really need is more XML documentation. In fact, I've been doing the serialize-the-document trick, and thinking of it as a trick; apparently I wasn't so ori- ginal. What puzzles me, though, is that I see in the WSDL world, for example, <?xml version='1.0'> <!-- what happened to the DOCTYPE? --> <wsdl:definitions xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'> ... </wsdl:definitions> What is *that*? Is there some name for version-element-plus- serialized-document? Is there a clever way to generate it? Quite-unrelated question: has anyone written WSDL::pretty_print node to supplement WSDL::serialize node ? The former would, I imagine, indent elements proportionally to their depth, and perhaps prettify attribute punctuation, and so on. Would such a thing interest anyone else, if I write it? |