home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / example6.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  677 b   |  30 lines

  1. <?PHP
  2. /**
  3.  * XML_Beautifier example 6
  4.  *
  5.  * This example displays the multilineTags option.
  6.  * Furthermore it shows what happens, when no output file
  7.  * is specified.
  8.  *
  9.  * @author    Stephan Schmidt <schst@php.net>
  10.  */
  11.     error_reporting( E_ALL );
  12.  
  13.     require_once 'XML/Beautifier.php';
  14.  
  15.     $fmt = new XML_Beautifier( array( "multilineTags" => true ) );
  16.     $result = $fmt->formatFile('test.xml');
  17.  
  18.     echo "<h3>Original file</h3>";
  19.     echo "<pre>";
  20.     echo htmlspecialchars(implode("",file('test.xml')));
  21.     echo "</pre>";
  22.         
  23.     echo    "<br><br>";
  24.     
  25.     echo "<h3>Beautified file</h3>";
  26.     echo "<pre>";
  27.     echo htmlspecialchars($result);
  28.     echo "</pre>";
  29. ?>
  30.