Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 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
?>