Login   Register  
PHP Classes
elePHPant
Icontem

File: phpdomtest.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Reiner Entzminger  >  PDOM  >  phpdomtest.php  >  Download  
File: phpdomtest.php
Role: ???
Content type: text/plain
Description: XML-Test
Class: PDOM
Author: By
Last change:
Date: 2002-03-09 14:01
Size: 1,762 bytes
 

Contents

Class file image Download
<?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>