How reference/read an XML file?

Instead of the inline XML content, pls see code below, thank you.

<? XML version = "1.0"? >
<!-dpcontrols / DataGridSimple.mxml->
"< mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml" > "
<!--
< mx:XMLList id = "employees" >
< employee >
< name > Christina Coenraets < / name >
555-219-2270 < phone > < / phone >
< email > [email protected] < / email >
true < current > < / current >
< notes >
Christina is a hot chic.
< / notes >
< / employee >
< employee >
< name > Joanne Wall < / name >
555-219-2012 < phone > < / phone >
< email > [email protected] < / email >
true < current > < / current >
< notes >
What a and b!
< / notes >
< / employee >
< employee >
< name > Maurice Smith < / name >
555-219-2012 < phone > < / phone >
< email > [email protected] < / email >
< active > false < / current >
< notes >
Just a pimp.
< / notes >
< / employee >
< employee >
< name > Mary Jones < / name >
555-219-2000 < phone > < / phone >
< email > [email protected] < / email >
true < current > < / current >
< notes >
Mary, Mary, Mary
< / notes >
< / employee >
< / mx:XMLList >
->
< mx:Panel title = "DataGrid Control Example" height = "100%" width = "100%".
paddingTop = "10" paddingLeft = "10" paddingRight = "10" >

< mx:Label width = '100% ', color = 'blue '.
Text = "Select a row in the DataGrid control" / >

<!-old reference inline, dataProvider = {employees}->
{< mx:DataGrid id = "dg" width = "100%" height = "100%" rowCount = "5" dataProvider="{C:\ColdFusion8\wwwroot\Flex\employees.xml}" > "
<!-this above dataProvider reference will not work, how? ->
< mx:columns >
< mx:DataGridColumn dataField = "name" headerText = "Name" / >
< mx:DataGridColumn dataField = "phone" headerText = "Phone" / >
< mx:DataGridColumn dataField = "email" headerText = "Email" / >
< / mx:columns >
< / mx:DataGrid >

< mx:Form width = '100 percent"height ="100% ">
< mx:FormItem label = "Name" >
< mx:Label text="{dg.selectedItem.name}"/ >
< / mx:FormItem >
< mx:FormItem label = "Email" >
< mx:Label text="{dg.selectedItem.email}"/ >
< / mx:FormItem >
< mx:FormItem label = 'Phone' >
< mx:Label text="{dg.selectedItem.phone}"/ >
< / mx:FormItem >
< mx:FormItem label = 'Notes' >
< mx:Label text="{dg.selectedItem.notes}"/ >
< / mx:FormItem >
< / mx:Form >

< / mx:Panel >

< / mx:Application >

in DataGrid dataProvider attribute does not point to a file. He uses (I think) E4X to set a path to a data provider (i.e. HTTPService). You need to access the XML file using a provider of data first and then use this reference to access the data of the element in the document through the dataProvider.

Hope that helps a little.

Tags: Flex

Similar Questions

  • OSB: How to read the xml file, which is in OSB project

    Hello

    We have a generic proxy (PG1) reporting and deals alerts, this proxy is called in the pipelines of proxies anothers (P1... PN) in several projects. Each client proxy (P1... PN) PN) before call proxy PG1, configures a variable with syntactic alert or report.

    We thought it would be a good idea to store the specifications for all the proxies of a project as an xml file, so that the proxy PG could read the xml file. This file will be in the OSB project.

    The questions are:
    -proxy can read a xml file that is in the OSB project?
    S ' Please, are all the documentation for this?

    Thank you

    Kind regards

    You can always do customization to work with the properties defined in a XML xquery. The key to this is to use the customization of reference instead of find and replace the customization, similar to the service account customizations.
    Keep your real estate to as properties_dev of env xquery specific xmls, properties_sit etc then apply customization of service proxy xquery reference reference specific correct env.

  • How to open an XML file in Adobe Reader on a form created in LiveCycle ES2

    I need help to conversion or reading an XML file, I had sent me a form I created in Adobe LiveCycle ES2 without using Office Suite complete Adobe (I think that if I have any other programs, I wouldn't have to have additional permissions to see what I could create, don't you think?).  I'm looking to display the form in Reader or Acrobat or even in LiveCycle itself, and the course of my research I've just been hitting brick walls.  Any help out there?

    If it is Acrobat X or more later, click on tools and go to the forms section. Perhaps more Options - form data management - Import.

  • How to read report .xml to a printer?

    How to read the .xml report that is sent by e-mail?  You open the file with something?

    Use the player to open the file. The report should be readable on the side of keft.

  • Reading an XML file and write the content in another file xml in java

    Hello

    I'm new to xml parsing. My requirement is that I get a message (xml) using ibm MQ in the ByteArrayInputStream format. I read this xml message and write to another file.

    To do this, I create a CEP.

    First of all, I used simple reading and writing concept, but the output is "java.io.FileInputStream@3e25a5".
    Example of xml file
    -< customer >
    < > 1234 ClientId < / ClientId >
    STechnology < ClientName > < / ClientName >
    < DTU_ID > 567 < / DTU_ID >
    < ClientStatus > ACTIVE < / ClientStatus >
    -< LEAccount >
    < Customer > 678989 < / customer >
    < > 56743 LEId < / LEId >
    -< account >
    < AccountNumber > 9876543678 < / account number >
    < / account >
    < / LEAccount >
    -< Service >
    Y2Y < Cindicator > < / Cindicator >
    < PrefCode > 980 < / PrefCode >
    < BSCode > 876 < / BSCode >
    < MandatoryContent > MSP < / MandatoryContent >
    < / service >
    < / customer >

    Code:


    import java.io.ByteArrayInputStream;
    import java.io.FileInputStream;
    to import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;

    public class ByteArrayInputStreamToXml {}

    Public Shared Sub main (String [] GIS) throws IOException {}

    InputStream inputStream = new FileInputStream("C:\\soft\\test2\\sample1.xml");
    currentXMLBytes Byte = inputStream.toString () .getBytes ();
    ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream (currentXMLBytes);

    OutputStream out = new FileOutputStream("C:\\soft\\test\\data.xml");
    int read = 0;
    ubyte bytes [] = new byte [1024];

    While ((read = byteArrayInputStream.read (bytes))! = - 1) {}
    out. Write (bytes, 0, read);
    out. Write ("\n");
    }

    inputStream.close ();
    out. Flush();
    out. Close();

    System.out.println ("new file created!");

    }

    }

    Please suggest me how can I use DOM/SAX parser, I see several code on the net to read the xml file using SAX/DOM parser, but write an xml file after reading using ByteArrayInputStream I don't get. Assistance through some link examples will also be useful for me.

    Thank you
    Sumit

    Published by: user8687839 on April 30, 2012 02:37

    Published by: user8687839 on April 30, 2012 02:43

    user8687839 wrote:
    But the file is coming thanks to a queue and byte format. Must read the byte, and write to a file. So, how I tried to read the byte using the code above. Please suggest me the correct way.

    Simply write the bytes of the contents of the queue directly to a FileOutputStream. Still no need to SAX or DOM!

    Pseudo-code-

    Open a FileOutputStream .
    
    Until all the bytes of the queue have been read
        read some bytes from the queue.
        wite these bytes to the FileOutputStream.
    
    Close the FileOutputStream.
    

    Published by: sabre150 on April 30, 2012 11:30

  • How to read the xml and save the contents of the ITA in .txt format

    Hello

    Is it possible to read an xml file and save it in the .txt format. Please let me know if there is a way to do it.

    Thank you

    Ankit G

    That read the function is only for xml files written using the LabVIEW diagram, so if you have something else, you need the functions in the range of xml parser.

  • How can I save xml file n, run the xml file? Please help me

    How can I save xml file n, run the xml file? Please help me

    Hello

    The question you have posted will be well suited in the MSDN forum. Click on the link below.

    http://social.msdn.Microsoft.com/forums/en/categories/

    In the meantime, I suggest you to return the item mentioned below.

    How to use XML Notepad to create an XML document

    http://support.Microsoft.com/kb/296560

  • I am running Windows 7. How to read a MDI file?

    I am running Windows 7. How to read a MDI file

    See http://office.microsoft.com/en-us/help/HP062193601033.aspx Security Microsoft MVP, 2004-2009

  • How to read an XML in Jet?

    I'm reading an xml file and then display the content in a table, I almost work, but something is wrong with the timing of the process (it seems to me read that xml will take place no later then the binding).

    Any help will be much appreciated. The xml I want to read can be downloaded here.

    HTML code:

    <! DOCTYPE html >

    < the table id = "table2" summary = "Album list" aria-label = "Table of the Album."

    link data = "ojComponent: {component:"ojTable"}"

    data: data source,.

    columnsDefault: {sortable: 'none'},

    columns: [{headerText: 'Id'}]

    {field: 'id'},

    {headerText: "Artist",}

    {field: 'artist'},

    {headerText: 'Title',}

    {[{scope: 'title'}]} ">"

    < /table >

    JavaScript code:

    deptArray = new Array();

    require ([' OJ/ojcore', 'knockout', 'jquery', ' OJ/ojknockout', 'promise', ' OJ/ojtable'],)

    function (JO, ko, $)

    {

    function viewModel()

    {

    loadXMLDoc();

    Alert('test:'+deptArray.Length);

    var self = this;

    deptArray = [{id: 1, artist: 'a', title: 'b'}];

    deptArray.push ({id: 2, artist: "c", title: "d"});

    Alert('test:'+deptArray[0].) Artist);

    Self.DataSource = new JO. ArrayTableDataSource (deptArray, {idAttribute: 'id'});

    }

    var vm = New viewModel;

    $(document) .ready

    (

    function()

    {

    Alert ('start');

    ko.cleanNode ($('#table2') [0]);

    ko.applyBindings (vm, document.getElementById ('table2'));

    Alert ('end');

    }

    );

    });

    function {} loadXMLDoc()

    var XMLHTTP = new XMLHttpRequest();

    XMLHTTP.onreadystatechange = function() {}

    If (xmlhttp.readyState == 4 & & xmlhttp.status == 200) {}

    myFunction (xmlhttp);

    }

    };

    XMLHTTP. Open ("GET", "cd_catalog.xml", true);

    XMLHTTP. Send();

    Alert('loadxmldoc:'+deptArray.Length);

    }

    Function myFunction (xml) {}

    var i;

    var xmlDoc = xml.responseXML;

    var l_artist;

    var l_title;

    var x = xmlDoc.getElementsByTagName ("CD");

    for (i = 0; i < x.length; i ++) {}

    l_artist = x [i] .getElementsByTagName ("ARTIST") [0] Sublst.ChildNodes(1).ChildNodes(0) [0] .nodeValue;

    l_title = x [i] .getElementsByTagName ("TITLE") [0] Sublst.ChildNodes(1).ChildNodes(0) [0] .nodeValue;

    If (I = 0) {}

    deptArray = [{id: i, artist: l_artist, title: l_title}];

    } else {}

    deptArray.push ({id: i, artist: l_artist, title: l_title});

    }

    }

    Alert('myFunction:'+deptArray.Length);

    }

    I hope this helps you: https://blogs.oracle.com/geertjan/entry/reading_xml_in_oracle_jet

  • How to load an XML file for salesforce using API BULK?

    Hello

    Please let me know how to download an XML file for salesforce using API bulk?

    Thank you

    AND

    Hello

    I think it's a matter of SalesForce.com more and think that you will have better luck in looking at SOAP API Developer Guide for salesforce. Sending of a server API SOAP request is very straight forward and there are several tutorials and well documented in this topic.

    See you soon,.

    Stefan

  • How to analyze an XML file in illustrator plugin?

    My current task is this: Open the file system xml file (later it is a remote service), parse the xml code, display the contents of an XML to the user. After that, there are other measures, but I'm stuck at the first step itself. What Illustrator plugin sdk API let me parse xml and create a dom out of it? Thanks in advance.

    Version: Illustrator CS 5.1

    Are not XML parsing API in the SDK of Illustrator. They have a suite of XML - ish, but it's for the management of metadata of a document, which - at least through the API - looks & feels like XML.

    If you want to analyze & read an XML file, there are many other libraries, that you can use to do. We use Xerces, which is one of the most widely used XML libraries.

  • Need help to read the xml file and place it in a table.

    Nice day!

    Here is the configuration. I have a xml file from another source which will call a stored procedure in my database (which I am supposed to create). This is a first for me, I've never done development pl/sql or worked with xml. :(

    That's what I hoped to accomplish, if there is a better way, that I am open to him.
    In short, to have a stored procedure that takes the xml file (transmitted by third parties via the call, no url must be a file), creates a temporary table and populates the two columns needed. Then, the SP will make a select join with the temporary table and other data available in another schema. Once the completed table selection will be truncated and dropped. SP farm.

    Details:
    DB: Oracle 11.2.0.1 RAC.
    Charset: AL32UTF8
    Example of XML: (nearly 10,000 lines like this in production)
    "< MerchantID report =" "#" name = 'Conversion detail report' ReportStartDate = '2011-09-27 12:00:00GMT' ReportEndDate = '2011-09-27 21:38:13GMT"Version ="1.1"> < Conversion = '1234567891234567 D' MerchantReferenceNumber Convertingdate =" 2011-09-27 13:39:02 "RequestID ="1234567891234567891234"> < OriginalDecision > REVIEW < / OriginalDecision > < NewDecision > ACCEPT < / NewDecision > < Reviewer > testusr < / examiner > < ReviewerComments > no reason to reject. < / ReviewerComments > < Notes > < Note Date = "2011-09-27 13:39:02" AddedBy = "testusr" comment = "Took possession" / > < / Notes > < queue > Digital Review < / queue > < profile > Digital orders QA < / profile > < / Conversion > "
    ...
    < / report >

    What I tried.
    I found a tutorial: http://it.toolbox.com/blogs/oracle-guide/oracle-and-xml-in-action-a-real-world-example-5319 I tried and was able to make it work. But I could not duplicate the results with my xml file. So I looked away and have had no success. :( I'm not a developer, so I'm really bad...

    I found a note of support: (how to load an XML file into a Database Table using DBMS_XMLSave unaided Bfile [227476.1 ID]) and couldn't make it work.

    I found some online then Odie son xml and tried these but slipped and couldn't get my versions of these great answers to work for me.

    Then... I'm here now and hoping that someone could walk me through this.


    I tinkered this SP (it doesn't have to be that way, the suggestions are greatly appreciated)

    create or replace procedure xml_to_table (call_1 call_2) as

    Start
    run immediately "CREATE GLOBAL TEMPORARY TABLE XMLType IMRPT
    --(clé primaire contrainte-imrpt_pk (MerchantReferenceNumber))
    XmlType store as xml binary basicfile
    -(high compression)
    virtual columns
    (MerchantReferenceNumber as (xmlcast (xmlquery ('/ Conversion/MerchantReferenceNumber ' from object_value content back) as VARCHAR2 (32))))
    , NewDecision as (xmlcast (xmlquery ('/ Conversion/NewDecision ' from object_value content back) as VARCHAR2 (10)))
    )
    -ON COMMIT PRESERVE ROWS

    run immediately 'save xml as a file on the local system?'

    insert into IMRPT (MerchantReferenceNumber, NewDecision)

    run immediately "join select statement.
    run immediately 'truncate table IMRPT.
    run immediately "drop table IMRTP.

    end;
    /

    On my last test, I tried to select just in the xml file using this:

    DECLARE
    indomdoc DBMS_XMLDOM. DOMDocument;
    innode DBMS_XMLDOM. DOMNode;
    myParser DBMS_XMLPARSER.parser;
    buf VARCHAR2 (2000);
    BEGIN
    myParser: = DBMS_XMLPARSER.newParser;

    DBMS_XMLPARSER.setBaseDir (myparser, 'XML_DIR');
    DBMS_XMLPARSER. Parse (myParser, "test.xml");

    indomdoc: = DBMS_XMLPARSER.getDocument (myParser);

    -just to test content
    innode: = DBMS_XMLDOM.makeNode (indomdoc);
    DBMS_XMLDOM.writeToBuffer (innode, buf);
    Dbms_output.put_line (BUF);

    dbms_xmldom.freeDocument (indomdoc);
    dbms_xmlparser.freeParser (myParser);
    END;
    /

    It was another accident and burn.

    Any help would be appreciated.

    Thank you

    Like I said:

    Here is an example using a REF CURSOR variable ( you will need to declare a plus for your actual procedure )

    Your procedure has two parameters, you must declare two variables to hold the two REF CURSOR ;)

    DECLARE
    
      v_filename      VARCHAR2(50) := 'DMReport.xml';
      v_rc1            SYS_REFCURSOR;
      v_rc2            SYS_REFCURSOR;
    
      v_order_name       VARCHAR2(100);
      v_reason_text      VARCHAR2(100);
    
    BEGIN
    
      xml2table(v_filename, v_rc1, v_rc2);
    
      commit;
    
      loop
        fetch v_rc1 into v_order_name;
        exit when v_rc1%notfound;
        dbms_output.put_line('ORDER_NAME='||v_order_name);
      end loop;
    
      close v_rc1;
    
      loop
        fetch v_rc2 into v_order_name, v_reason_text;
        exit when v_rc2%notfound;
        dbms_output.put_line('ORDER_NAME='||v_order_name||', REASON_TEXT='||v_reason_text);
      end loop;
    
      close v_rc2;
    
    END;
    /
    

    If you test this in SQL * Plus, do not forget to SET SERVEROUTPUT ON to see the result.

  • How to import the XML file into an oracle table using a BPEL process

    Hi friends

    How can I import XML file in the db oracle table using a BPEL process

    (1) I have generated an XML file in my local system with a field
    (2) I created a temporary table in my oracledb with the same field in the XML file
    (3) that I want to import these XML files which is the local host to my db oracle using a BPEL process
    (4) for that what steps should I me fallow please suggest me if there is no document for this?

    Thanks in advance
    AT

    Hi to

    Here you go...

    http://blogs.Oracle.com/ajaysharma/2011/03/using_file_adapter_database_adapter_and_mediator_component_in_soa_11g.html

    I hope that helps!

    Thank you
    AJ

  • I can't seem to figure out how to import multiple XML files in Flex

    I can't figure out how to import multiple XML files in Flex and connect it to the DataGrids. Does anyone have ideas how to make this happen?

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >

    < s:creationComplete >
    <! [CDATA]
    loader.addEventListener (Event.COMPLETE, getData);
    loader.load (new URLRequest ("http://www.student.hint.no/~100471/mmt134/images/Reiseregning-Konradi_Kare_2011-01-30.xml"));   

    []] >
    < / s:creationComplete >

    < fx:Declarations >
    <! - Place non-visual elements (e.g., services, items of value) here - >
    < / fx:Declarations >

    < fx:Script >
    <! [CDATA]
    var testData:XML;

    var loader: URLLoader = new URLLoader();

    public void getData(E:Event):void {}
    testData = new XML (E.currentTarget.data);
    grid.dataProvider = testData.descendants ('TravelSpecificationVO');
    }

    []] >
    < / fx:Script >

    < mx:TabNavigator "22.7" = x y = '39.35' width = '536' height = "312" >
    < s:NavigatorContent label = "Tab 1" width = "100%" height = "100%" >
    < mx:DataGrid = "1.3" x = "-2.35" width = "507" height = "269" id = "grid" >
    < mx:columns >
    < mx:DataGridColumn dataField = "to_destinasion" headerText = "Til destinasjon" / >
    < mx:DataGridColumn dataField = "from_date" headerText = "Klokkeslett" / >
    < mx:DataGridColumn dataField = "from_destinasion" headerText = "Fra destinasjon" / >
    < mx:DataGridColumn dataField = "to_date" headerText = "Klokkeslett" / >
    < / mx:columns >
    < / mx:DataGrid >
    < / s:NavigatorContent >
    < s:NavigatorContent label = "hkuhk" width = "100%" height = "100%" >
    < / s:NavigatorContent >
    < / mx:TabNavigator >
    < / s:Application >

    Hope this helps you:

    
    
     
      
     
    
     
      
       
       
       
       
      
     
    
    
    

    Let me know if you need additional information.

    Best regards

    Pablo Souza

  • Reading an xml file

    Hi all

    I want to read an xml file and add that a large number of boxes with the names specified in xml.

    Can someone please share a working code example please

    Thank you

    Lima

    If this post answers your question or assistance, please mark it as such.

    Greg Lafrance - Flex 2 and 3 certified ACE

    www.ChikaraDev.com

    Flex / development, training, AIR and Support Services

    
    
      
      
      
        
      
    
    
    
    
      check1
    
      check2
    
      check3
    
    
    

Maybe you are looking for

  • unrecognized sd slot

    Apple where are you? Whit El capitan on my iMac late 2009 the SD slot is not recognized, is gone. The problem is known. Why Apple does not repair?

  • Software download for DCR - SX43 does not work

    I'm fighting for the PMB software for my camera. I've upgraded to a new computer & can't find my original disks of the camera. I have a DCR-SX43 camera & run Windows 7-64 bit OS. I tried several times to download the exe file which should install PMB

  • What is the maximum amount on a Micro SD card

    Just recently bought the Tablet removable 10-n113dx of HP Pavilion x 2 and love it. My investigation is, I know it comes with built-in 32 GB. So, knowing this, what is the maximum amount on a Micro SD card that I can use on this product?

  • How to prevent the updates for Office Standard 2007

    I'm running on windows xp. I use office 2007 standard. After a computer breakdown recent when I reinstalled office 2007 standard I am able to update 2003 documents. However, after sending updates by microsoft I can't open word 2003 documents. It says

  • How to delete a file that is currently open in another program

    I tried to remove a few images and mp3 documents frostwire downloaded automatically for me. But every time I try to delete the documents that it says that the file is currently open in Frostwire. I uninstalled Frostwire to my computer and it still sa