View Full Version : parse XML and DTD

09-13-2008, 02:25 AM
It is said an XML file need a processor to check its validation against a x.DTD document to decide if it is valid or not.

But more often I see an XML file comes without a corresponding x.DTD file, and still the XML file is validated. In this case (without a DTD file included in an XML file), is there some kind of default DTD file to set basic rules for the XML? Otherwise, how does it work?

This situation also happens when the server-returned xml string without a DTD included. But the ajax's responseXML can still use it. Why so?



09-14-2008, 01:10 PM
You can't validate against nothing. As I understand, if an XML has no DTD (where it is validated against), it is only checked for well-formedness. But, I could be wrong...

As to the responseXML part, again if the XML is well-formed, it should still work even if it has no DTD.