<?php require_once('xml_doctype.inc'); $dom = new DOMDocument('1.0','UTF-8'); $dom->preserveWhiteSpace = false; $dom->formatOutput = true;
$myPage = new docType($dom); $xmlHtml = $myPage->document();
$xmlHead = $dom->createElement('head'); $xmlTitle = $dom->createElement('title','I Am a Web Page'); $xmlHead->appendChild($xmlTitle); $xmlHtml->appendChild($xmlHead);
$xmlfile = 'content.xml'; $buffer = file_get_contents($xmlfile); $tmpDOM = new DOMDocument('1.0','utf-8'); $tmpDOM->loadXML($buffer); $nodeList = $tmpDOM->getElementsByTagName('body'); $impBody = $nodeList->item(0); $xmlBody = $dom->importNode($impBody,true); $xmlHtml->appendChild($xmlBody);
$myPage->sendheader(); $myPage->sendpage(); ?>
|