How to edit/update data into an XML file using Flex and Actionscript

I can read an external xml file, please see the code below:
protected function button1_clickHandler(event:MouseEvent):void
var GrowthChartsDataGrid:XML;
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest("../GrowthChartsDataGrid.xml");
    loader.load(request);
    loader.addEventListener(Event.COMPLETE, onComplete)
function onComplete (event:Event)
     var loader:URLLoader = URLLoader(event.target);
     GrowthChartsDataGrid = new XML(loader.data);
     GrowthChartsDataGrid.GrowthChartGridView += <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>
     texttesting.text = GrowthChartsDataGrid.toString();
I can read an XML file and can add an extra node and can display it in a text filed. But I want to update the XML file contents which will come from the txtMonth and txtWeight text boxes.
Please any suggestions???

First of all thanks for your quick reply .
I actually want to add another node inthe xml file. Files is at a local location and i can read the file and add an extra node (but I cant store this extra node in the actual XML file). But I want to save XML with the extra node.
For exmaple,
my current xml is:
<?xml version="1.0" encoding="utf-8"?>
<GrowthChartGridView>
    <Month> 1
    <Weight>3.5</Weight></Month>
<Month> 2
    <Weight>3.9</Weight></Month>
<Month> 3
    <Weight>4.5</Weight></Month>
</GrowthChartGridView>
and at run time, I can create a new node using the data from two textboxes at button click event.
     GrowthChartsDataGrid.GrowthChartGridView += <Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>
Now what I want to do is, I want to add this node back in to my XML. Therefore, the result I am looking for is, my local XML should update like this.
<?xml version="1.0" encoding="utf-8"?>
<GrowthChartGridView>
    <Month> 1
    <Weight>3.5</Weight></Month>
<Month> 2
    <Weight>3.9</Weight></Month>
<Month> 3
    <Weight>4.5</Weight></Month>
<Month> {txtMonth.text} <Weight> {txtWeight.text} </Weight> </Month>  //I can read data from text boxes so its fine but I can not store this in to                                                                                                          my original XML
</GrowthChartGridView>
Thanks

Similar Messages

  • How to write input data into an xml file

    Hi All,
           I have some input data and i have to write it
    into an xml file.How is it possible send me some related
    links regarding this and source code if any.

    Hi
    Try to go through these links.I hope this will help you to solve your problem.
    http://www.xml.com/pub/a/2003/07/09/udell.html
    Thanks
    Mrutyunjaya Tripathy

  • How to export a data as an XML file from oracle data base?

    could u pls tell me the step by step procedure for following questions...? how to export a data as an XML file from oracle data base? is it possible? plz tell me itz urgent requirement...
    Thankz in advance
    Bala

    SQL> SELECT * FROM v$version;
    BANNER
    Oracle DATABASE 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS FOR 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    5 rows selected.
    SQL> CREATE OR REPLACE directory utldata AS 'C:\temp';
    Directory created.
    SQL> declare                                                                                                               
      2    doc  DBMS_XMLDOM.DOMDocument;                                                                                       
      3    xdata  XMLTYPE;                                                                                                     
      4                                                                                                                        
      5    CURSOR xmlcur IS                                                                                                    
      6    SELECT xmlelement("Employee",XMLAttributes('http://www.w3.org/2001/XMLSchema' AS "xmlns:xsi",                       
      7                                  'http://www.oracle.com/Employee.xsd' AS "xsi:nonamespaceSchemaLocation")              
      8                              ,xmlelement("EmployeeNumber",e.empno)                                                     
      9                              ,xmlelement("EmployeeName",e.ename)                                                       
    10                              ,xmlelement("Department",xmlelement("DepartmentName",d.dname)                             
    11                                                      ,xmlelement("Location",d.loc)                                     
    12                                         )                                                                              
    13                   )                                                                                                    
    14     FROM   emp e                                                                                                       
    15     ,      dept d                                                                                                      
    16     WHERE  e.DEPTNO=d.DEPTNO;                                                                                          
    17                                                                                                                        
    18  begin                                                                                                                 
    19    OPEN xmlcur;                                                                                                        
    20    FETCH xmlcur INTO xdata;                                                                                            
    21    CLOSE xmlcur;                                                                                                       
    22    doc := DBMS_XMLDOM.NewDOMDocument(xdata);                                                                           
    23    DBMS_XMLDOM.WRITETOFILE(doc, 'UTLDATA/marco.xml');                                                                  
    24  end;                                                                                                                  
    25  /                                                                                                                      
    PL/SQL procedure successfully completed.
    .

  • How to update the value in xml file using transformer after setNodeValue

    Hi,
    This is my code
    I want to set update the values in xml file using transformer..
    Any one can help me
    This is my Xml file
    <?xml version="1.0" encoding="UTF-8"?>
    <place>
    <name>chennai</name>
    </place>
    Jsp Page
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import="javax.xml.parsers.DocumentBuilderFactory,
    javax.xml.parsers.DocumentBuilder,org.w3c.dom.*,org.w3c.dom.Element"
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>JSP Page</title>
    </head>
    <body>
    <% String str="";
    String str1="";
    try
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse("http://localhost:8084/XmlApplication1/sss.xml");
    out.println("Before change");
    NodeList n11 = doc.getElementsByTagName("name");
    Node n22= n11.item(0).getFirstChild();
    str1 = n22.getNodeValue();
    out.println(str1);
    out.println("After change");
    String name = "Banglore";
    NodeList nlst = doc.getElementsByTagName("name");
    Node node= nlst.item(0).getFirstChild();
    node.setNodeValue(name);
    NodeList n1 = doc.getElementsByTagName("name");
    Node n2= n1.item(0).getFirstChild();
    str = n2.getNodeValue();
    out.println(str);
    catch(Exception e)
    out.println(e) ;
    %>
    <h1><%=str%></h1>
    <%--
    This example uses JSTL, uncomment the taglib directive above.
    To test, display the page like this: index.jsp?sayHello=true&name=Murphy
    --%>
    <%--
    <c:if test="${param.sayHello}">
    <!-- Let's welcome the user ${param.name} -->
    Hello ${param.name}!
    </c:if>
    --%>
    </body>
    </html>

    hi check this exit...
    IWO10012

  • How to read the attribute of the xml file using jaxb

    Thanks,
    Buddy as i have a issue i have to read the xml file using jaxb and xml file contains this data and i have read the attribute like name , desc and action for a particular menu name pls tell the code how to do this it will be a great favour to me
    thanx in advance
    Rasool
    <contextmenu>
    <menu name='Lead' >
    <menuitem name='newlead' desc='New Lead' action='/leads.do?dispatch=insert' />
    <menuitem name='editlead' desc='Edit Lead' action='' />
    <menuitem name='leadinfo' desc='Lead Information' action='' />
    </menu>
    <menu name='Cases' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    <menu name='Contact' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    </contextmenu>

    What my program do is to get the encoding of XML files and convert them to UTF-8 encoding files, while I need this "encoding" information of the original XML document thus I can convert...
    After reading specifications and JDOM docs, the truth turns to be disappointed, no function is provided to get this information in JDOM level 2(the current released one), while it's promissed that this function will be provided in JDOM level API....
    Thanx all for your help and attention!!!

  • How to scan more pages into one PDF file using hP inkjet 2515

    Dear friend 
    How to scan more pages into one PDF file using hP inkjet 2515 

    Dear friend 
    How to scan more pages into one PDF file using hP inkjet 2515 

  • Manipulating  XML file using flex 2.0

    Hi,
    how to add contents in to xml file using flex 2.0, ie i
    actually wants to write data in to a xml file, so that data to be
    appended at the end of the file.
    Kumar

    You can't! Well, at least Flex cannot do this. All Flex can
    do is send this data -- any data -- to the server and it's up to
    you how you want to append this data to a file on the server.
    You see, flex can't write to local files. If you looking for
    client side file manipulation, take a look at Flex's desktop
    brother call AIR!
    ATTA

  • How to update data in a xml file.

    I am able to retrieve data from a xml file but not able to update data. Also how can i add or delete node from a xml file.

    Hi,
    For some time I have also been trying to do the same thing with no success. So far I have tried a few approaches like $.post functions $.ajax post functions and HTML5 fileWriter functions. I am not well aware of the web development techniques but as fas as I understand the post or update of the json file should be done on the serverside mainly because of security issues. I am not sure how appbuilder works entirely and if there is any way to do this.
    Have you managed to find a solution ?
    (P.S. my goal is to update my chart data which is of course json file. So the idea here is to get some values from the user input and update the json file values then refresh the chart and display it with the new values).
    Best Regards,
    A.Dyankov.

  • How to convert indesign document's data into the xml file

    Hi all,
    First let me explain what exactly i am trying to do.
    just i want to ge all page items data (type,frame etc ) from a document and i want to convert all those data into my xml structure .
    now i am able to get page item's data from a document . i dont know how to approach it further
    any advise ? how do i approach it?.
    Experts Please help!

    What are you trying to achieve specifically. Did you look into IDML to see if suits your needs?
    Manan Joshi
      - Efficient InDesign Solutions -
    MetaDesign Solutions
    http://metadesignsolutions.com/services/indesign-development.php

  • Reading XML file using BAPI and then uploading that xml file data into SAP

    I am getting a xml file from Java server. I need to take
    data from this file using BAPI and need to upload into SAP using SAP.
    Please tell me how to read XML files using BAPI's.

    <b>SDIXML_DATA_TO_DOM</b> Convert SAP data (elementary/structured/table types) into DOM (XML
    <b>SDIXML_DOM_TO_XML</b>  Convert DOM (XML) into string of bytes that can be downloaded to PC or application server
    <b>SDIXML_DOM_TO_SCREEN</b> Display DOM (XML)
    <b>SDIXML_DOM_TO_DATA</b>
    data: it_table like t001 occurs 0.
    data: l_dom      TYPE REF TO IF_IXML_ELEMENT,
          m_document TYPE REF TO IF_IXML_DOCUMENT,
          g_ixml     TYPE REF TO IF_IXML,
          w_string   TYPE XSTRING,
          w_size     TYPE I,
          w_result   TYPE I,
          w_line     TYPE STRING,
          it_xml     TYPE DCXMLLINES,
          s_xml      like line of it_xml,
          w_rc       like sy-subrc.
    start-of-selection.
      select * from t001 into table it_table.
    end-of-selection.
    initialize iXML-Framework          ****
      write: / 'initialiazing iXML:'.
      class cl_ixml definition load.
      g_ixml = cl_ixml=>create( ).
      check not g_ixml is initial.
      write: 'ok'.
    create DOM from SAP data           ****
      write: / 'creating iXML doc:'.
      m_document = g_ixml->create_document( ).
      check not m_document is initial.
      write: 'ok'.
      write: / 'converting DATA TO DOM 1:'.
      CALL FUNCTION 'SDIXML_DATA_TO_DOM'
        EXPORTING
          NAME               = 'IT_TABLE'
          DATAOBJECT         = it_table[]
        IMPORTING
          DATA_AS_DOM        = l_dom
        CHANGING
          DOCUMENT           = m_document
        EXCEPTIONS
          ILLEGAL_NAME       = 1
          OTHERS             = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
      check not l_dom is initial.
      write: / 'appending DOM to iXML doc:'.
      w_rc = m_document->append_child( new_child = l_dom ).
      if w_rc is initial.  write  'ok'.
      else.                write: 'Err =', w_rc.
      endif.
    visualize iXML (DOM)               ****
      write: / 'displaying DOM:'.
      CALL FUNCTION 'SDIXML_DOM_TO_SCREEN'
        EXPORTING
          DOCUMENT          = m_document
        EXCEPTIONS
          NO_DOCUMENT       = 1
          OTHERS            = 2.
      if sy-subrc = 0.  write  'ok'.
      else.             write: 'Err =', sy-subrc.
      endif.
    convert DOM to XML doc (table)     ****
      write: / 'converting DOM TO XML:'.
      CALL FUNCTION 'SDIXML_DOM_TO_XML'
        EXPORTING
          DOCUMENT            = m_document
        PRETTY_PRINT        = ' '
        IMPORTING
          XML_AS_STRING       = w_string
          SIZE                = w_size
        TABLES
          XML_AS_TABLE        = it_xml
        EXCEPTIONS
          NO_DOCUMENT         = 1
          OTHERS              = 2.
      if sy-subrc = 0.   write  'ok'.
      else.              write: 'Err =', sy-subrc.
      endif.
      write: / 'XML as string of size:', w_size, / w_string.
      describe table it_xml lines w_result.
      write: / 'XML as table of', w_result, 'lines:'..
      loop at it_xml into s_xml.
        write s_xml.
      endloop.
      write: / 'end of processing'.
    end of code
    Hope this will be useful.
    regards
    vinod

  • How to export special characters into an XML file?

    Dear experts,
    We read files from our customers and save data into our customized table without any character changed, including some address fields. In those address fields, some special characters (not in our code page) are also kept. When we want to write these address fields into an XML file or flat file, the special charcters become "##" or not readable, can anyone help us to solve this issue?
    Question1: How to write special code to an external file?
    Question2: how to use 'CALL TRANSFORMATION' from an internal table to an XML file?
    Your answer is highly appreciated!
    Joanne

    Hi Joanne.
    Please check the below link.
    CALL TRANSFORMATION
    Before that u have to create one transformation program in STRANS tcode for using it in call transformation statement.
    Hope it will be useful.
    Regards,
    Lakshman

  • How to update/write to a XML file using JSP?

    If a user enters information in a form, is there any way to write this information into an existing XML document using JSP? Basically, I want my users to be able to add new information into an XML file but I have no idea how to do it.
    Help appreciated.

    Java webservices tutorial should help
    http://java.sun.com/xml/index.jsp

  • How to insert/Update date into Dictionary Table?

    Dear Experts,
    I have created a Dictionary Project and Deployed.I think the table had created in portal database.
    now i want to insert some data into that table?
    Can you plz tell me how to access the table using Abstract Portal Component using DynPage.
    Waiting for ur replies...
    Thanks and Regards,
    Visweswar.

    Hi
    Can u share the Logic???

  • How to import the data from a xml file to IDM

    Hi all:
       I have read  the document(/people/kare.indroy/blog/2008/01/14/sap-netweaver-identity-management-how-to-maintain-xml-files) ,but
    cannot get the data when I click the insert template-->data source template menu.
    The xml file as follows:
    <?xml version="1.0" encoding="GB2312"?>
    <users>
    <user>
    <name>CA_admin</name>
    <password>123</password>
    <role>caadmin</role>
    </user>
    <user>
    <name>CA_user1</name>
    <password>123</password>
    <role>caadmin</role>
    </user>
    </users>
    The xsl file as follows:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="users"> 
    <xsl:element name="users">      
                    <xsl:for-each select="user"> 
                     <xsl:element name="user">
                      <xsl:element name="name">               
                          <xsl:value-of select="name"/>
                      </xsl:element>
                      <xsl:element name="password">               
                           <xsl:value-of select="password"/>
                      </xsl:element>
                      <xsl:element name="role">               
                          <xsl:value-of select="role"/>
                      </xsl:element>
                      </xsl:element> 
                    </xsl:for-each>
                     </xsl:element>            
    </xsl:template>
    </xsl:stylesheet>
    Is there some thing wrong within my xsl file? Who can give me some points about this?
    Is there some more information about this topic?
    thanks in advanced.

    Hello Shi,
    Could you please provide details about how did you solve this problem?
    Thanks,
    Anuj

  • How do you save data into an excel file while myRIO is acquiring data? I tried saving it using "Write to file" but it doesn't work for some reason.

    I am acquiring cosine wave and a pulse wave as input and I want to store their peak to peak values into an excel file. "Write to File" is not working for it. Is there any other vi which can be used for data logging?
    Thank you for your help.

    Hi Ssheoran,
    Can you provide more detail when you say that the Write to File VI doesn't work? Is there an error given? Or can you just not find the file on your computer? Keep in mind using this file in a Real-Time VI on the myRIO will save files on the myRIO. You will then have to transfer to your PC. Please view the following video as a guide for saving files and transferring them to your computer: (http://www.youtube.com/watch?v=BuREWnD6Eno). Hope this helps.
    Best Regards,
    Roel F.
    Applications Engineer
    National Instruments

Maybe you are looking for

  • The same delivery in two document for shipment

    Hello, I wonder if there is a way to block the delivery if it is already in another document shipment. Is there any way in customizing? Because the way it is configured the system is allowing a single delivery is contained in two documents of freight

  • To show zeroes after decimal in CSV file

    Hi all, A program generates a .CSV file , downloaded to local PC. The values should be shown as 2.0000(upto four decimals) and 0 should be 0.0000. I tried appending ' - single quote to char field , it's working fine but it's shown as '2.0000 in CSV f

  • BOM fra Cad Desktop

    hi Our engineers want only to maintain one BOM in their CAD system, but based on different sub contractors we have different needs as for the free-issue items.   subcontract 1     we will by all  consumables(free-issue) item at home and send to contr

  • How to do mail forwarding

    I have two mail servers, one lotus notes and one iPlanet Messaging server 5.2. There are two groups of users, one group belongs to lotus notes and the other belongs to iPlanet Messaging Server 5.2. I need to create a list that contain all userids tha

  • Bc4j-oc4j and Jdeveloper Release Candidate

    I developed a bc4j application with Jdeveloper Release Candidate. In another pc I installed 9ias and bc4j-oc4j server. Then I deployed my application using .ear file. I get an error when I try to run the application through the as. Here is the error: