Ho esportato un file XML in PHP utilizzando:Come aggiungere DOCTYPE in export xml?
$xmldoc = new DOMDocument();
$xmldoc->formatOutput = true;
$xmldoc->encoding="Shift_JIS";
// create root nodes
$root = $xmldoc->createElement("TableData");
$xmldoc->appendChild($root);
$xmldoc->save($filename);
Risultato:
<?xml version="1.0" encoding="Shift_JIS"?>
<TableData> </TableData>
Ora, voglio aggiungere fila <!DOCTYPE TableDef SYSTEM "TableData.dtd">
come:
<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE TableDef SYSTEM "TableData.dtd">
<TableData> </TableData>
Come aggiungere DOCTYPE
in un xml esportato? Grazie.
Controllare [DOMImplementation :: createDocumentType] (http://www.php.net/manual/en/domimplementation.createdocumenttype.php) – air4x
http://pointbeing.net/weblog/2009/03/adding- a-doctype-dichiarazione-a-un-DOMDocument-in-php.html – Adam