Location: PHPKode > projects > The Online Web Library Site > towels/src/blocks/xml.block.php
<?php
include_once('etc/vars.php');

// ******************************************************************
// XML BLOCKS
// Blocks Available:
//  - blockDisplayStaticRedirect
//    (Redirects browser to passed-in file.)
//  - blockTransformXML
//    (Calls the function to transform XML files and prints output.)
// ******************************************************************

// **** blockDisplayStaticRedirect Function ****
// Input: sourcePath to Static content
// Output: Redirection
// Description: For book formats with static content (non-XSLT), simply redirect
//              the display.php file to the proper path on the web server.
function blockDisplayStaticRedirect($sourcePath)
{
  global $siteRoot;

  header('location: ' . $siteRoot . $sourcePath);
}


// **** blockTransformXML Function ****
// Input: sourcePath, xsltFile, headerFile, footerFile
// Output: Transformed XML to screen
// Description: Transforms XML doc using passed in xslt file.
//              Also appends customized headers and footers.
function blockTransformXML($doc_id, $sourcePath, $xsltFile, $headerFile, $footerFile)
{
  global $siteName, $dirModifier, $queryCount;
   
  if (!is_null($headerFile)) // Add header only if required.
  {
    include($headerFile);                                 // Print Header
  }

  print transformXMLDocument($sourcePath, $xsltFile);     // Print Body

  if (!is_null($footerFile)) // Add footer only if required.
  {
    include($footerFile);                                 // Print Footer
  }
}

?>
Return current item: The Online Web Library Site