Ben kullanarak PHP bir xml dosyası ihraç:İhracat xml'de DOCTYPE nasıl eklenir?
$xmldoc = new DOMDocument();
$xmldoc->formatOutput = true;
$xmldoc->encoding="Shift_JIS";
// create root nodes
$root = $xmldoc->createElement("TableData");
$xmldoc->appendChild($root);
$xmldoc->save($filename);
Sonuç:
<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE TableDef SYSTEM "TableData.dtd">
<TableData> </TableData>
Nasıl bir in DOCTYPE
eklemek için:
<?xml version="1.0" encoding="Shift_JIS"?>
<TableData> </TableData>
Şimdi, böyle satır <!DOCTYPE TableDef SYSTEM "TableData.dtd">
eklemek istediğiniz xml dışa aktarıldı mı? Teşekkürler. DOMImplementation::createDocument(), ile DOMDocument oluştururken
ara [DOMImplementation :: createDocumentType] (http://www.php.net/manual/en/domimplementation.createdocumenttype.php) – air4x
http://pointbeing.net/weblog/2009/03/adding- a-doctype-beyan-to-a-DOMDocument-in-php.html – Adam