ID:               31076
 User updated by:  c dot d at earthlink dot net
 Reported By:      c dot d at earthlink dot net
-Status:           Feedback
+Status:           Open
 Bug Type:         DOM XML related
 Operating System: Mac OS X 10.3.6
 PHP Version:      5.0.2
 New Comment:

Further Information:

My libxml version: 2.6.7
My DOM/XML API version :20031129


Previous Comments:
------------------------------------------------------------------------

[2004-12-14 10:24:05] [EMAIL PROTECTED]

Works for me, except that it doesn't validate...

Which libxml2 version are you using?

The XML Schema parser in libxml2 isn't complete yet, but it is
recommended to use one of the latest libxml2 releases, as the XML
Schema implementation got some big improvements lately 

------------------------------------------------------------------------

[2004-12-14 01:46:41] c dot d at earthlink dot net

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.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=31076&edit=1

Reply via email to