Hosting Test Site Domain:
DOM6 - Validating XML with DTD

XML files can include a 'doctype' attribute within which a DTD file can be specified. The purpose of a DTD (Document Type Definition) is to define the legal building blocks of an XML document. It defines the document structure with a list of legal elements.

If the error parameter of the domxml_open_file function is used when reading a xml file with a doctype attribute which specifies a specific DTD file, then the xml file will be validated against the DTD file.

This test checks for errors in 'validate.xml', including those as a result of declaring 'xhtml1-transitional.dtd'. The test is successful if 6 errors are displayed when the file is validated while it is parsed and 2 errors when it is validated after being parsed.