php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #43643 XMLReader::isValid returns false always
Submitted: 2007-12-20 15:34 UTC Modified: 2007-12-28 13:00 UTC
From: arkadiusz dot tulodziecki at firma dot o2 dot pl Assigned: felipe (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
 [2007-12-20 15:34 UTC] arkadiusz dot tulodziecki at firma dot o2 dot pl
Description:
------------
XMLReader::isValid gives false for all valid XML I had. All files parses correctly but sometimes XMLReader::read generates PHP Worning.

Reproduce code:
---------------
<?php
$reader = new XMLReader();
$reader->open('test.xml');
var_dump($reader->isValid());
?>


<?xml version="1.0" encoding="utf-8" ?>
<ads version="1.0.6" xmlns="http://www.example.com/xmlns/1.0/">
        <ad offer_date="2007-08-21 21:21:00" offer_code="0" offer_type="0">
        AAA
        </ad>
</ads>


Expected result:
----------------
bool(true)

Actual result:
--------------
bool(false)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-20 16:04 UTC] felipe@php.net
Use:
$reader->setParserProperty(XMLReader::VALIDATE, true);
 [2007-12-20 16:50 UTC] arkadiusz dot tulodziecki at firma dot o2 dot pl
Thanks, 

There is only basic documentation for XMLReader. 

There was possible other bug but because in this moment I can't reproduce it I'll wait with reporting.
 [2007-12-20 17:13 UTC] felipe@php.net
I'll add a example soon.
 [2007-12-28 13:00 UTC] felipe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Dec 02 13:00:01 2025 UTC