Export the ArrayCollection collection in XML file

Hi all

Is it possible to export a Flex ArrayCollection collection to an XML file.

My collection of table is displayed in a datagrid as follows

< mx:DataGrid = "360" x y = "120" width = "448" height = "200" dataProvider = "{questionsArr}" >
< mx:columns >
< mx:DataGridColumn headerText = "Issue" dataField = "issue" / >
< mx:DataGridColumn headerText = dataField "Start" = "start" width = "40" textAlign = "center" / >
< mx:DataGridColumn headerText = "Stop" dataField = "stop" width = "40" textAlign = "center" / >
< / mx:columns >
< / mx:DataGrid >

And I want to output the XML to look like this

< cue >
"< question section =" "start =" "stop =" "/ >
"< question section =" "start =" "stop =" "/ >
"< question section =" "start =" "stop =" "/ >
< / cue >

Is this possible?  I mean all the data is ready, he just needs to be saved. .

Hi djh88ukwb,

Try something as shown below in the link by performing a loop through the arraycollection collection and forming the knots... the way you need...

http://nsdevaraj.WordPress.com/2008/08/20/ArrayCollection-XML/

Thank you

Jean Claude Chari

Tags: Flex

Similar Questions

  • Need help with the help of an xml file for changes in the system profile

    I'm looking to accelerate the deployment of new rack-mounted servers by updating their server through xml import profile information and I'm stuck.

    I am able to successfully export the profile as an XML to NFS.

    I'm not having luck changing data to import.

    My first attempt great base is simply by changing the name of drac.

    Here are the contents of the xml file that I am trying to import:

    ");" >
    laboratories-001-dev-a01 - dc1.example .net
    The job fails.

    Any ideas on what I am doing wrong?

    Hi Martin,

    I found my problem.

    In the GUI, you can enter a COMPLETE domain like something.example.com name in DNS Rac name field.

    Who will fail via importing a racadm as apparently a. is not allowed during the updating of the attribute "NIC.1 #DNSRacName".

    Is this a bug of the DRAC?

  • How to export the Indesign to Format XML using JavaScript document

    Hi all...

    Can someone help me, how to export the indesign document to XML Format using JavaScript...

    Thanks in advance...

    doc.exportFile ( ExportFormat.XML, File(Folder.desktop+"/doc.xml" )
    
  • Add a line of DataGrid using the ArrayCollection collection

    Work of one of these, when I hard code do it programmatically is not:

    Hard-coding approach 1 - *.
    var acData:ArrayCollection = new ArrayCollection();
    ...

    Each DataGridColum has a dataField like "col1", "col2", "col3", etc...
    Therefore, adding items like this works
    acData.addItem({col0:"testa",col1:"testb",col2:"testc",col3:"testd",col4:"teste"});)


    2 - programming approach *.
    But adding items like that does not work
    for (var j = 0; j < dataRows.length (); j ++) {}
    var t:String = [j] of dataRows m:System.NET.SocketAddress.ToString (); dataRows is of type XMLList, data are formatted as the format above
    I did a breakpoint to check and someone else watch the channel and it matches the format that works.
    acData.addItem (t);
    }

    When I try the second approach, I get all the content of the string in each cell of the grid, where, in the first approach, I get "tested" in the first column, "testb" in the second column (without quotes of course), etc...

    Anyone know why there is a difference or what I am doing wrong?

    Thanks in advance.


    I guess that's because in the second approach, you add a string to your ArrayCollection collection instead of an object as in the first approach:

    acData.addItem({col0:"testa",col1:"testb",col2:"testc",col3:"testd",col4:"teste"});) This is an object with the properties that you add to the ArrayCollection collection

    var t:String is dataRows [j] m:System.NET.SocketAddress.ToString ();. It is a string, not an object
    acData.addItem (t); you add a string to the ArrayCollection collection

    You must take your XML string and generate a new object, as in your first approach, using the End Sub

  • Get the table to an XML file with several bays

    Hello

    So I was faced with this program I have for the past few months but I'm almost there. I have a program that creates several berries and place one after the other in an xml file, and each table has its unique name. Now, I would create a VI that takes this XML file and when the user enters the name of the table specific they are seeking it goes into the xml file concludes the table in its entirety under this name and displays in an indicator of output to be read on the VI. A sample of my xml file and the VI that creates this xml file is attached.

    Thank you

    dlovell

    Something like this should work for you.

  • Export the result to an Excel file

    I use the attached script to export the inventory then as excel file. I used LucDtechnical of this post to store information in a CSV temp and later, save them to a XLS file. I need to perform a certain formatting in the report, as to change the size of the font of the header, adding some background colors.

    Do not the formatting as I am exporting to a CSV file. Is there another way to achieve the formatting?

    You can take a look at my post Export-Xlsx, the suite and ordered data .

  • How to check whether or not the arraycollection collection is initialized

    Hi all

    I am bit new to use the collection arraycollection in flex. I'm having this particular scenario, where I get Server data in a table. So I have to check if the arracollection I created is initialized or not. If it is not initialized I need to initialize it or other wise, just add collection from table to table. Here is the code snippet

    currentTrajectory = new collection ArrayCollection (event.result as Array);

    var _multiTrajectoryEvent:MultiTrajectoriesEvent;

    _multiTrajectoryEvent = new MultiTrajectoriesEvent (MultiTrajectoriesEvent.DRAW_AUTO_TRAJ);

    If (!) (_multiTrajectoryEvent.trajectories.source is nothing))

    {

    _multiTrajectoryEvent.trajectories.addItem (currentTrajectory);

    }

    else

    {

    _multiTrajectoryEvent.trajectories = new ArrayCollection ([currentTrajectory]);

    }

    But unfortunately the above code does not work for me, because the arraycollection collection is not initialized first, there is no way of checking me if it is initialized later or not as the compiler gives me the error checking to null...

    Can any Walter suggest how can I check if the table collection is initialized or not?

    I would appreciate any suggestions and thouhgts for the same

    Thank you

    Akshay

    Sorry to say, but it's not the right approach...

    I'm abt don't know what is exactly done so I'll give a generic example...

    I have an ArrayCollection collection...

    private var arrC:ArrayCollection;

    Maybe it's getting used internally in several places, so you be sure if she be initialized already or not. Then use a code something like that...

    If (arrC! = null & arrC.length > 0)

    {

    ...

    ...

    }

    If you are using

    If (arrC.Length > 0)

    {

    ...

    ...

    }

    and it is not initialised it will give exceptional at the time to compile...

    For a logic if(a && b) be true both a and b must be true, so if same first one (a) is false it will not evaluate the second logic (b).

    Thus, the previous logic works.

    concerning

    Nishant

  • get the fields of the arraycollection collection?

    I want to loop through a collection of table and access all the items (columns)

    the arrayCollection collection looks so

    .columnOne [1]
    .columnTwo [1]
    .columnThree [1]
    .columnfour [1]

    [Bindable] public var dataSet:ArrayCollection = new ArrayCollection();

    protected function application1_creationCompleteHandler(event:FlexEvent):void

    {

    TODO self-generating method stub

    var d: Array = new Array()

    var int count = 5;

    var c:Number, r: Number;

    for (var i: int = 0; i<>

    {

    c = Math.Floor (Math.Random () * 10)

    r = Math.Floor (Math.Random () * 10)

    d.push ({cost: i + 1})

    Recipes: 2 * i + 1

    });

    }

    dataSet.source = d;

    Call();

    }

    function call (): void

    {

    for each (var point: Object in dataSet)

    {

    (var key: string in point)

    {

    trace (Key)

    trace ([Key] Item)

    }

    }

    }

  • Access table in the arraycollection collection and add the item at the end of the table

    for
    
    
    "login_user":"XXX"},i);
    
    //mess2=sess_MessArr[i2];
    //mess1=dispArray[i2].fwchat_message
    
    //searchArray(mess2);}
    
    
    
    
    
    (var i:int = 0; i< dispArray.length; ++i){
    
    dispArray[i]. 
    dispArray.addItemAt({
    


    I have this code to try to access the values in the table in the arraycollection collection, but that's not it actually creates a value at the end of the arraycollection collection. can someone tell me what im doing wrong I basically want retransmits the individual tables in the arraycollection collection and add Login_user

    So, I guess your ArrayCollection collection holds an array of objects, as follows:

    public var myAC:ArrayCollection = new ArrayCollection([{first:"bob",last:"smith"},{first:"jim",last:"jones"},{first:"mary",last:"allen"}]);
    

    And you try to add a new property of login_user to each of them, right?

    for each (var obj:Object in myAC) {
         obj.login_user = obj.first + "83";
    }
    

    Each person would be firstly, properties last and login_user.  In my example above, all the login_user would set their name + number 83, so adjust you accordingly for your application.

    It is the ease (for each rock for this situation).  However, if you want to paste the iterative approach, you have published, you can try this:

    for (var i:int = 0; i < myAC.length; i++) {
         myAC.getItemAt(i).login_user = myAC.getItemAt(i).first + "83";
    }
    

    I think that the for each syntax is clearer, but anyway works the way I think you want.

  • With the help of several xml files to complete the 1 form.

    Hi all

    Thank you for reading this.

    My scenario is that I have a form which is the inspection report for a product.

    Once the technician has completed its inspection they fill out the form and send it (which saves the form as xml data in a specific folder on our network.

    Now 1 customer may have up to 10 items to be inspected on a single order. What I have to do is to create a customer report showing them the necessary work on their items.

    Basically, I need to be able to import up to 10 xml files of inspection report in 1 report form.

    I was looking for this with the authorities, but I'm wrong.

    I can get 1 data file imported by using xfa.host.importdata("filename")

    but this method seems to reset the form after the first call to the second instance of the form in the form of report receives all the data. (if this makes no sense at all)

    How can I configure my report form so I can fill different instances of the subform from different xml files?

    that is my xml files names are formatted with call number and line number, e.g. 42E11134 - 5.xml would call no. 42E11134 line 5.

    the folder on the network would have to be 42E11134-10 42E11134-1 (not superior because we cap the maximum points on the same order)

    I need to figurentsur instance subform 1, 42E11134-5 42E11134-1 data displayed on the subform instance 5 etc etc and also recognition of the number of necessary instances (but this could be selected by the user).

    If the authorities do not work I am happy to have 10 separate subforms with different names, but must exist within a single form.

    You can only import a single XML file. You have an xml file that has multiple instances of data, but it must be a single xml file.

    So you should find a way to combine all these into a single xml files then do the import.

    Paul

  • How to get the child elements of the ArrayCollection collection?

    Hi all

    I want to analyze collection ArrayCollection and want the child node element.

    How to parse the arraycollection collection?

    for (var i: int = 0; i<>

    {if (arrayCollectionObject.getItemAt (i). Item is "requireditem")}

    your code

    break;

    }

    }

    Let me know if it helps

  • Is it possible to search the ArrayCollection collection by index?

    Hi all

    I know, we can loop and compare each element of the ArrayCollection collection to get the correct item that we want. Obveriously, performance is going to hurt and it is not a wise method of search. Can we create an index for the key field of each item? Or any other class offering such a feature?

    Thank you

    When you say "a clue" are you talking like one in a table of database index?  That is something that can speed up a search?

    I'm trying to understand your desire and I think that what I hear, is that you have an ArrayCollection collection contains a number of objects.   When you want to find a particular object, you have found a way to locate the desired instance to browse each item in the collection ArrayCollection and ask "this element is equal to the key of the object I'm looking for?   I think that you are concerned by the amount of time it can take.

    Go back decades to my knowledge of computer science, this is an o(n) algorithm where n is the number of items in the table.

    Now, if there was an 'index' (ala databases) on the data, so if this index have been sorted, you would be able to find your match in O (log n)

    You can pay an O (n log n) cost the sort index when the data structure is created, but if you have a large number of research, then it can pay for itself.

    I'm not aware of any function that will help you on this out of the box (but that doesn't mean not there does not exist, only that I don't know about it.)

    I would like to also truthly ask yourself "is it worth the cost?   How many items you will have a typical table?  How often do you locate an entry in this table?

    Neil

  • update of the arrayCollection collection

    Jin

    I have an arrayCollection collection each time it updates, I need to make some sort of a calculation, how can I do with mechanizm binding?

    Thank you
    Jean Michel

    There is an event collectionChange on the ArrayCollection collection that gets shot above power off when the ArrayCollection collection changes. You can capture this event and then sort the collection out of that.

    The reference of the language will give you a few details: http://livedocs.macromedia.com/flex/2/langref/index.html

    -Andy

  • How to upgrade the ArrayCollection collection when running?

    Am facing a problem with the arraycollection collection...
    will have an arraycolelction like that...
    var dpHierarchy:ArrayCollection = new ArrayCollection([)
    {Region: "Application1"},
    {Region: "Demand2"},
    {Region: "Demand3"},
    [{Region: "APPROVISIONNEMENTS4"}]

    now what I'm looking for is... How to upgrade this arraycollection collection during execution using actions script?
    I need to update this collection table something like this...

    var dpHierarchy:ArrayCollection = new ArrayCollection([)
    {Region: "Application1", year: '2008'},
    {Region: "demand2', year: '2008'},
    {Region: "Demand3', year: '2008'},
    [{Region: "APPROVISIONNEMENTS4", year: '2008'}]

    How to add the year field in to existing collection arraycollection as shown in the example...

    Thanks in advance
    Pratap

    Hey get...

    I have to just give

    dpHierarchy [0] ['year'] = '2008 '.

    :-)

  • Cast of XML for the ArrayCollection collection where there is a single record

    I work with web services and in the result handler doing the following

    protected function WbSc_SSPr_PrinterListResult_resultHandler(event:ResultEvent):void
    {
    printerlistArrayCollection = event.result.Printer as ArrayCollection collection;
    PrinterCount = printerlistArrayCollection.length - 1;
    }

    If there is more than one value it works fine.

    If only one value is returned, then it shows as nothing.

    Huh?

    When I run it as a test, it returns a record

    <? XML version = "1.0" encoding = "UTF-8"? >
    < SOAP - ENV:Envelope
    " SOAP - ENV:encodingStyle = ' http://schemas.xmlsoap.org/SOAP/encoding/ "
    " xmlns:SOAP - ENC =" http://schemas.xmlsoap.org/SOAP/encoding/ "
    " xmlns:SOAP - ENV =" http://schemas.xmlsoap.org/SOAP/envelope/ "
    " container = ' http://www.w3.org/2001/XMLSchema "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance ">
    < SOAP - ENV:Body >
    " < = xmlns:ns1 ns1:WbSc_SSPr_PrinterListResponse ' http://www.4d.com/namespace/default ">
    < BidList xsi: type = "xsd: anyType" >
    < printer >
    Cognititve < do > < / make >
    ZB345 < template > < / template >
    < problem > This IS a TEST PROBLEM < / problem >
    < / printer >
    < / BidList >
    < / ns1:WbSc_SSPr_PrinterListResponse >
    < / SOAP - ENV:Body >
    < / SOAP - ENV:Envelope >

    Probably something like this will do:

    If (event.result.Printer is collection ArrayCollection) {}

    printerlistArrayCollection = event.result.Printer as ArrayCollection collection;

    } else {}

    printerlistArrayCollection = new ArrayCollection ([event.result.Printer]);

    }

Maybe you are looking for

  • No import and backup in Firefox 7.0.1 for Ubuntu canonical - 1.0

    After spending and update Ubuntu Ubuntu 11 and with the new Firefox 7.0.1 for Ubuntu canonical 1.0, I was going to import the backup of bookmarks to html to see that there is no way to import and backup of bookmarks. What is the problem here?I'd give

  • EliteBook 2540p: System NCL hp elite 2540p, SD card ports and Base headphoneports

    After the installation of the new window, am on window 7 ultimate 32 bit, I have the following problems 1 ports headset does not work, although speekers works fine. 2. SD card port does not feature USB port properly 3. I cannot update the driver know

  • Key FN with F5, F6, F7 and F1 does not. Windows 8.1

    I've updated directly to Windows Pro 8.1, my Sony VAIO VPCEH2LGX. He was originally with Windows 7 Pro. I know in Win 7, there is a specific order of installation direver in order for the Fn button work, but on 8 to win, I'm not sure. I tried everyth

  • Host file

    I tried to load Mcafee but could not.  I participated in a live session with them and they diganosed my probem as: "the host file in my computer that is associated with the operating system is damaged."  They sent me to microsoft to fix it.  Help - t

  • Antivirus protection for PC

    I got my uninstalled McAfee and I was wondering if I really need to buy antivirus protection?  My firewall is enabled, automatic update is enabled, Windows defender is on, and other security settings are ok... do I have to buy an antivirus protection