Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Adobe Flex SDK Previous
-
None
-
None
-
Affected OS(s): Windows
Affected OS(s): Windows 7
Language Found: English
Description
Steps to reproduce:
1.Create an XMLList using MXML declarative syntax like so:
<fx:XMLList id="myXML" xmlns="">
<ElementRoot>
<ElementChild>Some Text
<ElementSubChild>Yeah</ElementSubChild>
</ElementChild>
</ElementRoot>
<ElementRoot>
<ElementChild>More Text
<ElementSubChild>Yeah Dawg</ElementSubChild>
</ElementChild>
</ElementRoot>
<ElementRoot>
<ElementChild>Yet More Text</ElementChild>
</ElementRoot>
</fx:XMLList>
2. Attempt to access a text node of any ElementChild element.
3. For extra profit, attempt to print the list by using toXMLString();
Actual Results:
If the ElementChild contains a child node that is an element as well as a text node, the textNode is destroyed or somehow not parsed correctly.
The above code, when toXMLString() is called, produces the following output: <ElementRoot>
<ElementChild>
<ElementSubChild>Yeah</ElementSubChild>
</ElementChild>
</ElementRoot>
<ElementRoot>
<ElementChild>
<ElementSubChild>Yeah Dawg</ElementSubChild>
</ElementChild>
</ElementRoot>
<ElementRoot>
<ElementChild>Yet More Text</ElementChild>
</ElementRoot>
The text nodes "Some Text" and "More Text" are missing.
Expected Results:
I would expect to see the following output:
<ElementRoot>
<ElementChild>Some Text
<ElementSubChild>Yeah</ElementSubChild>
</ElementChild>
</ElementRoot>
<ElementRoot>
<ElementChild>More Text
<ElementSubChild>Yeah Dawg</ElementSubChild>
</ElementChild>
</ElementRoot>
<ElementRoot>
<ElementChild>Yet More Text</ElementChild>
</ElementRoot>
Workaround (if any):
Instead of using XMLList, roll the XML into an XML object, which parses correctly, and fetch elements via standard e4x. Not really ideal, but passable.