#45892 [NEW]: $dom_xml->relaxNGValidate()
[email protected] ("mangal dot varshney at gmail dot com")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
From: mangal dot varshney at gmail dot com
Operating system: Windows/Linux
PHP version: 5.2.6
PHP Bug Type: *XML functions
Bug description: $dom_xml->relaxNGValidate()
Description:
------------
I am trying to validate a DocBook having namest and nameend attribute in
entry element with RelexNg (http://docbook.org/xml/5.0/rng/docbook.rng). I
am using following php code for validation. It is displaying errors in xml
file but xml file (DocBook) is valid. I have checked this XMl file on some
tool whixh says it valid like oXygen.
$dom_xml = new DomDocument;
$dom_xml->load("textExample.xml");
if ($dom_xml->relaxNGValidate("docbook.rng") )
{
echo "Good\n";
}
else
{
echo $php_errormsg . "\n";
}
I am attaching sample DocBook in the mail.
Reproduce code:
---------------
XML File (DocBook) file:
<?xml version="1.0" encoding="UTF-8"?>
<book xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<info>
<title>Book Template Title</title>
<author>
<orgname>Organization Name</orgname>
<address>
<city>City</city>
<street>Street</street>
<postcode>000000</postcode>
<country>Country</country>
</address>
<email>[email protected]</email>
</author>
</info>
<part>
<title>First Part</title>
<subtitle>Subtitle of First Part</subtitle>
<chapter>
<title>Chapter Title</title>
<subtitle>Subtitle of Chapter</subtitle>
<table frame="none">
<title>Table1</title>
<tgroup cols="2">
<colspec colname="c1" colnum="1"/>
<colspec colname="c2" colnum="2"/>
<thead>
<row>
<entry namest="c1" nameend="c2">Header
1</entry>
</row>
</thead>
<tbody>
<row>
<entry/>
<entry/>
</row>
<row>
<entry/>
<entry/>
</row>
<row>
<entry/>
<entry/>
</row>
</tbody>
</tgroup>
</table>
<sect1>
<title>Section1 Title</title>
<subtitle>Subtitle of Section 1</subtitle>
<para>Text</para>
</sect1>
</chapter>
</part>
</book>
Expected result:
----------------
It should be Good.
Actual result:
--------------
Displaying Errors.
--
Edit bug report at http://bugs.php.net/?id=45892&edit=1
--
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45892&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45892&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45892&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45892&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=45892&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45892&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45892&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45892&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45892&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45892&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=45892&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=45892&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45892&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45892&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45892&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45892&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45892&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45892&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45892&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45892&r=mysqlcfg