Re: Validating XML Issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'd say your XML document is not "well formed", but validity depends on whether it conforms to the rules expressed in a schema.

Mattias

Alice Wei wrote:
Hi, This seems like a small problem that I have read from http://us.php.net/manual/en/xmlreader.isvalid.php. I have the code snippet here as follows:

<?php
$xml = XMLReader::open('hello.xml');

// You must to use it
$xml->setParserProperty(XMLReader::VALIDATE, true);

if ($xml->isValid()) echo "true";
else echo "NOT";

?>

Here is the contents of hello.xml:

 <greeting><hello>Hello</hello>

Obviously, this is not a well formed XML file. However, whenever I run the PHP code, it returns true, how do I get it to validate it the way it is supposed to be? Thanks for your help.
Alice




_________________________________________________________________
Search from any Web page with powerful protection. Get the FREE Windows Live Toolbar Today!
http://get.live.com/toolbar/overview



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux