[XML-SIG] DOCTYPEs question with 4DOM
Derek Fountain
derekfountain at yahoo.co.uk
Tue Jul 6 10:09:15 CEST 2004
According to my book (Inside XML, New Riders) a document type declaration can
have one of several forms:
<!DOCTYPE rootname [DTD]>
<!DOCTYPE rootname SYSTEM url>
<!DOCTYPE rootname SYSTEM url [DTD]>
<!DOCTYPE rootname PUBLIC identifier>
<!DOCTYPE rootname PUBLIC identifier [DTD]>
According to the DOM Level 3 specification, the createDocumentType method of
the DOMImplementation interface takes 3 parameters: qualified name, publicId
and systemId. I would have thought that rootname is the qualified name,
publicId is the identifier (in the last two cases) and systemId is the url
(in the 2nd and 3rd cases). I could be wrong, but that made sense. :o}
I want to create a doctype like this:
<!DOCTYPE test>
so I'd have thought that, using the 4DOM implementation from Python, I could
say:
docType = implementation.createDocumentType( "test", None, None )
but when serialised, that doesn't produce a DOCTYPE line at all. This produces
what I want:
docType = implementation.createDocumentType( "", "test", "" )
and this:
docType = implementation.createDocumentType( "1", "test", "2" )
produces:
<!DOCTYPE storage PUBLIC "test" "2">
with the "1" nowhere to be seen.
I have no idea what is going on. Can someone explain? Thanks! :o)
More information about the XML-SIG
mailing list