From: Steve B. <Ste...@zv...> - 2002-09-06 22:43:09
|
Someone has reported the CreateDocType problem independently, so you're not alone. Please submit a SF bug report and attach the patch. I'll have to review the syntax and semantics for createDocType wrt to the DOM Level 2 spec. I'm not sure I'll be able to get this fixed as part of the v2.3 release. Cheers, Steve Derek Fountain wrote: >>::dom::DOMImplementation createDocumentType $doc "test" {} "test.dtd" >>::dom::document createElement $doc "test" >> >>puts [::dom::DOMImplementation serialize $doc] >> >>which gives an error: >> >>"wrong number of arguments, should be: DOMImplementation createDocumentType >>name publicid systemid" >> >>Looking at the code in tclxml-2.0 and 2.2, I'm a bit suspicous that >>something's not right. Do the parameters for the call to CreateDocType from >>inside dom::tcl::DOMImplementation match up with what the routine's >>expecting to receive? I'm a bit out of my depth with that sort of Tcl code, >>so apologies if I'm casting aspersions. >> >>Can someone fix my code above so I can see exactly what I've got wrong? > > > Replying to myself, which is always good form, I patched domimpl.tcl in the > 2.2 code like this: > > --- > >>diff -u domimpl.tcl.orig domimpl.tcl > > --- domimpl.tcl.orig Fri Sep 6 10:10:48 2002 > +++ domimpl.tcl Fri Sep 6 11:06:52 2002 > @@ -215,11 +215,11 @@ > createDocumentType { > # Introduced in DOM Level 2 > > - if {[llength $args] != 3} { > - return -code error "wrong number of arguments, should be: > DOMImplementation createDocumentType name publicid systemid" > + if {[llength $args] != 4} { > + return -code error "wrong number of arguments, should be: > DOMImplementation createDocumentType token name publicid systemid" > } > > - return [CreateDocType [lindex $args 0] [list [lindex $args 1] > [lindex $args 2]]] > + return [CreateDocType [lindex $args 0] [lindex $args 1] [lindex > $args 2] [lindex $args 3]] > } > > createNode { > --- > > and changed my script to contain: > > ::dom::DOMImplementation createDocumentType $doc "test" [list "" "test.dtd"] > {} > > This gives: > > <?xml version='1.0'?> > <!DOCTYPE test SYSTEM "test.dtd"> > <test/> > > which is what I expect. > > Am I getting anywhere with this, or am I just making myself look like an > idiot in public? :-} > -- 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 |