Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Later
-
Adobe Flex SDK 3.1 (Release)
-
None
-
None
-
Affected OS(s): Windows
Affected OS(s): Windows XP
Language Found: English
Description
XMLDecoder incorectly decode elements without subelements.
Steps to reproduce:
1. Take following xml scheme
<xs:schema version="1.0"
targetNamespace="http://xyz.abc.com/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://xyz.abc.com/">
<xs:element name="library" type="tns:library"/>
<xs:complexType name="library">
<xs:sequence>
<xs:element name="book" type="tns:book" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="book">
<xs:sequence>
<xs:element name="fake" minOccurs="0" type="tns:fake"/>
</xs:sequence>
<xs:attribute name="id" type="xs:long" use="required"/>
<xs:attribute name="name" type="xs:string"/>
</xs:complexType>
<xs:complexType name="fake" />
</xs:schema>
2. take xml file
<lib><book name="TTTT" id="98" /></lib>
3. decode xml using XMLDecode to object.
4. get lib object that contains book object with two fields id and name
Actual Results:
lib.book.id = NaN
lib.book.id = null
Expected Results:
lib.book.id = 98
lib.book.id = "TTTT"
Workaround (if any):
if possible put some fake subelement to book element.
Please take a look to attachment, that contains FlexBuilder project with flexUnit test.