source: branches/old/projectonlineplayes/source/PHP - parser (check validation)/parser.php

Last change on this file was 194, checked in by maron, 17 years ago

Projekt Online hráči

File size: 742 bytes
Line 
1<?php
2$indent = 5; /* Number of spaces to indent per level */
3
4$xml = new XMLReader();
5$xml->open("onlineplayers.xml");
6// CHANGED NEXT TWO LINES TO REMOVE ERROR
7// FROM: $xml->setParserProperty(XMLREADER_LOADDTD, TRUE);
8$xml->setParserProperty(XMLReader::LOADDTD, TRUE);
9$xml->setParserProperty(XMLReader::VALIDATE, TRUE);
10while($xml->read()) {
11 /* Print node name indenting it based on depth and $indent var */
12 print str_repeat(" ", $xml->depth * $indent).$xml->name."\n";
13 if ($xml->hasAttributes) {
14 $attCount = $xml->attributeCount;
15 print str_repeat(" ", $xml->depth * $indent)." Number of Attributes: ".$xml->attributeCount."\n";
16 }
17}
18print "\n\nValid:\n";
19var_dump($xml->isValid());
20?>
Note: See TracBrowser for help on using the repository browser.