<?php
# Waiting for php 5.3 anonymous functions...
if (!function_exists('a'))
{
    function a(array $attribute)
    {
        $all = array();
        
        foreach ($attribute as $k => $v)
        {
            $all[] = $k . '="' . htmlspecialchars($v) . '"';
        }
        
        return ' ' . implode(' ', $all);
    }
}
#
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html<?php if (isset($html)) : echo a($html); endif; ?>>
    <head<?php if (isset($head)) : echo a($head); endif; ?>>
        <?php if (isset($base)) : ?><base<?php echo a($base); ?> /><?php endif; ?>
        <?php if (isset($title)) : ?><title><?php echo htmlspecialchars($title); ?></title><?php endif; ?>
        <?php if (isset($meta)) : foreach ($meta as $m) : ?><meta<?php echo a($m); ?> /><?php endforeach; endif; ?>
        <?php if (isset($link)) : foreach ($link as $l) : ?><link<?php echo a($l); ?> /><?php endforeach; endif; ?>
        <?php if (isset($script)) : foreach ($script as $s) : ?><script<?php echo a($s); ?>></script><?php endforeach; endif; ?>
    </head>
    <body<?php if (isset($body)) : echo a($body); endif; ?>>
        <?php echo $content; ?>
    </body>
</html>