SDO global element behaviour
| From: | Simon Laws | Date: | Mon, 19 Jun 2006 12:48:51 +0000 |
| Subject: | SDO global element behaviour | ||
| Groups: | php.pecl.dev | ||
| Request: | Send a blank email to pecl-dev+get-3920@lists.php.net to get a copy of this message | ||
There is something going on with the root data object that I don't
understand.
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> This is a little strange. SDO seems to be having problems working out how to hold onto the value of the simple type at the top level of the data object tree. Can one of the PHP/SDO team confirm that this is not expected behaviour? If it's not I'll raise a bug. If you point me in the right direction I may be able to take a look at this or at least create some documentation to point this out to new users.