Edit report at https://bugs.php.net/bug.php?id=73053&edit=1
ID: 73053
Updated by: cmb@php.net
Reported by: bruceleister at gmail dot com
Summary: XML reader with setSchema now fails under 5.6.25
-Status: Feedback
+Status: Open
Type: Bug
Package: XML Reader
Operating System: Windows Server 2012R2 Standard
PHP Version: 5.6.25
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thanks! I'll have a look at it ASAP.
Previous Comments:
------------------------------------------------------------------------
[2016-09-10 00:39:04] bruceleister at gmail dot com
Thanks for looking at this,
I saw the point increase of libXMl2, but I'm running on Windows pre-build binaries, so can not
change the build.
I have sent sample files via email from my work's email
------------------------------------------------------------------------
[2016-09-09 18:20:57] cmb@php.net
There haven't been any relevant changes to XMLReader for years (at
least in the PHP-5.6 branch)[1]. The behavioral change might
simply be caused by an updated libxml.
Anyhow, it would be helpful if you could make sample XML and XSD
files available.
[1] <https://github.com/php/php-src/commits/PHP-5.6/ext/xmlreader>
------------------------------------------------------------------------
[2016-09-09 04:49:54] bruceleister at gmail dot com
Description:
------------
The bit of code below has always been used to verify incoming XML against a Schema XSD file.
It worked fine under 5.6.22, and last 3 years, but after upgrade to 5.6.25 would get the schema
mis-matches shown below, note all the values it was testing are shown as blank, in the message, but
are there in the XML file.
I can send sample XML and XSD files if required
Test script:
---------------
$xml = new XMLReader();
if(!$xml->open($dir.$file,null,LIBXML_PARSEHUGE)){
logging('Unable to Open XML file (Full Parse 1):'.$dir.$file);
return false;
}
$xml->setSchema($xsd_dir.$xsd);
while($xml->read()){
}
Actual result:
--------------
XSD: Element 'request', attribute 'schema_version': '' is not a valid
value of the atomic type 'xs:decimal'.
Element 'request', attribute 'schema_id': The value '(null)' does not
match the fixed value constraint 'WBC-CSR-Request.xsd'.
Element 'request', attribute 'requestor': The value '(null)' does not
match the fixed value constraint 'WBC-RFS'.
Element 'service', attribute 'requestType': [facet 'enumeration'] The
value '' is not an element of the set {'Catalogue', 'Bespoke',
'Defined', 'Other'}.
Element 'service', attribute 'requestType': '' is not a valid value of
the atomic type 'sr_type'.
Element 'service', attribute 'requestId': [facet 'length'] The value
'' has a length of '0'; this differs from the allowed length of '15'.
Element 'service', attribute 'requestId': '' is not a valid value of
the atomic type 'sr_id_type'.
Element 'project', attribute 'type': [facet 'enumeration'] The value
'' is not an element of the set {'bau', 'project'}.
Element 'project', attribute 'type': '' is not a valid value of the
atomic type 'sr_project_type'.
Element 'contact', attribute 'type': [facet 'enumeration'] The value
'' is not an element of the set {'primary', 'alternate',
'original requestor', 'primary - PIV', 'alternate - PIV'}.
Element 'contact', attribute 'type': '' is not a valid value of the
atomic type 'contact_type_type'.
Element 'contact', attribute 'id': [facet 'minLength'] The value
'' has a length of '0'; this underruns the allowed minimum length of
'1'.
Element 'contact', attribute 'id': '' is not a valid value of the
local atomic type.
Element 'contact', attribute 'type': [facet 'enumeration'] The value
'' is not an element of the set {'primary', 'alternate',
'original requestor', 'primary - PIV', 'alternate - PIV'}.
Element 'contact', attribute 'type': '' is not a valid value of the
atomic type 'contact_type_type'.
Element 'contact', attribute 'id': [facet 'minLength'] The value
'' has a length of '0'; this underruns the allowed minimum length of
'1'.
Element 'contact', attribute 'id': '' is not a valid value of the
local atomic type.
Element 'contact', attribute 'type': [facet 'enumeration'] The value
'' is not an element of the set {'primary', 'alternate',
'original requestor', 'primary - PIV', 'alternate - PIV'}.
Element 'contact', attribute 'type': '' is not a valid value of the
atomic type 'contact_type_type'.
Element 'contact', attribute 'id': [facet 'minLength'] The value
'' has a length of '0'; this underruns the allowed minimum length of
'1'.
Element 'contact', attribute 'id': '' is not a valid value of the
local atomic type.
Element 'SLAs', attribute 'count': '' is not a valid value of the
atomic type 'xs:positiveInteger'.
Element 'workinfos', attribute 'count': '' is not a valid value of the
atomic type 'xs:positiveInteger'.
Element 'workinfo', attribute 'date': '' is not a valid value of the
atomic type 'xs:dateTime'.
Element 'workinfo', attribute 'type': [facet 'enumeration'] The value
'' is not an element of the set {'External Dependancy', 'Notes for the
Vendor', 'SLA Notes for the Vendor'}.
Element 'workinfo', attribute 'type': '' is not a valid value of the
atomic type 'csr_workinfo_request_type'.
Element 'attachments', attribute 'count': '' is not a valid value of
the atomic type 'xs:positiveInteger'.
Element 'attachment', attribute 'date': '' is not a valid value of the
atomic type 'xs:dateTime'.
Element 'attachment', attribute 'type': [facet 'enumeration'] The
value '' is not an element of the set {'Service Plan', 'Test Plan',
'Test Results', 'Customer Survey'}.
Element 'attachment', attribute 'type': '' is not a valid value of the
atomic type 'csr_attachment_request_type'.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73053&edit=1