| 1 |
sysadm |
1.1 |
<?
|
| 2 |
|
|
$xmlfiles = array(
|
| 3 |
|
|
"./doc/management.xml",
|
| 4 |
|
|
"./doc/bbs_auth_user.xml",
|
| 5 |
|
|
"./doc/bbs_master.xml",
|
| 6 |
|
|
"./doc/board_manage.xml"
|
| 7 |
|
|
);
|
| 8 |
|
|
|
| 9 |
|
|
$xslfile = "./doc/bbs_xml_doc.xsl";
|
| 10 |
|
|
|
| 11 |
|
|
$xsl = new DOMDocument;
|
| 12 |
|
|
$xsl->load($xslfile);
|
| 13 |
|
|
|
| 14 |
|
|
// Configure the transformer
|
| 15 |
|
|
$proc = new XSLTProcessor;
|
| 16 |
|
|
$proc->importStyleSheet($xsl); // attach the xsl rules
|
| 17 |
|
|
|
| 18 |
|
|
foreach ($xmlfiles as $xmlfile)
|
| 19 |
|
|
{
|
| 20 |
|
|
$htmlfile = str_replace(".xml", ".html", $xmlfile);
|
| 21 |
|
|
|
| 22 |
|
|
// Load the XML source
|
| 23 |
|
|
$xml = new DOMDocument;
|
| 24 |
|
|
$xml->load($xmlfile);
|
| 25 |
|
|
|
| 26 |
|
|
$domdoc = $proc->transformToDoc($xml);
|
| 27 |
|
|
$domdoc->saveHTMLFile($htmlfile);
|
| 28 |
|
|
}
|
| 29 |
|
|
?>
|