Create xml from object

Basically, I want to create an XMLDesigner object in Flex, with which the user can add / edit components and view / dashboard properties. I save the presentation structure in an XML file. I analyzed this file at runtime and display. How to convert an object (having properties and sub-objects) to an xml node (with attributes and elements) and add this xml to an existing xml file. so that the next time I parse the xml file I will get this new component in my view / pane.

for example, the structure of the component object in the xml file:

<view id="productView" label="Products">
<panel id="chartPanel" type="CHART" ChartType="Pie2D" title="Productwise Sales"  x="215" y="80" width="425" height="240" showValues="0" >  
  </panel> 
</view>

Thanks at Advance.

+5
source share
2

XML (de).

, , , FlexxB. , !

Flexxb , .

, -.

        [XmlClass(alias="MOck2Replacement", idField="id")]
        public class Mock3
        {
                [XmlAttribute]
                public var id : Number = 3;
                [XmlAttribute]
                public var attribute : Boolean;
                [XmlElement(alias="objectVersion")]
                public var version : Number;

                public function Mock3()
                {
                        super();
                }
        }

, XML .

var target : Mock3 = new Mock3();
target.attribute = true;
target.id = 5;
target.version = 33;

FlexXBEngine.instance.serialize(target)

<MOck2Replacement attribute="true" id="5">
  <objectVersion>
    33
  </objectVersion>
</MOck2Replacement>

, .

API, . AP, - SolidColor LinearGradient, , .

Samples. SWC:)

+7

asbeangen .

  • dtd
  • ActionScript dtd
  • ActionScript xml
  • toXML() root. xml .

quickstart.

0

All Articles