+# output dynamic and/or static html
+
+include_once 'format.inc.php';
+
+ob_start();
+if ($Page->handler and !$Page->index($Page->api)) {
+ # replace contents by code output on false return
+ $Page->raw = ob_get_clean();
+}
+else {
+ # keep article contents
+ if (!isset($Page->body)) {
+ # no resulting output
+ http_response_code(404);
+ @require '404.inc.html';
+ $Page->raw = ob_get_clean() . $Page->raw;
+ }
+}
+
+if (@$_SERVER['HTTP_ACCEPT'] === 'application/xml') {
+ header('Access-Control-Allow-Origin: *');
+}
+elseif (!$Page->api) {
+ include_once 'page.inc.php';
+}
+print $Page->render();