Deserialize XML to custom Class in Flex?

Posted by MysticEarth on Stack Overflow See other posts from Stack Overflow or by MysticEarth
Published on 2009-11-26T15:48:47Z Indexed on 2010/05/05 16:18 UTC
Read the original article Hit count: 363

Is it possible to deserialize an XML file to a class in Flex without manually checking the XML and/or creating the class, with the help of a HttpService?

Edit: Explained a bit more and better.

We have an XML file which contains:

<Project>
 <Name>NameGoesHere</Name>
 <Number>15</Number>
</Project>

In Flex we want this to be serialized to our Project class:

package com.examplepackage
{
    import mx.collections.ArrayCollection;

    [XmlClass]
    public class Project
    {
    	public var Name:String;
    	public var Number:int;	

    	public function Project()
    	{
    	}
    }
}

The XML is loaded with a HTTPService.

© Stack Overflow or respective owner

Related posts about flex

Related posts about Xml