Using a DTD when XML is generating from a MySQL DB with PHP



Having difficulty getting a DTD to work, when generating XML from a database. Below is the code, which doesn't appear to be working.



// Connects to database
include 'backend/db_connect.php';

//creates xml document with doc type
$xml = new DOMdocument("1.0", "UTF-8") ;

$xml -> appendXML("<!DOCTYPE table_listings SYSTEM 'guide.dtd'>");

$xml -> formatOutput = TRUE;


From my knowledge the appendXML should work but doesnt?


No comments:

Post a Comment