Location: PHPKode > scripts > PDOM > pdom/phpdomtest.php
<?php
define( "OUTPUT_LOGFILE", "w:/internet/wwwroot/logfiles/output.log" );

class output {
	function println( $String ) {
		printf( "%s <br>\n", $String );
	}  // function out( $String )

	function writer( $String ) {
		$fHdl		= fopen( OUTPUT_LOGFILE, 'a' );

		fputs( $fHdl, $this->now() . $String . "\n" );
		fclose( $fHdl );
	}  // function writer( $String )

	function now() {
		return date( 'd.m.Y H:i:s :: ' );
	}  // function now()
}  // class output

	function instanceof( $objekt, $instance ) {
		return ( get_class( $objekt ) == $instance );
	}  // function instanceof{ $Object, $instance }
	
	function getout( $element ) {
		$GLOBALS['out']->println( $element->toString() );
		$GLOBALS['out']->println( "<hr>" );
		
		while( $element->hasElement() ) {
			getout( $element->getNext() );
		}  // while( $element->hasElements() )
	}  // function getout( $element )

require_once( "Document.php" );
?>
<html>
<head>
<title>XML-Dokumente</title>
</head>
<body bgcolor="white">
<?
	$out		= new output();
	$xml		= new Document( 'adresse.xml' );
	
	$out->println( "Dokument-Informationen" );
	$out->println( "&nbsp;&nbsp;&nbsp;Dateiname: " . $xml->getFilename() );
	$out->println( "&nbsp;&nbsp;&nbsp;Zeichencodierung: " . $xml->getCoding() );
	$out->println( "&nbsp;&nbsp;&nbsp;Entities:" );
	$entity		= $xml->getEntity();
	$keys       = array_keys( $entity );
	
	for( $i=0; $i<count( $keys ); $i++ ) {
		$out->println( "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" . $keys[$i] . "=" . $entity[$keys[$i]] );
	}  // for( $i=0; $i<count( $keys ); $i++ )
	
	$comment	= $xml->getComment();
	
	$out->println( $comment->toString() );
	$out->println( "<hr>" );
	
	getout( $xml->getElement() );
?>
</body>
</html>
Return current item: PDOM