|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57809 use="required" on attributes not enforced
Submitted: 2007-08-29 10:41 UTC Modified: 2017-01-10 08:09 UTC
From: mattsch at gmail dot com Assigned:
Status: Suspended Package: SCA_SDO (PECL)
PHP Version: 5.2.3 OS: Gentoo Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-08-29 10:41 UTC] mattsch at gmail dot com
SDO doesn't enforce use="required" for attributes.  It allows for the absence of the attribute which violates the schema.

Reproduce code:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="">

<xsd:element name="request" type="requestType"/>

<xsd:complexType name="requestType" abstract="true"/>

<xsd:complexType name="collectionInfo">
    <xsd:extension base="requestType">
      <xsd:element name="collection" type="xsd:token"/>
      <xsd:attribute name="kind" type="xsd:string" fixed="collectionInfo" use="required"/>

<xsd:element name="request-list">
        <xsd:element ref="request" minOccurs="0" maxOccurs="unbounded"/>


Expected result:
Throw an exception when inserting an object that does not have the required property set.

Actual result:
<?xml version="1.0" encoding="UTF-8"?>
<request-list xmlns:xsi=""><request xsi:type="collectionInfo"><collection>foo bar</collection></request></request-list>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-29 10:41 UTC] mattsch at gmail dot com
Changed php version.
 [2017-01-10 08:09 UTC]
-Status: Open +Status: Suspended
 [2017-01-10 08:09 UTC]
Suspending this report as the extension have not had a release for almost 9 years.  Please revive this if the extension once again shows life
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Jul 19 23:01:29 2024 UTC