From: <dg...@mo...> - 2004-09-14 07:54:39
|
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. Here my trials: set doc [dom::DOMImplementation create] set top [dom::document createElement $doc html] set head [dom::document createElement $top head] set title [dom::document createElement $head title] set titleText [dom::document createTextNode $title "MPIMG Berlin - Mouse Database"] set body [dom::document createElement $top body] set div [dom::document createElement $body div] puts [dom::serialize $doc] <?xml version='1.0'?> <!DOCTYPE html> <html><head><title>MPIMG Berlin - Mouse Database</title></head><body><div/></body></html> whichs renders ok in the browser but the correct declaration is missing. btw. a tDom like asHTML, asXML serialization would be great. 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" any help,suggestions on creating XHTML-conform documents? regards, Detlef -- Dr. Detlef Groth Max-Planck-Institut fuer Molekulare Genetik Ihnestr. 63/73 D-14195 Berlin Tel.: + 49 30 - 8413 1235 |