views:

59

answers:

2

For a document which has a DOCTPYE declaration like

<!DOCTYPE RootElement SYSTEM "file.dtd">

Delphi 2009, using MSXML, reports that the systemId is empty (""):

Assert(Doc.DOMDocument.doctype.systemId <> ''); // fails!

while

Assert(Doc.DOMDocument.doctype.name = 'RootElement'); // ok

correctly verifies that the DOCTYPE name id "RootElement".

Is this a bug in Delphi (or my code) or am I using a version of MSXML which does not support this property?

A: 

In case ProhibitDTD property is True try setting it to False.

Here's an article with more details.

TOndrej
+1  A: 

MSXML's DocumentType implementation is completely missing the DocumentType properties publicId, systemId and internalSubset. MSDN api ref; the missing properties are specifically called out in MS-DOM2CX.

If you need this information you might have to try a different DOM implementation. Here's one. If you can use .NET classes, System.Xml supports it too.

bobince