XML_Beautifier
[ class tree: XML_Beautifier ] [ index: XML_Beautifier ] [ all elements ]

Source for file example3.php

Documentation is available at example3.php

  1. <?PHP
  2. /**
  3. * XML_Beautifier example 3
  4. *
  5. * This example displays the 'caseFolding'
  6. * option. It can be used to convert all tags
  7. * and attribute names to upper case or lower
  8. * case. Use the 'caseFoldingTo' options to
  9. * to specify the case.
  10. *
  11. @author    Stephan Schmidt <schst@php.net>
  12. */
  13.     error_reportingE_ALL );
  14.  
  15.     require_once 'XML/Beautifier.php';
  16.     
  17.     $options = array(
  18.                         "caseFolding" => true,
  19.                         "caseFoldingTo" => "uppercase"
  20.                     );
  21.     
  22.     $fmt = new XML_Beautifier($options);
  23.     $result $fmt->formatFile('test.xml''test2.xml');
  24.  
  25.     echo "<h3>Original file</h3>";
  26.     echo "<pre>";
  27.     echo htmlspecialchars(implode("",file('test.xml')));
  28.     echo "</pre>";
  29.         
  30.     echo    "<br><br>";
  31.     
  32.     echo "<h3>Beautified file</h3>";
  33.     echo "<pre>";
  34.     echo htmlspecialchars(implode("",file('test2.xml')));
  35.     echo "</pre>";
  36. ?>

Documentation generated on Mon, 11 Mar 2019 15:41:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.