How to load external XML into DataGrid ??

Hello ,everybody , I can't load external Xml like this format
<list>
<month name="Jan-04" revenue="400263" average="80052">
<region name="APAC" revenue="46130"/>
<region name="Europe" revenue="106976"/>
<region name="Japan" revenue="79554"/>
<region name="Latin America" revenue="39252"/>
<region name="North America" revenue="128351"/>
</month>
<month name="Feb-04" revenue="379145" average="75829">
<region name="APAC" revenue="70324"/>
<region name="Europe" revenue="88912"/>
<region name="Japan" revenue="69677"/>
<region name="Latin America" revenue="59428"/>
<region name="North America" revenue="90804"/>
</month>
</list>
I only can load with node format like this :
<order>
<item>
<menuName>burger</menuName>
<price>3.95</price>
</item>
<item>
<menuName>fries</menuName>
<price>1.45</price>
</item>
</order>
Please tell me what am I going to do?
Thanks!

I'm stuck on this as well. I've read through the above
samples and postings and am now feeling really retarded. I thought
throwing the contents of a simple XML doc into a DataGrid would be
easy, but I've been trying all morning and no love. Any help is
appreciated.
Here the XML --> guides.xml
<?xml version="1.0" encoding="UTF-8">
<GuideList title="Current Guides">
<GuideItem>
<GuideName>11699240</GuideName>
<DisplayName>Supercharged Branding
Program</DisplayName>
<LinkText>View Downloadable Guide</LinkText>
<Franchise>Film/TV</Franchise>
<Property>Cars</Property>
</GuideItem>
<GuideItem>
<GuideName>11721503</GuideName>
<DisplayName> Packaging & Retail
Signage</DisplayName>
<LinkText>View Downloadable Guide</LinkText>
<Franchise>Film/TV</Franchise>
<Property>None</Property>
</GuideItem>
etc....
Here's the flex --> GuideListDisplay.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" initialize="guidelist.send()">
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.ResultEvent;
[Bindable] private var myData:ArrayCollection;
private function resultHandler(event:ResultEvent):void {
myData = event.result.GuideList.GuideItem;
]]>
</mx:Script>
<mx:HTTPService id="guidelist" url="assets/guides.xml"
result="resultHandler(event)"/>
<mx:Panel title="{myData.GuideList.title}"> // 1119
<mx:DataGrid x="29" y="36" id="Guides"
dataProvider="{myData.lastresult.GuideList.GuideItem}"> // 1119
<mx:columns>
<mx:DataGridColumn headerText="Guide Number"
dataField="GuideName"/>
<mx:DataGridColumn headerText="Guide Name"
dataField="DisplayName"/>
<mx:DataGridColumn headerText="DisplayText"
dataField="LinkText"/>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
</mx:Application>
The lines throw with // 1119 throw a problem notice - 1119:
Access of possibly undefined property GuideList through a reference
with static type mx.collections:ArrayCollection.
GuideListDisplay.mxml Lessons line 17 March 21, 2007 12:53:45 PM
215
Please help before hari kari looks like a good option.
Thanks!

Similar Messages

  • Load external XML into DataGrid with AS3

    I've really looked hard to find an example/tutorial for
    loading external XML data into a DataGrid component using AS3. The
    code I'm using at the moment has the XML data in the AS code. If
    anyone can point me to a good resource(s) for code or a tutorial
    I'd be very appreciative. It needs to be AS3. ~steve
    Here is the code that is working for internal XML data:
    import fl.controls.dataGridClasses.DataGridColumn;
    import fl.data.DataProvider;
    stop();
    var emailXML:XML = <emails>
    <email date="06-04-07" code="EMRPAAV" campaign="This is
    the campaign details."/>
    <email date="06-11-07" code="EMRPAAW" campaign="This is
    the campaign details."/>
    <email date="06-18-07" code="EMRPAAX" campaign="This is
    the campaign details."/>
    <email date="06-25-07" code="EMRPAAY" campaign="This is
    the campaign details."/>
    <email date="07-02-07" code="EMRPAAZ" campaign="This is
    the campaign details."/>
    <email date="07-09-07" code="EMRPABA" campaign="This is
    the campaign details."/>
    </emails>;
    var dateCol:DataGridColumn = new DataGridColumn("date");
    dateCol.headerText = "Date";
    dateCol.width = 60;
    var codeCol:DataGridColumn = new DataGridColumn("code");
    codeCol.headerText = "Source Code";
    codeCol.width = 70;
    var campaignCol:DataGridColumn = new
    DataGridColumn("campaign");
    campaignCol.headerText = "Campaign";
    campaignCol.width = 300;
    var myDP:DataProvider = new DataProvider(emailXML);
    emailData.columns = [dateCol, codeCol, campaignCol];
    emailData.width = 440;
    emailData.dataProvider = myDP;
    emailData.rowCount = emailData.length;
    // end code

    Here is how you build it for external XML. in my example am
    using the same xml format that you are using . The xml file called
    "dataGrid.xml"
    import fl.controls.dataGridClasses.DataGridColumn;
    import fl.data.DataProvider;
    import fl.containers.UILoader;
    import fl.data.DataProvider;
    import fl.events.*;
    import flash.xml.*;
    var emailXML:XML;
    var myList:XMLList;
    function parseXML():void
    var url:String = "dataGrid.xml";
    var urlRequest:URLRequest = new URLRequest(url);
    var loader:URLLoader = new URLLoader();
    loader.addEventListener("complete" , loadXML);
    loader.load(urlRequest);
    /*var emailXML:XML = <emails>
    <email date="06-04-07" code="EMRPAAV" campaign="This is
    the campaign details."/>
    <email date="06-11-07" code="EMRPAAW" campaign="This is
    the campaign details."/>
    <email date="06-18-07" code="EMRPAAX" campaign="This is
    the campaign details."/>
    <email date="06-25-07" code="EMRPAAY" campaign="This is
    the campaign details."/>
    <email date="07-02-07" code="EMRPAAZ" campaign="This is
    the campaign details."/>
    <email date="07-09-07" code="EMRPABA" campaign="This is
    the campaign details."/>
    </emails>
    parseXML();
    function loadXML(evt:Event):void
    emailXML = new XML(evt.target.data);
    myDP = new DataProvider(emailXML);
    emailData.dataProvider = myDP;
    var dateCol:DataGridColumn = new DataGridColumn("date");
    dateCol.headerText = "Date";
    dateCol.width = 60;
    var codeCol:DataGridColumn = new DataGridColumn("code");
    codeCol.headerText = "Source Code";
    codeCol.width = 70;
    var campaignCol:DataGridColumn = new
    DataGridColumn("campaign");
    campaignCol.headerText = "Campaign";
    campaignCol.width = 300;
    var myDP:DataProvider;
    emailData.columns = [dateCol, codeCol, campaignCol];
    emailData.width = 440;
    emailData.dataProvider = myDP;
    emailData.rowCount = emailData.length;

  • How do you load external XML into a dataProvider?

    I have been looking through the docs and have found a couple
    of entries discussing how to load external XML. Unfortunately, that
    is where the example stops and there is no example of doing
    anything useful with that data.
    I have managed thus far to get my XML file loaded into
    actionscript/flex:
    function getExternalXML():void {
    request = new URLRequest('source.xml');
    loader = new URLLoader();
    loader.load(request);
    loader.addEventListener("complete", loadXML);
    function loadXML(e:Event):void {
    combo.dataProvider = loader.data;
    obviously, the above doesn't work at all. I don't know how to
    convert the loader.data into a format that the
    ComboBox.dataProvider understands. I can't believe I have to write
    a function to parse this XML. Surely there must be a way to simply
    convert the XML to an array or something???

    That link uses the flex beta 3 docs. You may want to use the
    current livedocs.
    Here
    is a direct link to the section I was talking about.
    Scroll down about halfway to the part that says "However,
    using a raw data object..."
    If you want the PDFs (easier to read IMO) you can get them
    here.
    Here
    is a direct link to the Developer's Guide:

  • How to load a XML into Checkpoint in UFT API using custom code

    I am automating a webservice using UFT-12. In which I am trying to load a xml into the checkpoint at run time. but I am not able to find out a way of doing it.Can any1 help me on this?

    @piyu_sh_arm 
    ‎Thank you for using HP Support Forum. I have brought your issue to the appropriate team within HP. They will likely request information from you in order to look up your case details or product serial number. Please look for a private message from an identified HP contact. Additionally, keep in mind not to publicly post ( serial numbers and case details).
    If you are unfamiliar with the Forum's private messaging please click here to learn more.
    Thank you,
    Omar
    I Work for HP

  • How to load 2 xml galleries in single function loop.

    how to load 2 xml galleries in single function loop.
    my function is--------
    var myGalleryXML = new XML();
    myGalleryXML.ignoreWhite = true;
    myGalleryXML.load("gallery.xml");
    function callThumbs()
        _root.createEmptyMovieClip("wall",_root.getNextHighestDepth());
        wall._x = _root.gallery_x;
        wall._y = _root.gallery_y;
        wall.addEventListener(MouseEvent.CLICK);
        var clipLoader = new MovieClipLoader();
        var preloader = new Object();
        clipLoader.addListener(preloader);
            for (i =0; i <6; i++)
            thumbURL = myImages[i].attributes.thumb_url;
            myThumb_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());
            myThumb_mc._x = _root.thumb_height * i;
            myThumb_mc._x = _root.thumb_position = -3100 + (i-j) * 765;
       clipLoader.loadClip("shop/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery1.xml"
    preloader.onLoadStart = function(target)
                target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,10);
                target.my_txt.selectable = false;
            preloader.onLoadProgress = function(target, loadedBytes, totalBytes)
                target.my_txt.text = Math.floor((loadedBytes / totalBytes) * 100);
            preloader.onLoadComplete = function(target)
                new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
                target.my_txt.removeTextField();
                target.onRelease = function()
                    callFullImage(this._name);
                target.onRollOver = function()
                    this._alpha = 100;
                target.onRollOut = function()
                    this._alpha = 100;
        for (i = 0; i < 6; i++)
            thumbURL = myImages[i].attributes.thumb_url;
            myThumb_mc = wall.createEmptyMovieClip(i, wall.getNextHighestDepth());
            myThumb_mc._x = _root.thumb_height * i;
            myThumb_mc._x = _root.thumb_position = -7210 + (i-j) * 765;
            myThumb_mc._y = _root.thumb_position = 180;
            clipLoader.loadClip("banner/" + thumbURL,myThumb_mc);  // i want to load this  by xml gallery "gallery2.xml"
            preloader.onLoadStart = function(target)
                target.createTextField("my_txt",target.getNextHighestDepth(),0,0,10,10);
                target.my_txt.selectable = false;
            preloader.onLoadProgress = function(target, loadedBytes, totalBytes)
                target.my_txt.text = Math.floor((loadedBytes / totalBytes) * 100);
            preloader.onLoadComplete = function(target)
                new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
                target.my_txt.removeTextField();
                target.onRelease = function()
                    callFullImage(this._name);
                target.onRollOver = function()
                    this._alpha = 100;
                target.onRollOut = function()
                    this._alpha = 100;

    combine the two xml files into one if you want to create one gallery.
    if you want two different galleries that display at different times, remove the movieclip wall after you're done with gallery1 and execute myGalleryXML.load("gallery2.xml");

  • Load external jpeg into flash movie

    Hi, how do i load external jpeg into flash movie?
    Can someone show me the actionscript? Thanks

    hi, i pasted the code on a mc but it didn't work.
    However, when i put in on frame action, it works.
    However, i realised the image flickered (more like refreshed)
    after afew sec...
    Is this normal? Is it the loop problem? how do i get rid of
    that?

  • How to load an XML file to oracle9i server?

    I want to use XSU DBMS_XMLsave package to load an XML file to a relational table using PL/SQL from a distant server. Now, I don't know how to load that XML file to the distant server.
    Somebody help me?

    I want to use XSU DBMS_XMLsave package to load an XML file to a relational table using PL/SQL from a distant server. Now, I don't know how to load that XML file to the distant server.
    Somebody help me?

  • Step- by- Step on How to Load Excel data into Crystal Reports?

    Hi Friends,
                      Can anyone send me a Step- by- Step on How to Load Excel data into Crystal Reports? Pls help me. Thanks in Advance.
    Vijay

    It's also important to 'prep' the excel file prior to connecting to it.
    Give the data tab a meaningful name
    Make sure the column headers are unique and that every column has a header
    Delete any blank tabs
    If you have trouble with Excel changing the data type of a field (say, a social security number you want to be a string value rather than a number so you don't lose leading zero) an alternative would be to save the spreadsheet file as a CSV, create a schema.ini to specify the data types for each column (example below) and use the same steps to connect except instead of choosing Excel 8.0, scroll to the bottom and choose Text.  You have to make sure the CSV file is in the same folder as the schema.ini file that defines the columns.
    Schema.ini example:
    200912PUSD.csv
    ColNameHeader=True
    Format=CSVDelimited
    MaxScanRows=25
    CharacterSet=OEM
    Col1=SSN Char Width 9
    Col2=LAST_NM Char Width 25
    Col3=FIRST_NM Char Width 25
    Col4=DOB Date
    Col5=STDNT_ID Char Width 10
    Col6=SORTKEY Char Width 10
    Col7=SCHOOL_NM Char Width 30
    Col8=OTHER_ID Integer
    Col9=GRADE Char Width 2
    The filename in the first line needs to have the []  brackets around it, but I couldn't get it to display in this forum correctly.
    Edited by: Eric Petersen on Jan 27, 2010 9:40 AM

  • How to load external data without using external tables

    Hi,
    I'm asked to develop an ETL for loading external data into a database but, unfortunately, the vers. is 8i so I can't use external tables.
    I know that it's possible by using SQL-Loader. What I want to know is whether there's another way in 8i to load external data from a text file or a CSV file directly with a stored procedure without having to write CTL of SQL-Loader on the server. I mean, is there a way to write everything on the database the same manner I'd do whether I wrote data from a table to a file using for example UTL_FILE or the unique way is to write control files of SQL-Loader directly on the server?
    Thanks!

    Mark1970 wrote:
    Thank you very much Karthick
    I didn't know I could use UTL_FILE also for reading files. I've always use it only for writing data into external files.Yes you can use UTL_FILE to read. The version of oracle you are using i last used in 2004 :) Still remember giving the OS path of the file to open the file. That is long gone now. Its surprising that you are still in 8i.

  • How to load external storage html file in web view

    hi all,
        how to load external storage html file in web view, please help me
       " ms-appdata://local/index.html" not working
    veerasuthan veerakesan

    It need be read as string. Then load the string by  Webview.NavigateToString.
    Sample as below
    string htmlstring = string.Empty;
    try
    var htmlfile = await Windows.Storage.ApplicationData.Current.LocalFolder.OpenStreamForReadAsync("a.html");
    using (System.IO.StreamReader streamReader = new System.IO.StreamReader(htmlfile))
    htmlstring = streamReader.ReadToEnd();
    webview.NavigateToString(htmlstring);
    catch(Exception ex)
    Debug.WriteLine(ex.ToString());
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • How to load oracle data into SQL SERVER 2000?

    how to load oracle data into SQL SERVER 2000.
    IS THERE ANY UTILITY AVAILABLE?

    Not a concern for an Oracle forum.
    Als no need for SHOUTING.
    Conventional solutions are
    - dump the data to a csv file and load it in Mickeysoft SQL server
    - use Oracle Heterogeneous services
    - use Mickeysoft DTS
    Whatever you prefer.
    Sybrand Bakker
    Senior Oracle DBA

  • Can you tell me How to loading sessions.xml in servlet

    Can you tell me How to loading sessions.xml in servlet

    Getting a session in a servlet is no different than in any other environment except that you need to be careful which classloader you pass to the SessionManager and correctly configure what to do if your application is reloaded. If you use the oracle.toplink.util.SessionFactory introduced in 10.1.3.1 you don't have to worry about these details--it uses the correct settings. The SessionFactory greatly simplifies the code required to get a session or unit of work. It's well documented in the SessionFactory javadoc.
    If you do use SessionFactory beware there is a bug when running in a JTA environment and there's no transaction started. Doug posted a work around in his blog[1].
    --Shaun
    [1] http://www.jroller.com/page/djclarke/20060412

  • *** Question How to load a file into BI-Integrated Planning and use WAD 7.0

    Hi, I created an manual DTP upload to my planning infocube and it works fine.  The transformation rules convert 0CALMONTH into the relevant Calendar and Fiscal characteristics.   So all of my Time Characteristics are fine, both Calendar and Fiscal.
    However, When using the "How to load a file into BI-Integrated Planning and use WAD 7.0" solution, only the Calendar Characteristics are populated and not the Fiscal.   The upload application somehow knows to populate the 0CALMONTH2, 0CALQUART1, 0CALQUARTER, and 0CALYEAR.  
    How can I get the upload to populate my Fiscal Period Characteristics?
    Would it be best to modify the "Upload Application, or can I write a planning function to update the fiscal characteristics, or some other way?
    Thanks!

    My planning data is being uploaded via the SDN Planning File Upload Solution. What I did was end up modifiying the upload class ZCL_RSPLF_FILE_UPLOAD Method EXECUTE.
    I added the following code if anyone is interested.
    *{ INSERT BWDK902323 1
    THIS SECTION OF CODE POPULATES THE FISCAL PERIOD CHARACTERISTICS
    USING THE FISCAL YEAR VARIANT 'NK' AND THE CALENDAR MONTH/YEAR
    FIELD-SYMBOLS <0FISCVARNT> TYPE /BI0/OIFISCVARNT. " Fiscal Year Variant
    FIELD-SYMBOLS <0FISCYEAR> TYPE /BI0/OIFISCYEAR. " Fiscal Year
    FIELD-SYMBOLS <0FISCPER> TYPE /BI0/OIFISCPER. " Fiscal Year/Period
    FIELD-SYMBOLS <0FISCPER3> TYPE /BI0/OIFISCPER3. " Posting Period
    FIELD-SYMBOLS <0CALMONTH> TYPE /BI0/OICALMONTH. " Calendar Month/Year
    ASSIGN COMPONENT '0CALMONTH' OF STRUCTURE <L_S_DATA> TO <0CALMONTH>.
    ASSIGN COMPONENT '0FISCPER' OF STRUCTURE <L_S_DATA> TO <0FISCPER>.
    ASSIGN COMPONENT '0FISCVARNT' OF STRUCTURE <L_S_DATA> TO <0FISCVARNT>.
    ASSIGN COMPONENT '0FISCPER3' OF STRUCTURE <L_S_DATA> TO <0FISCPER3>.
    ASSIGN COMPONENT '0FISCYEAR' OF STRUCTURE <L_S_DATA> TO <0FISCYEAR>.
    <0FISCVARNT> = 'NK'.
    CALL FUNCTION 'FISCPER_FROM_CALMONTH_CALC'
    EXPORTING
    IV_CALMONTH = <0CALMONTH>
    IV_PERIV = <0FISCVARNT>
    IMPORTING
    EV_FISCPER3 = <0FISCPER3>
    EV_FISCPER = <0FISCPER>
    EV_FISCYEAR = <0FISCYEAR>.
    *} INSERT

  • How to load an image into blob in a custom form

    Hi all!
    is there some docs or how to, load am image into a database blob in a custom apps form.
    The general idea is that the user has to browse the local machine find the image, and load the image in a database blob and also in the custom form and then finally saving the image as blob.
    Thanks in advance
    Soni

    If this helps:
    Re: Custom form: Take a file name input from user.
    Thanks
    Nagamohan

  • Uregnt - How to Load Flat File into BW-BPS using Web Browser

    Hello,
    We have followed the 'How to Load Flat File into BW-BPS using Web Browser' guide to build BSP web front-end to upload flat file.  Everything works great but we have a requirement to populate the Planning Area Variables based on BSP drop down list with values.  Does anyone know how to do this?  We have the BSP coded with drop down list all we need to do now is populate variables.  We can populate the variables through the planning level (hardcoded) but we need to populate them through the web interface.
    Thanks,
    Gary

    Hello Gary,
    We have acheived the desired result by not too a clean method but it works for us.
    What we have done is, we have the link to load file in a page where the variables can be input. The user would then have the option to choose the link to load a file for the layout in that page.
    By entering the variable values in the page, we are able to read the variables for the file input directly in the load program.
    Maybe this approach might help.
    Sunil

Maybe you are looking for

  • Folder Warning, iPod not recognized by Windows or iTunes

    Okay. My other computer froze up while the iPod was in "do not disconnect" mode, and I simply could not get it to shift out of that, so, I disconnected it. Still stuck in that mode, even after being disconnected, so I reset it (held down the menu and

  • HTTP sender adapter testing

    Hi Experts, Iam using [Posting and Testing using XI/PI HTTP Adapter|Posting and Testing using XI/PI HTTP Adapter ] code as HTTP Client When I fill all the fields, still the message is not reaching XI. I filled the data in mapping test tab of IR and g

  • Playing DVD problem's SKIPPING

    I just tried to play a DVD I get allot of skipping. Do any of you have this problem? There is nothing wrong with the DVD it is store bought not a copy and plays well in my other computer (P4 pavilion). Any ideas

  • Does SAP HANA supports JCo to call BAPI RFC's and to receive IDocs?

    Hi, We are using a WSO2 ESB to integrate our SAP 4.7 version system with SalesForce.com and as part of this integration we use JCo libraries to receive IDoc's and to execute RFC's from ESB. This year we are planning to migrate our SAP environment to

  • Direct X and X-Fi quest

    Does the X-fi need to run with DirectX 9. For instance, if your playing a game. Does the game need to be running in DX9. Thanks.