|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-12-14 10:24 UTC] chregu@php.net
[2004-12-14 10:34 UTC] c dot d at earthlink dot net
[2004-12-14 10:35 UTC] chregu@php.net
[2004-12-21 07:41 UTC] sniper@php.net
[2005-09-28 16:11 UTC] jean-pierre dot huart at brussels dot msf dot org
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 21:00:02 2025 UTC |
Description: ------------ When an XML file has an empty element defined as xs:token in XSD, and it is loaded into a DOMDocument and then schemaValidate is called, the server CPU begins to race and content is never returned to browser. The W3C definition of xs:token does not prohibit empty xs:token elements. Reproduce code: --------------- $aDOM = new DOMDocument("1.0"); $aDOM->load("file.xml"); $aDOM->schemaValidate("file.xsd"); XML File: <?xml version="1.0"?> <people> <person> <fname>John</fname> <mname/> <lname>Doe</lname> </person> </people> XSD File: <?xml version="1.0" encoding="ISO-8859-1"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="people"> <xs:complexType> <xs:sequence> <xs:element name="person" type="persontype" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:complexType name="persontype"> <xs:sequence> <xs:element name="fname" type="xs:token"/> <xs:element name="mfname" type="xs:token"/> <xs:element name="lfname" type="xs:token"/> </xs:sequence> </xs:complexType> </xs:schema> Expected result: ---------------- schemaValidate should return true. Actual result: -------------- CPU races, server does not return content to browser.