From: <dg...@mo...> - 2004-09-14 14:22:38
|
Steve thanks for the fast response, > > Firstly, which version of TclDOM are you using? Version 3.0, the tcl-one. > On 14/09/2004, at 5:54 PM, Detlef Groth wrote: > > > Hello, I am using TclDom inside the tclh-webserver to build an > > webapplication. I was trying to figure out how to build a > > XHTML-Declaration like this: > > > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > > > or a even a HTML-DTD > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > > "http://www.w3.org/TR/html4/strict.dtd"> > > > > via this `dom::DOMImplementation createDocumentType' Command but did > > not get success. > > If you are using v2.6 then it will definitely not work. > If you are using v3.0 then please submit a bug report. documentType > nodes should now be working correctly. > > > btw. a tDom like asHTML, asXML serialization would be great. > > dom::serialize $doc -method "xml" > dom::serialize $doc -method "html" (tclkit) 60 % package require dom 3.0 (tclkit) 61 % set doc [dom::DOMImplementation create] ::dom::tcl::document5::Document (tclkit) 62 % set top [dom::document createElement $doc html] ::dom::tcl::document5::node2 (tclkit) 63 % set head [dom::document createElement $top head] ::dom::tcl::document5::node6 (tclkit) 64 % set title [dom::document createElement $head title] ::dom::tcl::document5::node10 (tclkit) 65 % set titleText [dom::document createTextNode $title "MPIMG Berlin - Mouse Database"] ::dom::tcl::document5::node14 (tclkit) 66 % set body [dom::document createElement $top body] ::dom::tcl::document5::node18 (tclkit) 67 % set div [dom::document createElement $body div] ::dom::tcl::document5::node22 (tclkit) 68 % dom::serialize $doc -method "html" <?xml version='1.0'?> <!DOCTYPE html> <html><head><title>MPIMG Berlin - Mouse Database</title></head><body><div/></body></html> (tclkit) 69 % dom::serialize $doc -method "xml" <?xml version='1.0'?> <!DOCTYPE html> <html><head><title>MPIMG Berlin - Mouse Database</title></head><body><div/></body></html> (tclkit) 70 % dom::serialize $doc <?xml version='1.0'?> <!DOCTYPE html> <html><head><title>MPIMG Berlin - Mouse Database</title></head><body><div/></body></html> I can't see a difference between those three versions. > > aren't good enough for you? > > > Here a trial with the `dom::DOMImplementation createDocumentType' > > set doc [dom::DOMImplementation createDocumentType HTML PUBLIC > > "-//W3C//DTD XHTML 1.0 Transitional//EN" > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"] > > dom::serialize $doc > > but > > invalid command name "Serialize:documentType" > > My first reaction is to make sure you are using v3.0. May be if somebody could provide a minimal example writing an XHTML-conform document with TclDom this would be enough. Anyway it renders okay even if is not an valid XHTML-document, so Steve did a great job. Thanks. > > Cheers, > Steve Ball > > --- > > Steve Ball | XSLT Standard Library | Training & Seminars > Zveno Pty Ltd | Web Tcl Complete | XML XSL Schemas > http://www.zveno.com/ | TclXML TclDOM | Tcl, Web Development > Ste...@zv... +---------------------------+--------------------- > Ph. +61 2 6242 4099 | Mobile (0413) 594 462 | Fax +61 2 6242 4099 > > regards, Detlef -- Dr. Detlef Groth Max-Planck-Institut fuer Molekulare Genetik Ihnestr. 63/73 D-14195 Berlin Tel.: + 49 30 - 8413 1235 |