|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57774 SDO_DAS_XML - xsi:type not always set for complexTypes
Submitted: 2007-08-06 14:10 UTC Modified: 2007-08-24 20:37 UTC
From: mattsch at gmail dot com Assigned: tuscany 1564 (profile)
Status: Closed Package: SCA_SDO (PECL)
PHP Version: 5.2.3 OS: Gentoo Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
42 - 3 = ?
Subscribe to this entry?

 [2007-08-06 14:10 UTC] mattsch at gmail dot com
xsi:type is not always set for complexTypes.  Notice the absence of xsi:type="collectionInfo" in the actual output.

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:sequence minOccurs="0" maxOccurs="unbounded">
        <xsd:element name="collection"/>
      <xsd:attribute name="kind" type="xsd:string" fixed="collectionInfo"/>

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


try {
	$xmldas = SDO_DAS_XML::create("request.xsd");
	try {
		$doc = $xmldas->createDocument('', 'request-list');
		$rdo = $doc->getRootDataObject();
		$request = $xmldas->createDataObject('', 'collectionInfo');
		$request->kind = 'collectionInfo';
	} catch (SDO_Exception $e) {
} catch (SDO_Exception $e) {
	print("Problem creating an XML document: " . $e->getMessage());

Expected result:
<?xml version="1.0" encoding="UTF-8"?>
<request-list xmlns:xsi=""><request kind="collectionInfo" xsi:type="collectionInfo"><collection>Blah</collection></request></request-list>

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-06 14:11 UTC] mattsch at gmail dot com
Changing php version.
 [2007-08-20 06:18 UTC]
Matthew, thanks for this. You are right of course. I just tried running the xml that we generate (the actual) through XERCES and it does not validate, whereas with the xsi:types (expected) it does. I have emailed Pete Robbins with the details to see if he wants it turned into a Tuscany JIRA.
 [2007-08-22 12:16 UTC] mattsch at gmail dot com
Since the Tuscany issue has been resolved, when can I expect the new Tuscany code to make it into the php extension?
 [2007-08-24 12:27 UTC]
Matt, you will see that I created release 1.2.3 today and this fix will be in there.
 [2007-08-24 18:08 UTC]
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at

 [2007-08-24 20:37 UTC] mattsch at gmail dot com
Thanks for the quick fix and reply.  Great job!  :-)
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed May 25 17:04:04 2022 UTC