|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57765 getSequence() returns null with a complexType defined without mixed="true"
Submitted: 2007-08-01 13:15 UTC Modified: 2017-01-10 08:07 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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: mattsch at gmail dot com
New email:
PHP Version: OS:


 [2007-08-01 13:15 UTC] mattsch at gmail dot com
getSequence() returns null with a complexType defined without mixed="true".

Reproduce code:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs=""
  <xs:element name="letters" type="FormLetter"/>
  <xs:complexType name="FormLetter">
      <xs:element name="date" minOccurs="1" type="xs:string"/>
      <xs:element name="firstName" minOccurs="1" type="xs:string"/>
      <xs:element name="lastName" minOccurs="1" type="xs:string"/>

 * Create an XML document from scratch
try {
   $xmldas = SDO_DAS_XML::create("letter.xsd");
   try {
       $doc = $xmldas->createDocument();
       $rdo = $doc->getRootDataObject();
       $seq = $rdo->getSequence();
       $seq->insert("April 09, 2005", NULL, 'date');
       $seq->insert("Tarun", NULL, "firstName");
       $seq->insert("Nayaraaa", NULL, "lastName");
       $rdo->lastName = "Nayar";
   } 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"?>
<letters xmlns="http://letterSchema" xmlns:tns="http://letterSchema" xmlns:xsi=""><date>April 09, 2005</date><firstName>Tarun</firstName><lastName>Nayar</lastName></letters>

Actual result:
Fatal error: Call to a member function insert() on a non-object in letter.php on line 11


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-01 13:25 UTC] mattsch at gmail dot com
There wasn't a choice for 5.2.3.  Changing version.
 [2007-08-01 17:09 UTC] lowt at bigfoot dot com
Looking at the code, SDOSchemaSAX2Parser::startComplexType, and SDOSchemaSAX2Parser::defineType appears to be the two places that isSequenced is set.  In startComplexType, it appears that both mixed and sequence are both treated as an attribute.  We cannot tell if it ever reads the child <sequence>,

It appears that isSequenced should be set to true on the basis of the child <sequence> and not on the basis of mixed.
 [2007-08-02 11:15 UTC] mattsch at gmail dot com
Since this seems to a be a Tuscany problem, here's a link:
 [2007-08-02 12:10 UTC]
Matt, I'm impressed! You've raised the defect, investigated and pinpointed the problem, and passed the problem on to Tuscany, all in double-quick time. There's nothing left to do :-)
 [2017-01-10 08:07 UTC]
-Status: Assigned +Status: Suspended -Assigned To: tuscany 1504 +Assigned To:
 [2017-01-10 08:07 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: Mon Jul 15 06:01:29 2024 UTC