php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57390 Error on printing open types
Submitted: 2006-11-23 05:45 UTC Modified: 2006-12-13 07:01 UTC
From: simonslaws at googlemail dot com Assigned: cem (profile)
Status: Closed Package: SCA_SDO (PECL)
PHP Version: 5_2 CVS-2006-11-23 OS: Win XP
Private report: No CVE-ID: None
 [2006-11-23 05:45 UTC] simonslaws at googlemail dot com
Description:
------------
In investigating a flaw in the CDATA change I notice that print_r isn;t working properly with open types

Reproduce code:
---------------
XSD 
===
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="http://www.example.org/test" 
        xmlns:tns="http://www.example.org/test">

    <complexType name="TestType" mixed="true">
        <sequence>
            <element name="jim" type="string"/>
            <any namespace="##any" processContents="lax"/>            
        </sequence>
    </complexType>
    
    <element name="test" type="tns:TestType"/>        
</schema>

XML
===
<?xml version="1.0" encoding="UTF-8"?>
<tns:test xmlns:tns="http://www.example.org/test" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xsi:schemaLocation="http://www.example.org/test cdata2.xsd ">
  <jim>xxx<![CDATA[some data and some <MoreXML></MoreXML>]]></jim>
  <entry>xxx<![CDATA[some data and some <MoreXML></MoreXML>]]></entry>
</tns:test>

PHP
===
$xmldas   = SDO_DAS_XML::create("cdata2.xsd");
$document = $xmldas->loadFile("cdata2.xml");
$root     = $document->getRootDataObject();
echo $xmldas->__toString() . "\n";
echo $xmldas->saveString($document);
print_r($root);

Expected result:
----------------
print_r($root) to provide similar information as is provided by saveString albeit in a different format.

Actual result:
--------------
object(SDO_DAS_XML)#1 {
19 types have been defined. The types and their properties are::
1. commonj.sdo:BigDecimal
2. commonj.sdo:BigInteger
3. commonj.sdo:Boolean
4. commonj.sdo:Byte
5. commonj.sdo:Bytes
6. commonj.sdo:ChangeSummary
7. commonj.sdo:Character
8. commonj.sdo:DataObject
9. commonj.sdo:Date
10. commonj.sdo:Double
11. commonj.sdo:Float
12. commonj.sdo:Integer
13. commonj.sdo:Long
14. commonj.sdo:OpenDataObject
15. commonj.sdo:Short
16. commonj.sdo:String
17. commonj.sdo:URI
18. http://www.example.org/test:RootType
    - test (http://www.example.org/test:TestType)
19. http://www.example.org/test:TestType
    - jim (commonj.sdo:String)
}
<?xml version="1.0" encoding="UTF-8"?>
<test xmlns="http://www.example.org/test" xmlns:tns2="commonj.sdo" xmlns:tns="ht
tp://www.example.org/test">
  <jim>xxx&lt;![CDATA[some data and some &lt;MoreXML&gt;&lt;/MoreXML&gt;]]&gt;</
jim>
  <tns2:entry xsi:type="OpenDataObject" xmlns:xsi="http://www.w3.org/2001/XMLSch
ema-instance">xxxXXXCDATA@STARTXXXsome data and some &lt;MoreXML&gt;&lt;/MoreXML
&gt;XXXCDATA@ENDX</tns2:entry></test>
SDO_DataObjectImpl Object
(
    [jim] => xxx<![CDATA[some data and some <MoreXML></MoreXML>]]>
    [entry] => SDO_DataObjectList Object
PHP Fatal error:  print_r(): internal error (286) - unexpected DataObject type 1
8 in C:\simon\Projects\Eclipse3.2\phpscripts\cdata.php on line 24

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-28 12:39 UTC] cem@php.net
I'm discussing this one with the Tuscany team - not sure yet where the problem lies.
 [2006-12-13 07:01 UTC] cem@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/SCA_SDO

Added support for OpenDataObjectType
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun May 26 13:01:25 2019 UTC