From: bruceleister at gmail dot com
Operating system: Windows Server 2012R2 Standard
PHP version: 5.6.25
Package: XML Reader
Bug Type: Bug
Bug description:XML reader with setSchema now fails under 5.6.25
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 bug report at https://bugs.php.net/bug.php?id=73053&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73053&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73053&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73053&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=73053&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=73053&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=73053&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=73053&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=73053&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=73053&r=support
Expected behavior: https://bugs.php.net/fix.php?id=73053&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=73053&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=73053&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=73053&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73053&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=73053&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=73053&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=73053&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=73053&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=73053&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=73053&r=mysqlcfg