php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57103 Global element of simple type bug
Submitted: 2006-06-22 05:47 UTC Modified: 2007-04-24 12:11 UTC
From: simonslaws at googlemail dot com Assigned: tuscany (profile)
Status: Not a bug Package: SCA_SDO (PECL)
PHP Version: 5.1.2 OS: Windows XP
Private report: No CVE-ID: None
 [2006-06-22 05:47 UTC] simonslaws at googlemail dot com
Description:
------------
When I read XML (via the XML DAS) that validates against an XSD with a GED
with a complex type and then write it out again (via the XML DAS) the output
matches the input, for example,

IN XSD:
<schema xmlns="..."
 <complexType name="ComplexTypeContentType">
   <sequence>
     <element name="SimpleTypeWithName" type="string"/>
   </sequence>
 </complexType>
 <element name="RootElement7" type="tns:ComplexTypeContentType"/>
</schema>

IN XML:
<tns:RootElement7 xmlns:tns="...">
   <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
</tns:RootElement7>

OUT XML:
<RootElement7 xmlns="...">
   <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
</RootElement7>


So all is well. When I repeat this execise with a GED with a simple type
rather than a complex type then the output doesn't match the input.

IN XSD:
<schema xmlns="...">
 <simpleType name="SimpleTypeWithNameType">
   <restriction base="string"/>
 </simpleType>
 <element name="RootElement6" type="tns:SimpleTypeWithNameType"/>
</schema>

IN XML:
<tns:RootElement6 xmlns:tns="... ">
   tns:RootElement1
</tns:RootElement6>

OUT XML:
<RootElement6 xmlns="...">
   <RootElement6>tns:RootElement1</RootElement6>
</RootElement6>

SDO has problems problems working out how to hold onto the value of the simple type at the top level of the data object tree because, with a
simple type, there is no data object to holds the property that is the simple type.

GEDs of simple type don't occur that often in the real world but it is a likely candidate for the first simple test of a new user. Hence it gives a bad impression if it doesn't work as expected. 

This bug is has duplicate posting as Tuscany JIRA488 (http://issues.apache.org/jira/browse/TUSCANY-488) as both code bases exhibit the same problem 

Reproduce code:
---------------
IN XSD:
<schema xmlns="...">
 <simpleType name="SimpleTypeWithNameType">
   <restriction base="string"/>
 </simpleType>
 <element name="RootElement6" type="tns:SimpleTypeWithNameType"/>
</schema>

IN XML:
<tns:RootElement6 xmlns:tns="... ">
   tns:RootElement1
</tns:RootElement6>

Expected result:
----------------
OUT XML:
<RootElement6 xmlns="...">
   RootElement1
</RootElement6>

Actual result:
--------------
OUT XML:
<RootElement6 xmlns="...">
   <RootElement6>tns:RootElement1</RootElement6>
</RootElement6>

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-24 12:11 UTC] cem@php.net
Thank you for taking the time to report a problem with the package.
Unfortunately you are not using a current version of the package -- 
the problem might already be fixed. Please download a new
version from http://pecl.php.net/packages.php

If you are able to reproduce the bug with one of the latest
versions, please change the package version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PECL.

Simon, looking at the Tuscany defect you list, it appears to have been fixed back in January, and would have been in our 1.1.2 release if so. Please verify.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 21:01:41 2019 UTC