What steps will reproduce the problem?
Deserializing a node with CDATA tags as default value.
What is the expected output? What do you see instead?
The deserialized string is expected to not contain CDATA tags, but they show up.
What version of the product are you using? On what operating system?
2.3.1 (even though it says 2.3.0 VERSION.as), Windows 7 x64
Please provide any additional information below.
Here's an example, you should see that "root.child.value" will output "<![CDATA[Lorem <b>ipsum</b> dolor <i>sit</i> amet]]>" while "root.anotherChild" gives the expected output "Lorem <b>ipsum</b> dolor <i>sit</i> amet" without the CDATA tags.
---------------------
package
{
import com.googlecode.flexxb.annotation.*;
public class RootModel
{
[XmlElement]
public var child:ChildModel;
[XmlElement]
public var anotherChild:String;
}
}
package
{
import com.googlecode.flexxb.annotation.*;
[XmlClass(defaultValueField='value')]
public class ChildModel
{
[XmlAttribute]
public var what:String;
[XmlElement]
public var value:String;
}
}
var cdata:XML = new XML('<![CDATA[Lorem <b>ipsum</b> dolor <i>sit</i> amet]]>');
var document:XML =
<root>
<child>{cdata}</child>
<anotherChild>{cdata}</anotherChild>
</root>;
var root:RootModel = FxBEngine.instance.getXmlSerializer().deserialize(document, RootModel) as RootModel;
trace(root.child.value);
trace(root.anotherChild);
---------------------
For now i've worked around the problem by directly using
---------------------
return serializer.converterStore.stringToObject(xmlElement.toString(), element.type);
---------------------
instead of
---------------------
for each (var child : XML in xmlElement.children()) {
if (child.nodeKind() == "text") {
return serializer.converterStore.stringToObject(child.toXMLString(), element.type);
}
}
---------------------
in XMLMemberSerializer.as
Labels: Milestone-2.4.0