function htmlWrite($xml, $xsl_params = null)
{
    global $debug, $xmlSave;
    $sucess = false;
    $xsl = SITE_PATH . "xsl/adm/xml-html.xsl";
    $html = str_replace("xml", "html", $xmlSave);
    //print "xsl=" . $xsl . " html=" . $html . "<br>";
    $text = processTransformation($xml, $xsl, $xsl_params);
    $text = xmlRemoveHeader($text);
    $text = macroReplace($text);
    if (trim($text) == "") {
        print "warning:transformation error generated empty content";
    } else {
        $htmlFile = DATABASE_PATH . $html;
        if (!putDoc($htmlFile, $text)) {
            print "putDoc error: " . $htmlFile . "<br/>\n";
        } else {
            $sucess = true;
        }
    }
    return $sucess;
}
function htmlWrite($xml)
{
    global $debug, $xmlSave;
    $sucess = false;
    $xsl = normalizePath("xsl/adm/xml-html.xsl", "SITE_PATH");
    $html = str_replace("xml", "html", $xmlSave);
    //print "xsl=" . $xsl . " html=" . $html . "<br>";
    $text = processTransformation($xml, $xsl);
    $text = macroReplace($text);
    if (trim($text) == "") {
        print "warning:transformation error generated empty content";
    } else {
        //$htmlFile = normalizeDocURL($html);
        $htmlFile = normalizePath($html);
        if (!putDoc($htmlFile, $text)) {
            print "putDoc error: " . $htmlFile . "<br/>\n";
        } else {
            $sucess = true;
        }
    }
    return $sucess;
}