Load external XML file

I am trying to write a test program. I have a program that is
going to get it's data from an XML file when it is first loaded.
That XML file is going to be a local file that sit's in same folder
as the flex program (rather than online or through a url address).
Basically, I'm trying to find a way to open or load that file, then
parse through it and store the xml data, then close the xml file
(rather than using an rss feed). Everything I'm finding is only
telling me how to load the data in through a url address. Is there
any simple way to open a text or xml file?

i'm goign crazzzzy here.
i have a list, that reads XML.
i want that list to update on production without me having to
build the project all the time, but by just uploading a new XML
file.
i think the function i need is this:
[code]
private function LoadMyXML():void
var myXML:XML = new XML();
var XML_URL:String = "xml/AO_Other.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
function xmlLoaded(evtObj:Event)
myXML = XML(myLoader.data);
trace("Data loaded.");
[/code]
my xml looks like this:
[code]
<AO_OTHER>
<category title="Administrative Groups">
<link title="Administrative Groups" url="sadfsf"/>
</category>
<category title="AO Survey Results">
<link title="AO Survey Results" url="sdfsdf202.pdf"/>
</category>
</AO_OTHER>
[/code]
and the error i keep getting is htis:
TypeError: Error #1090: XML parser failure: element is
malformed.
at
TabTest/private:LoadMyXML/xmlLoaded()[C:\Flex\SearchTest\TabTest.mxml:25]
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
what am i doing wrong?
am i even going though this the right way?
thanks!

Similar Messages

  • Media files prevent Flash from fully loading external XML file

    Im trying to debug a flash widget we created, and it loads
    fine on the 20 odd computers we tested on EXCEPT for one computer
    where, the application doesn't load an external XML file that calls
    for 3 small mp3 files and a FLV file to load as well.
    In a debugger, we noticed that when it tried to load these
    mp3 files it was getting a Forbidden access message. The FLV just
    prevents the FLV player from showing up at all (not even the skin).
    Can anyone figure out why, that it would work over all the
    other computers and NOT the one? On that person's computer, we
    tried it in IE, Firefox, even Chrome and the application doesn't
    load. We even cleared the cache, did a hard refresh and still
    nothing.
    However, the other computers work just fine.
    ALL the computers have the latest Flash software installed.
    What could cause this problem?

    Actually what worked was removing 'xmldoc' from the php script. So $data =$GLOBALS["HTTP_RAW_POST_DATA"]; instead of $data = xmldoc($GLOBALS["HTTP_RAW_POST_DATA"]);
    Couldn't find anything about 'xmldoc'. Is it used for anything in php?
    Anyway, the loading error went away, but then I got into problems with getting the return echoed values back. The textfield stayed empty even when saving the data.txt file worked.
    I then placed the <stuff> tags between <root> tags and then flash got the sentences between the <stuff> tags back. Why does Flash need the returned xml output to be between <root> tags for it to see the content between the <stuff> tags? So why do I need to use echo("<root><stuff>Server unable to create file.</stuff></root>"); instead of cho("<stuff>Server unable to create file.</stuff>");?

  • Firefox flash plugin not loading external xml file?

    I have a Flash based website that uses an external xml file
    to load the interface and navigation. When I view the site in
    Firefox it never seems to load the xml file therefore the interface
    doesn't load.
    Any ideas?

    Hi,
    I have followed your instructions and could able to get it working for firefox. The sameway i tried with mozilla, but not working. This time, I didnt see any errors but it is not working as expected (no animations / images displayed)
    So could you please help me.
    My system config. is X86 Solaris 5.10.
    bash-3.00# pwd
    /usr/sfw/lib/mozilla/plugins
    bash-3.00# elfdump -e libflashplayer.so
    ELF Header
      ei_magic:   { 0x7f, E, L, F }
      ei_class:   ELFCLASS32          ei_data:      ELFDATA2LSB
      e_machine:  EM_386              e_version:    EV_CURRENT
      e_type:     ET_DYN
      e_flags:                     0
      e_entry:                  0x94  e_ehsize:     52  e_shstrndx:   37
      e_shoff:              0x7fb4ac  e_shentsize:  40  e_shnum:      39
      e_phoff:                  0x34  e_phentsize:  32  e_phnum:       3Thanks
    Ram.

  • How can I set connection to external XML file with Dreamweaver to buiild AIR app?

    Hello,
    I try to do simple AIR app in dreamweaver. It's not problem
    to use static data. But I'd like to use dynamic data from external
    XML file. I try to use Spry and evrything works fine in web browser
    but i have problem with loading external XML data into my app in
    AIR. Can I simply transform my spry based html app into AIR?
    What should I add to do this?
    Pawel

    Daniel Lichtenwald wrote:
    What are the requirements and steps for arranging to receive this large file using File Transfer Protocol (FTP)?
    Usually, we don't speak of "receive" when using FTP, since the file is transferred from server to client, so it's more of a case of "download".
    At your end, it's simple. You use an FTP client; under SL, that includes Finder and Safari, so you don't even need to get any additional software.
    At the other end, it's more complicated; the 'sender' must set up an FTP server on his machine.
    Alternatively, you can set up your own Mac as an FTP server, and have the 'sender' connect to you with an FTP client and upload the file; but, if your Mac lives behind a router, then you have more work to do with the router settings.
    That's why it's much easier to use the file sharing services mentioned above -- if they are available in both sender's and receiver's locations. (Keep in mind that some countries block access to all those mentioned -- except perhaps <www.transfer.ro>, of which I know absolutely nothing.)

  • Problem loading external XML

    Hi, I"m having a problem with an Applet.
    I wrote a program that acceses an external XML file located on my webspace, but when I converted this program to run in a webbrowser I get console errors when trying to acces the file.
    Here's my code:
    package javaapplication;
    import java.applet.Applet;
    import java.awt.BorderLayout;
    import java.awt.Canvas;
    import java.util.ArrayList;
    import javaapplication7.parsing.XmlParser;
    public class Main extends Applet {  
        protected Thread gameThread = null;
        private Canvas display_parent = null;
        private boolean running = false;
        private XmlParser parser = new XmlParser();
        public void destroy() {
            remove(display_parent);
            super.destroy();
            System.out.println("Clear Up");
        public void start() {
            gameThread = new Thread() {
                public void run() {
                    running = true;
                    System.out.println("Entering Gameloop");
                    gameLoop();
            gameThread.setDaemon(true);
            gameThread.start();
        public void stop() {
        public void init() {
            setLayout(new BorderLayout());
            try {
                display_parent = new Canvas() {
                    public final void removeNotify() {
                        super.removeNotify();
                display_parent.setIgnoreRepaint(true);
                display_parent.setSize(getWidth(),getHeight());
                add(display_parent);
                display_parent.setFocusable(true);
                display_parent.requestFocus();
                setVisible(true);
            catch(Exception e) {
                System.err.println(e);
                throw new RuntimeException("Unable to create display");
        private void gameLoop() {
            ArrayList <String> temp = null;
            while (running) {    
                temp = parser.SearchXml("http://users.telenet.be/decoy/FacebookApp/xml/BulletType.xml", "BulletList",2);
                for (int i=0;i<temp.size();++i) {
                    System.out.println(temp.get(i));
    }my html file :
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
      <head>
        <title>AppletLoader</title>
      </head>
      <body>
      <applet code="javaaplication.Main" archive="JavaApplication7.jar" codebase="." width="800px" height="600px">
        <!-- The following tags are mandatory -->
        <!-- Name of Applet, will be used as name of directory it is saved in, and will uniquely identify it in cache -->
        <param name="al_title" value="appletloadertest">
        <!-- Main Applet Class -->
        <param name="al_main" value="javaapplication.Main">
        <!-- logo to paint while loading, will be centered -->
        <param name="al_logo" value="appletlogo.png">
        <!-- progressbar to paint while loading. Will be painted on top of logo, width clipped to percentage done -->
        <param name="al_progressbar" value="appletprogress.gif">
        <!-- List of Jars to add to classpath -->
        <param name="al_jars" value="JavaApplication7.jar">
        <!-- signed windows natives jar in a jar -->
        <param name="al_windows" value="lib/windows_natives.jar.lzma">
        <!-- signed linux natives jar in a jar -->
        <param name="al_linux" value="lib/linux_natives.jar.lzma">
        <!-- signed mac osx natives jar in a jar -->
        <param name="al_mac" value="lib/macosx_natives.jar.lzma">
        <!-- signed solaris natives jar in a jar -->
        <param name="al_solaris" value="lib/solaris_natives.jar.lzma">
        <!-- Tags under here are optional -->
        <!-- Version of Applet, important otherwise applet won't be cached, version change will update applet, must be int or float -->
        <!-- <param name="al_version" value="0.1"> -->
        <!-- background color to paint with, defaults to white -->
        <!-- <param name="al_bgcolor" value="000000"> -->
        <!-- foreground color to paint with, defaults to black -->
        <!-- <param name="al_fgcolor" value="ffffff"> -->
        <!-- error color to paint with, defaults to red -->
        <!-- <param name="al_errorcolor" value="ff0000"> -->
        <!-- whether to run in debug mode -->
        <!-- <param name="al_debug" value="true"> -->
        <!-- whether to prepend host to cache path - defaults to true -->
        <param name="al_prepend_host" value="false">
        <!-- main applet specific params -->
        <param name="test" value="test">
      </applet>
      <p>
        if <code>al_debug</code> is true the applet will load and extract resources with a delay, to be able to see the loader process.
      </p>
      </body>
    </html>console errors :
    network: Connecting http://users.telenet.be/decoy/FacebookApp/xml/BulletType.xml with proxy=DIRECT
    network: Connecting http://users.telenet.be/crossdomain.xml with proxy=DIRECT
    network: Connecting http://users.telenet.be:80/ with proxy=DIRECT
    network: Connecting http://users.telenet.be/crossdomain.xml with cookie "__utmz=226366239.1223468593.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); st8id_wlf_%2Etelenet%2Ebe_%2F=TE5HVExNX0ZMQVNI?81c37b0684bbf41f4c42c63db814f879; __utma=226366239.605535372.1223468593.1223556298.1224764225.3"
    network: Connecting http://www.zita.be/users_error/ with proxy=DIRECT
    network: Connecting http://www.zita.be:80/ with proxy=DIRECT
    java.security.PrivilegedActionException: java.io.FileNotFoundException: http://www.zita.be/users_error/
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sun.deploy.net.CrossDomainXML.check(Unknown Source)
         at com.sun.deploy.net.CrossDomainXML.check(Unknown Source)
         at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.http.HttpClient.<init>(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.http.HttpClient.New(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.URL.openStream(Unknown Source)
         at facebookgame.parsing.XmlParser.SearchXml(XmlParser.java:38)
         at facebookgame.entity.ShotEntity.<init>(ShotEntity.java:62)
         at facebookgame.InGameState.Enter(InGameState.java:75)
         at facebookgame.FacebookApp.changeToState(FacebookApp.java:258)
         at facebookgame.MenuState.CheckPlayerInput(MenuState.java:106)
         at facebookgame.MenuState.StateCycle(MenuState.java:139)
         at facebookgame.FacebookApp.gameLoop(FacebookApp.java:212)
         at facebookgame.FacebookApp.access$200(FacebookApp.java:17)
         at facebookgame.FacebookApp$1.run(FacebookApp.java:60)
    Caused by: java.io.FileNotFoundException: http://www.zita.be/users_error/
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at com.sun.deploy.net.CrossDomainXML$2.run(Unknown Source)
         ... 22 moreHopefully some1 can help me :).
    Edited by: Veko on Dec 7, 2008 2:51 PM

    But why is it possible then to succesfully acces the .xml file with a non-web applet
    This code reads the file perfectly of my webspace...
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.net.URL;
    public class XMLHandler {
         public static void SearchXml(){
            try{
                InputStream filesource = new URL("http://users.telenet.be/decoy/FacebookApp/xml/BulletType.xml").openStream();
                System.out.println("found input source");
                byte[] readIn = new byte[8];
                int bytesRead = filesource.read(readIn);
                OutputStream stream = System.out;
                while(bytesRead != -1){
                     stream.write(readIn);
                     bytesRead = filesource.read(readIn);
            } catch (Exception e){
                e.printStackTrace();
         public static void main(String[] args){
              SearchXml();
    }it returns the contents of the xml perfectly
    <?xml version="1.0"?>
    <bulletList>
    <bullet type="1">
         <speed>1.0f</speed>
         <size>O.65f</size>
         <damage>1</damage>
         <texture>"res/shot.png"</texture>
         <sound>"blah.ogg"</sound>
    </bullet>
    <bullet type="2">
         <speed>1.5f</speed>
         <size>O.65f</size>
         <damage>1</damage>
         <texture>"res/shot.png"</texture>
         <sound>"blah.ogg"</sound>
    </bullet>
    </bulletList>Does a applet in a browser have somekind of weird restriction that I haven't heard of yet ?
    Edited by: Veko on Dec 8, 2008 2:28 AM
    Edited by: Veko on Dec 8, 2008 2:29 AM
    Edited by: Veko on Dec 8, 2008 2:29 AM

  • Performance problems loading an XML file into oracle database

    Hello ODI Guru's,
    I am trying to load and XML file into the database after doing simple business validations. But the interface takes hours to complete.
    1. The XML files are large in size >200 Mb. We have an XSD file for the schema definition instead of a DTD.
    2. We used the external database feature for loading these files in database.
    The following configuration was used in the XML Data Server:
    jdbc:snps:xml?f=D:\CustomerMasterData1\CustomerMasterInitialLoad1.xml&d=D:\CustomerMasterData1\CustomerMasterInitialLoad1.xsd&re=initialLoad&s=CM&db_props=oracle&ro=true
    3. Now we reverse engineer the XML files and created models using ODI Designer
    4. Similar thing was done for the target i.e. an Oracle database table as well.
    5. Next we created a simple interface with one-to-one mapping from the XSD schema to the Oracle database table and executed the interface. This execution takes more than one hour to complete.
    6. We are running ODI client on Windows XP Professional SP2.
    7. The Oracle database server(Oracle 10g 10.2.0.3) for the target schema as well as the ODI master and work repositories are on the same machine.
    8. I tried changing the following properties but it is not making much visible difference:
    use_prepared_statements=Y
    use_batch_update=Y
    batch_update_size=510
    commit_periodically=Y
    num_inserts_before_commit=30000
    I have another problem that when I set batch_update_size to value greater that 510 I get the following error:
    java.sql.SQLException: class org.xml.sax.SAXException
    class java.lang.ArrayIndexOutOfBoundsException said -32413
    at com.sunopsis.jdbc.driver.xml.v.a(v.java)
    The main concern is why should the interface taking so long to execute.
    Please send suggestions to resolve the problem.
    Thanks in advance,
    Best Regards,
    Nikunj

    Approximately how many rows are you trying to insert?
    One of the techniques which I found improved performance for this scenario was to extract from the xml to a flat file, then to use SQL*LOADER or external tables to load the data into Oracle.

  • Trouble with loading external mp3 files

    I apologize for the length of the post. I hope this is clear
    of what I am trying to explain.
    My problem deals with getting "undefined" when I press a
    button to load an external mp3 files. The following is what my XML
    childNode looks like:
    <option phonetic="Soundless, or A" name="aleph"
    cursive="alephCursive.swf" block="alephBlock.swf"
    audio="char1.mp3"/>
    Every attribute loads the way I've programmed them, except
    for the last one "audio".
    The following is what my actionscript looks like loading in
    these attributes:
    Everything is happening inside the onLoad event for my XML
    file.
    var xmlContent = this.firstChild.firstChild;
    audioContent = new Array();
    for (var i = 0;
    i<this.firstChild.firstChild.childNodes.length; i++) {
    nextEntry = xmlContent.childNodes
    audioContent = [nextEntry.attributes.phonetic,
    nextEntry.attributes.name, nextEntry.attributes.cursive,
    extEntry.attributes.block, nextEntry.attributes.audio];
    The code above simply adds each attribute to the audioContent
    array. Each element traces out correctly.
    The following code is how I am using these attributes:
    for (var i = 0; i<audioLength; i++) {
    audioContainer.attachMovie("container4", "audioItem"+i, i);
    // Create a shortcut reference to the present movie clip
    thisClip = audioContainer["audioItem"+i];
    thisClip.myTxt1.htmlText = audioContent[0];
    thisClip.myTxt2.htmlText = audioContent
    [1];
    thisClip.cursive_mc =
    loadThis(assetPath+audioContent[2], thisClip.cursive_mc);
    thisClip.block_mc = loadThis(assetPath+audioContent
    [3], thisClip.block_mc);
    thisClip.speaker_mc.attachMovie("speaker", "speaker_mc",
    this.getNextHighestDepth());
    thisClip.speaker_mc.speaker_mc.onRollOver = function() {
    this.nextFrame();
    thisClip.speaker_mc.speaker_mc.onRollOut = function() {
    this.prevFrame();
    thisClip.speaker_mc.speaker_mc.onRelease = function() {
    mySnd.loadSound(audioPath+audioContent[4],true);
    Loading the text works inside the htmlText. Using a function
    loadThis to load external swf files works corerctly and even
    attaching a linked movieclip from my library called "speaker" works
    correctly.
    The problem comes from pressing the speaker movieclip that
    the output traces "undefined" instead of the external mp3 file.
    I appreciate any help. Thanks.

    As Ned said the problem might be with the file structure on the server. Other problems may be with spelling. You computer may not be case sensitive to the names of the .swf files that you are loading, but your server might. So, on your computer when you are testing, second.swf is the same as Second.swf, or even second.SWF. But, on the server each of these variations is seen as a different file. Another problem is that when you are loading files from the same computer in testing, those files are close and so they load very quickly from your computer. When the files have to travel from the server, there will likely be a measurable period of time before the file is ready to be shown. This is particularly problematic with video that is embedded into an .swf. The whole file will need to be downloaded and uncompressed before it is available to play. If you stream the video as an external file, you can shorten the wait considerably.

  • Loading external XML data into XMLObject

    hey all,
    i've been working on a basic fl2 app that generates a list of
    posts from an external XML file located on my server
    (www.omedia.mobi/forum.xml) The swf file is also located there in
    the same directory .(crime.swf).
    The app runs fine in the emulator, both when i tried to load
    the data locally on my mac, and when i load it from the server. But
    when i put the swf file on my N70, it fails to load the data.
    I'm banging my head against a wall trying to get this sorted.
    has anyone had any similar experiences?
    any help would be apprieciated...
    many thanks
    Matt

    Matt–
    Dumb question, are you 100% sure that your phone is making
    any connection to the internet? Does your phone read a name/value
    variable from an external file?
    I just build a file to test this (It won't work
    online—it will only work on a phone.):
    http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.swf
    The FLA is also up:
    http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.fla
    Also, you can check out:
    http://www.adobe.com/devnet/devices/articles/flashlite11_rss.html
    quote:
    //Some of the code from the FLA:
    canLoad = _capLoadData;
    if (canLoad == 1) {
    urlPath = "
    http://punchkickinteractive.com/development/mobileConnectionTest/mobileConnection.txt";
    loadVariables(urlPath, _root);
    } else {
    connection = "client does not support loading dynamic data";
    // where "connection" is the variable name of the text field
    If the connection is present, then I think I know what is
    wrong. Let me know.

  • How to import external XML file

    Hello guys:
    From this demo
    http://www.adobe.com/devnet/flex/quickstart/accessing_xml_data/#section2
    we know how to use a intrernal XML document. I know there are
    several way to load a external XML like:
    <mx:HTTPService
    id="loadTest"
    useProxy="false"
    showBusyCursor="true"
    resultFormat="xml"
    url="data/login.xml"
    />
    What I want to know is whether I could load a XML file
    directly, not use HTTPService and send. For a instance:
    [Bindable]
    private var login:XML = ("data/login.xml");
    or something like that. And then I could use login.user or
    login. pass .
    Now seems it is easy to control a intrernal XML data. I want
    to import a external XML file and use it like a intrernal XML.
    Thanks a lot

    You only have 2 choices: include the XML as part of the SWF
    using <mx:XML source="filename.xml" /> or load it dynamically
    using a data service such as HTTPService.

  • 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;

  • Help Required on Reading an External XML file in flex

    Hi Experts
    I want some help regarding flex.
    I want to read an external xml file in flex and want to show
    different datas in different components
    So bacically i need what is the procedure to call an external
    xml file and the procedure to catch the value of the xml tags and
    the option (options means ex: "id" or "type inside" "row" tag ) in
    side the xml file.
    Here is My xml file named "skn_organ.xml"
    <?xml version="1.0" encoding="UTF-8"?>
    <slide>
    <r>7</r>
    <c>8</c>
    <row id="A01" type="g">
    <organ>Skn</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A02" type="g">
    <organ>Brt</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A03" type="g">
    <organ>Spl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A04" type="g">
    <organ>Lnode</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A05" type="g">
    <organ>Ske</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A06" type="g">
    <organ>Lun</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A07" type="g">
    <organ>Sgl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="A08" type="g">
    <organ>Liv</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B01" type="g">
    <organ>Gal</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B02" type="g">
    <organ>Pan</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B03" type="g">
    <organ>Ton</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B04" type="g">
    <organ>Eso</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B05" type="g">
    <organ>Sto</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B06" type="g">
    <organ>Sto</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B07" type="g">
    <organ>Sbl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="B08" type="g">
    <organ>Col</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C01" type="g">
    <organ>Skn</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C02" type="g">
    <organ>Brt</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C03" type="g">
    <organ>Spl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C04" type="g">
    <organ>Lnode</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C05" type="g">
    <organ>Ske</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C06" type="g">
    <organ>Lun</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C07" type="g">
    <organ>Sgl</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="C08" type="g">
    <organ>Liv</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="D01" type="g">
    <organ>Gal</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="D02" type="g">
    <organ>Pan</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    <row id="D03" type="g">
    <organ>Ton</organ>
    <link>
    http://www.designgarbage.com</link>
    </row>
    </slide>

    Hi sanjivsutar,
    Put your xml file under folder "assets", the application demo
    is as following
    ====================================================================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    initialize="init()">
    <mx:Script>
    <![CDATA[
    private var mainXML:XML;
    private var loader:URLLoader;
    private function init():void {
    loader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, onComplete);
    loader.load(new URLRequest('assets/skn_organ.xml'));
    private function onComplete(evt:Event):void {
    mainXML = new XML(loader.data)
    out.text += "xml loaded, using E4X syntax: \n\n";
    out.text += "Row 1: "+mainXML.row[0]+"\n"
    out.text += "Row 6: organ = "+mainXML.row[5].organ+"\n"
    out.text += "Row(id='D02'): link =
    "+mainXML.row.(@id=="D02").link+"\n"
    ]]>
    </mx:Script>
    <mx:TextArea id="out" width="400" height="300"/>
    </mx:Application>
    ======================================================================
    Jeffrey

  • Load external xml

    I have an application which uses an external xml file (on
    another site). I get the data from the xml file. When I run my
    application local, it works perfectly.
    Although, when I run my application on my server, the xml
    just won't load. Can anyone help me on this matter?
    Greets

    "Francisc Romano" <[email protected]> wrote
    in message
    news:gh40j6$cj6$[email protected]..
    > Aha, ok!
    > Your problem is the fact that you address the XML
    remotely...
    > It is a security problem:
    > If the XML is on your server reference it relatively to
    the swf file. e.g.
    > "assets/burners.xml" or if in the same folder
    "burners.xml".
    >
    > If however it is on a different server, you need to
    workout the security
    > issues.
    It's actually a sandbox issue. But close...

  • 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:

  • XML Parse error while loading an XML file

    HI Folks,
    I was trying to load and XML file into BODS.. The XML file is well-formed and the same when tested in other tools  is getting loaded without any issues..
    I have created a XML-File format with the corresponding XSD..
    But here in BODS it is giving - Parse error
    1) when i try to view the data of the source XML in my dataflow ..it is giving "XML Parser Failed".. and not able to show data..
    2) When I run my job i get the same pares error - with details as under..
    ---> Error here is "Unable to recognize element 'TAB' " or some time is say " Element TAB should be qualified"
    Please guide with this if you have any info..thanks
    I'm pasting the XML source file format here for your reference:--
      <?xml version="1.0" encoding="iso-8859-1" ?>
    - <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
    - <asx:values>
    - <TAB>
    - <items>
    + <CUSTOMER_RECORD>
      <CUSTOMER_NUMBER>1111111111</CUSTOMER_NUMBER>
      <NAME_1>ABC</NAME_1>
      <NAME_2>OFM/COMMERCIAL ACCOUNTS</NAME_2>
      <STREET_1>31 CENTER DRIVE MCS2045</STREET_1>
      <STREET_2 />
      <CITY>BETHESDA</CITY>
      <STATE_CODE>MD</STATE_CODE>
      <POSTAL_CODE>20892-2045</POSTAL_CODE>
      <COUNTRY_CODE>US</COUNTRY_CODE>
      <ORDER_BLOCK />
      <ERP_CREATE_DATE>20040610</ERP_CREATE_DATE>
      <ERP_CREATED_BY>DGUPTA</ERP_CREATED_BY>
      <ERP_MODIFY_DATE>20120201</ERP_MODIFY_DATE>
      <ERP_MODIFIED_BY>LWOHLFEI</ERP_MODIFIED_BY>
      <INDUSTRY_CODE>0103</INDUSTRY_CODE>
      <ACCOUNT_GROUP_ID>0001</ACCOUNT_GROUP_ID>
      <SALES_NOTE />
      <ADDRESS_NOTE />
      <CUSTOMER_CLASSIFICATION_CODE>02</CUSTOMER_CLASSIFICATION_CODE>
      <GLN_NUMBER />
      <PREVIOUS_ACCT_NO />
      <ACCOUNT_TYPE />
      <GAG />
      <SDI_ID />
      <HOSP_ID />
      <HIN />
      <DUNS />
      <PO_BOX />
      <POB_CITY />
      <POB_ZIP />
      <PHONE_NUMBER>77777</PHONE_NUMBER>
      <EMAIL_DOMAIN />
      <REQUESTER />
      <ERP_SOURCE_SYSTEM>ECC</ERP_SOURCE_SYSTEM>
      </CUSTOMER_RECORD>
    - <SALES_ORG_DATA>
    + <item>
      <CUSTOMER_NUMBER>1111111111</CUSTOMER_NUMBER>
      <SALES_ORG>0130</SALES_ORG>
      <CUSTOMER_GROUP>03</CUSTOMER_GROUP>
      <ORDER_BLOCK_CODE />
      <ERP_SOURCE_SYSTEM>ECC</ERP_SOURCE_SYSTEM>
      </item>
    + <item>
      <CUSTOMER_NUMBER>1111111111</CUSTOMER_NUMBER>
      <SALES_ORG>0120</SALES_ORG>
      <CUSTOMER_GROUP>11</CUSTOMER_GROUP>
      <ORDER_BLOCK_CODE />
      <ERP_SOURCE_SYSTEM>ECC</ERP_SOURCE_SYSTEM>
      </item>
      </SALES_ORG_DATA>
      </items>
      </TAB>
      </asx:values>
      </asx:abap>

    Pierre,
    Depending on the object "myLastFile", the method openDlg might not even exist (if the myLastFile object is not a File object, for instance). And I do not see any need for the myLastFile anyhow, as you are presenting a dialog to select a file to open. I recommend using the global ChooseFile( ) method instead. This will give you a filename as string in full path notation, or null when no file was selected in the dialog. I am not sure what your ExtendScript documentation states about the return value for ChooseFile, but if that differs from what I am telling you here, the documentation is wrong. So, if you replace the first lines of your code with the following it should work:
    function openXMLFile ( ) {
        var filename = ChooseFile ( "Choose XML file ...", "", "*.xml", Constants.FV_ChooseSelect );
    While writing this, I see that Russ has already given you the same advice. Use the symbolic constant value I indicated to use the ChooseFile dialog to select a single file (it can also be used to select a directory or open a file - but you want to control the opening process yourself). Note that this method allows you to set a start directory for the dialog (second parameter). The ESTK autocompletion also gives you a fifth parameter "helplink" which is undocumented and can safely be ignored.
    Good luck
    Jang

  • How to load a XML file into a table using PL/SQL

    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.

    ODI_NewUser wrote:
    Hi Guru,
    I have a requirement, that i have to create a procedure or a package in PL/SQL to load  XML file into a table.
    How we can achive this.
    Not a perfectly framed question. How do you want to load the XML file? Hoping you want to parse the xml file and load it into a table you can do this.
    This is the xml file
    karthick% cat emp_details.xml
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
      <EMPNO>7782</EMPNO>
      <ENAME>CLARK</ENAME>
      <JOB>MANAGER</JOB>
      <MGR>7839</MGR>
      <HIREDATE>09-JUN-1981</HIREDATE>
      <SAL>2450</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    <ROW>
      <EMPNO>7839</EMPNO>
      <ENAME>KING</ENAME>
      <JOB>PRESIDENT</JOB>
      <HIREDATE>17-NOV-1981</HIREDATE>
      <SAL>5000</SAL>
      <COM>0</COM>
      <DEPTNO>10</DEPTNO>
    </ROW>
    </ROWSET>
    You can write a query like this.
    SQL> select *
      2    from xmltable
      3         (
      4            '/ROWSET/ROW'  passing xmltype
      5            (
      6                 bfilename('SDAARBORDIRLOG', 'emp_details.xml')
      7               , nls_charset_id('AL32UTF8')
      8            )
      9            columns empno    number      path 'EMPNO'
    10                  , ename    varchar2(6) path 'ENAME'
    11                  , job      varchar2(9) path 'JOB'
    12                  , mgr      number      path 'MGR'
    13                  , hiredate varchar2(20)path 'HIREDATE'
    14                  , sal      number      path 'SAL'
    15                  , com      number      path 'COM'
    16                  , deptno   number      path 'DEPTNO'
    17         );
         EMPNO ENAME  JOB              MGR HIREDATE                    SAL        COM     DEPTNO
          7782 CLARK  MANAGER         7839 09-JUN-1981                2450          0         10
          7839 KING   PRESIDENT            17-NOV-1981                5000          0         10
    SQL>

Maybe you are looking for

  • I havent had itunes for a month because...

    itunes wont open EVEN when itunes AND quicktime are installed and updated! it pops up with something that says "iTunes has encountered a problem and needs to close. We are sorry for the inconvenience." im really getting mad because i keep installing

  • Videos Destroy HDD?????

    I have an ipod video and latest itunes. I was using ipodmini+itunes since the release of the mini, never had any issues. Now with the new video ipod I can't use any video functionality... heres whats happened: Sync ipod with library via itunes- all g

  • How to replace line break for comma

    Hi there, i have a string which is like header1,value1,header2,value2,header3,value3,header4,value4now i have to write the above string to a file which should be like file.txt should be header1,value1 header2,value2 header3,value3 header4,value4i can

  • Ow do I keep the slideshow settings window from popping up?

    every time I start a slideshow in iPhoto 7.1.1, the slideshow settings window keeps on popping up, even if I save the display and music settings. This is useless and annoying. Where do I change the settings such that I am not asked about the slidesho

  • Since the Version 20.0 update when starting firefox I have frequently got the error message "firefox is having trouble your windows and tabs" .

    Since the version 20.0 update when starting firefox I have frequently got the error message "firefox is having trouble recovering your windows and tabs" This has not occurred with previous versions. If I click on the box "restore" and close firefox t