The DOM spec currently does not define any API for getting to this
information. This is to be dealt with incrementally in the next two spec
levels, AFAIK. So, for now, you cannot get this information from the DOM.
We'll add that functionality as it becomes defined, first as experimental
level stuff and finally the real thing as these new spec levels become
recommendations.
----------------------------------------
Dean Roddey
Software Weenie
IBM Center for Java Technology - Silicon Valley
[EMAIL PROTECTED]
"KRAUSE,MIKE (HP-FtCollins,ex1)" <[EMAIL PROTECTED]> on 03/08/2000
02:59:22 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: Getting DOCTYPE from xml file
Hi,
I'm using the DOMPrint example as the basis for a SaveFile function I'm
writing. One problem I'm encountering is that the DOMPrint example does
not
print the <!DOCTYPE ...> declaration in my XML file.
If I have the following sample XML file...
<?xml version="1.0" standalone="no"?>
<!DOCTYPE foo SYSTEM "foo.dtd">
<foo>
...
</foo>
And the following code... (assume that doc is a valid DOM_Document node
returned from the parser and that it refers to the aforementioned file)
void somefunc(DOM_Document &doc) {
DOM_DocumentType docType = doc.getDoctype();
DOMString dtdName = docType.getName();
}
Why is it that if I call the DOM_Document's getDoctype() method I get a
null
DOM_DocumentType node? Should I be doing something else in order to print
out the "<!DOCTYPE foo SYSTEM "foo.dtd">" line?
One last thing... how do I output the first line of my XML document
verbatim?
Regards,
Mike Krause
Hewlett-Packard Company