Read and Write XML files

I work on a Flex application that will be used to record time entries for manufacturing plan. I have two problems to solve:
1- Can I read an XML file from a local drive? (C: /temp/file)
2- If the system where I call the web service is offline, I must create local file that are going to be read later vwhen the system will be up again. How can I create local file from Flex?

A web-based app cannot access the local drive w/o user permission.
Sometimes, folks upload local files to a server (also requiring user
permission) and then request the file from the server.
You can use local SharedObject to store data, although there are limits to
how much data.
The recommended option is to create an AIR app.  It will be able to access
the local drive once it is installed.

Similar Messages

  • How to read and write Xml file at client side using JavaScript !

    Hello,
    i am new to javascript.
    I have requirement to read and update XML file at client side.
    Will you please guide what could be the best way to read and update XMl file using javascript.
    Thanks,
    Zuned

    This is a Java forum,not a Javascript forum. Maybe you should ask here [http://www.webdeveloper.com/forum/forumdisplay.php?forumid=3&s|http://www.webdeveloper.com/forum/forumdisplay.php?forumid=3&s].

  • File Read and Write using File Adapter in Bpel

    In Bpel Process i am using File Adapter ( Schema is Opaque) for read and write the file contents. i am able do successful deployment and read, write function in first time deployment, after that again i tired to run the application, its not going to write the content of file, its only writing the file with out data's or content in that file.
    Please help me...
    Saravanan

    Hi Eric
    In my domain.log file having the following details. In this file im unable to find out what the exact problem. Please look at this and help me.
    <2008-01-22 18:25:42,024> <INFO> <default.collaxa.cube.compiler> validating "C:\product\10.1.3.1\OracleAS_1\bpel\domains\default\tmp\.bpel_BPELProcess2_1.1_298e83988d77b6640c33dfeec11ed31b.tmp\BPELProcess2.bpel" ...
    <2008-01-22 18:25:49,850> <INFO> <default.collaxa.cube.engine.deployment> <CubeProcessFactory::generateProcessClass>
    Process "BPELProcess2" (revision "1.1") successfully compiled.
    <2008-01-22 18:25:49,914> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Loading JCAActivationAgent for {portType=Read_ptt}
    <2008-01-22 18:25:49,914> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::load - Locating Adapter Framework instance: OraBPEL
    <2008-01-22 18:25:49,930> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::load - Done loading JCAActivationAgent for processId='bpel://localhost/default/BPELProcess2~1.1/
    <2008-01-22 18:25:49,930> <INFO> <default.collaxa.cube.engine.deployment> Process "BPELProcess2" (revision "1.1") successfully loaded.
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::uninit Shutting down the JCA activation agent, processId='bpel://localhost/default/BPELProcess2~1.0/', activation properties={portType=Read_ptt}
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - performing endpointDeactivation for portType=Read_ptt, operation=Read
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> Endpoint De-activation called in adapter for endpoint : D:\MAXIMUS_Project_Softwares\jdevstudiobase10132\jdev\mywork\MyLabs\BPELProcess2\in
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::init - Initializing the JCA activation agent, processId='bpel://localhost/default/BPELProcess2~1.1/
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> JCAActivationAgent::initiateInboundJcaEndpoint - Creating and initializing inbound JCA endpoint for:
    process='bpel://localhost/default/BPELProcess2~1.1/'
    domain='default'
    WSDL location='rd.wsdl'
    portType='Read_ptt'
    operation='Read'
    activation properties={portType=Read_ptt}
    <2008-01-22 18:26:02,698> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - endpointActivation for portType=Read_ptt, operation=Read
    <2008-01-22 18:26:02,730> <INFO> <default.collaxa.cube.activation> <File Adapter::Inbound> Endpoint Activation called in File Adapter for endpoint: D:\MAXIMUS_Project_Softwares\jdevstudiobase10132\jdev\mywork\MyLabs\BPELProcess2\in
    <2008-01-22 18:26:02,730> <INFO> <default.collaxa.cube.activation> <AdapterFramework::Inbound> Adapter Framework instance: OraBPEL - successfully completed endpointActivation for portType=Read_ptt, operation=Read
    <2008-01-22 18:26:02,890> <WARN> <default.collaxa.cube.activation> <File Adapter::Inbound> PollWork::run exiting, Worker thread will die
    <2008-01-22 18:26:04,171> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> Managed Connection Created
    <2008-01-22 18:26:04,171> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> Connection Created
    <2008-01-22 18:26:04,171> <INFO> <default.collaxa.cube.ws> <File Adapter::Outbound> FileInteraction Created

  • How do I migrate files created in a Windows OS to a new external drive that is formatted as a MAC drive. I want to read and write these files back to the new drive.

    How do I migrate files from an external hard drive created in a Windows OS to a new MAC external drive? I want to read and write these files to the new drive.

    LKrzesowski wrote:
    How do I migrate files from an external hard drive created in a Windows OS to a new MAC external drive? I want to read and write these files to the new drive.
    If all you're trying to do is move the files from the Windows external to the Mac external, you can simply connect them both to the Mac and drag the files from the Windows drive to the Mac drive. If you want to move the files back and forth between them, you'll need to establish the format of the Windows external. Macs can read and write to FAT32 and exFAT (which can handle files larger than 4GB) formatted drives but can only read NTFS formatted drives without additional software. With the Windows drive connected, you can check its format with Disk Utility.

  • How to Read and Write .XML datas   (HELP Plz...)

    hai everybody
    how to read and write xml datas... plz give clean and simple example..
    bcoz me want to produce such type of module...
    if any one help me .. thats the only way me laid in software ladder
    plz....
    thank u in advance

    thank u for giving idiot..
    but before posting i search in google also..
    but i cant get what me expect..
    thus i posted...
    then who is ................?
    sorry javacoder01
    // plz help me
    Message was edited by:
    drvijayy2k2

  • I'm trying to share folder between users on a single mac.  I put the folder in "shared," set permissions so other user can read and write, enabled file sharing, but can't find the folder on the second user's account.  Any help?

    I'm trying to share a folder between users on a single mac.  I want both users to be able to read and write so the folder stays current on both accounts.  I put the folder in "shared," set permissions on folder so other user can read and write, enabled file sharing, but can't find the folder on the second user's account.  Any help?

    Did you log out of one account and into the other or just used Fast user switching?
    Is the permissions set to anyone?
    When you move data to teh Shared folder is it copied or just moved?
    If copied then it's not a folder both can access, just a way station like a USB thumb drive that things are coped too and off of likely.
    You can run this #5 on each user account to reset the user permissions once they are taken back out of the Shared folder
    Step by Step to fix your Mac

  • How to read  and write XML in java

    I have a code that reads a large XML file, splits it into smaller files, filters and then writes it into a new XML file. My problem is that I had coded the input file name into the code, so that only the specified file can be read. How can I rewrite my code to be able to take any input xml and perform the same operation? Here's a portion of my code below:
                            File file = new File("c:\\APAdjustmentJVDoc_FINAL.xml");
                        output = new BufferedWriter(new FileWriter(file));
                        for (int i = 1; i < 79; i++) {
                             fIStream = new FileInputStream("c:\\APAdjustmentJVDoc_new" + i + ".xml");
                             loRead = new InputStreamReader(fIStream);
                             doc = XMLUtil.transformToNode(loRead, false);
                             System.out.println("Reading from file " + "c:\\APAdjustmentJVDoc_new" + i + ".xml");
                             writeFile(doc, docIdList, output);
                             fIStream.close();
                             loRead.close();
                        System.out.println("Output file complete");
                   } catch (Exception e) {
                        e.printStackTrace();
                   } finally {
                        if (output != null) {
                             output.close();
                        if (fIStream != null) {
                             fIStream.close();
              } catch (Exception e) {
                   e.printStackTrace();
                 

    You need to pass your filename String as a parameter to your functionality. It depends how you're currently set up though. We can't really see the top of your call so it's difficult to determine what you are calling and we don't really know from where you're calling either.
    If you're running standalone, then on launch of the application, you can feed in a file name as an argument that you can read in in String args[] in the main function and pass down to your XML splitter.
    If you're a method in a class that's part of a bigger pile, you can feed the file name as a String to the method from wherever you call from if it makes sense architecturally.
    You might also want to pass down a File object if that makes sense in your current code (i.e. if you're using your file for other purposes prior to the split, to avoid recreating closing/opening for no reason).
    Depends what you're trying to do. If I put together a piece like this, I would probably create an <yourcurrentrootpackage>.xml.splitter package.
    Also, on a side note, you're problem isn't really reading and writing XML in java, but seems more to be making your functionality generic so that any XML file can be split with your code.
    Regards
    JFM

  • How to read and write to file on server

    can any body tell how to read or write to a file on server, like where do i keep the file and what does the path look like......on server
    stand alone i am reading and writing into file but when it comes to server i am confused how it works...i mean the path
    thank you

    The Path needs to be absolute:
    For example in Unix it would look like:
    /usr/paz/Test.txtIn Windows it would look like:
    C:/Paz/Test.txtHope this helps.
    Thanks and regards,
    Pazhanikanthan. P

  • How to read and write(a file .txt) from a URLConnection

    I try to read and write on one URLConnection. Is it possible ? How can i make it ?
    The reading part of my application work's but not the writting part
    That's a part of rhe code that i use to write :
    String Line = "Hi";
    MyUrl = new URL(this.getCodeBase(), FichierEvenement) ;
    Con = MyUrl.openConnection() ;
    Con.setDoOutput(true);
    Con.setDoInput(true);
    Con.setUseCaches(false);
    Dos = new DataOutputStream(new BufferedOutputStream(Con.getOutputStream( )));
    Dos.writeUTF(Line);
    Please help me :)

    What are you doing with the bytes written to the OutputStream? This info would help, but i do have a suggestion. I ran into this problem when trying to write strings using writeUTF. The output was all screwed up. So, maybe change your string to a character array. That way Unicode is displayed properly. This in conjunction with writing to an .html file instead of to the connection itself might work.

  • I have an excel file,i want to read and write this file to xml

    hello,
    i have an excel file,i want to read excel data and write to xml file .i also have an exisitng xml file and i want to appened the excel data to the exisiting xml.please give some example code.
    thanks

    GoOgLe

  • Anyone have example to read and write XML to/from file

    I am writing a swing utility and need to save and read data in XML. I have looked around google, but the examples are just confusing me.
    Jonathan

    Do these xml docs have dtd's? And specific DOM implementation needs or just a custom xml?
    I have some examples in http://cvs.sourceforge.net/viewcvs.py/mathml-x/mathml-x/src/com/neuralworks/physics/Academy.java?view=markup
    follow openMenuItemActionPerformed and openFEMMLDocument(String filePath). Look for DocumentBuilder
                DocumentBuilderFactory factory =
                DocumentBuilderFactory.newInstance();
    /*            factory.setAttribute("element.factory",
                                     ELEMENT_FACTORY);
                factory.setAttribute("attribute.factory",
                                     ATTR_FACTORY);
                DocumentBuilder builder = factory.newDocumentBuilder();
                //builder.setEntityResolver(new X3DEntityResolver());
                //builder.setErrorHandler(new X3DErrorHandler());
                femDoc = findXMLFile(builder, filePath);
                org.w3c.dom.Element docElement=femDoc.getDocumentElement();
                javax.swing.tree.DefaultMutableTreeNode dmtn=new javax.swing.tree.DefaultMutableTreeNode("FEMML");
                javax.swing.tree.DefaultMutableTreeNode svgChild=new javax.swing.tree.DefaultMutableTreeNode(docElement.getNodeName());
                //System.out.println(svgDocument.getTitle()+" nv "+svgSVGElement.getNodeValue());
                //recurseDOM2TreeNodes(svgChild, docElement.getChildNodes());
                dmtn.add(svgChild);
                JTree tree=new JTree(new javax.swing.tree.DefaultTreeModel(dmtn));
                tree.setRootVisible(true);
                tree.setShowsRootHandles(true);
                tree.setEditable(true);
                //try
                    //X3DTreeAdapter x3dTreeAdapter=new X3DTreeAdapter(x3dDTDParser.parse());
                    //org.web3d.x3d.dom.swing.DOMTreeCellEditor domTreeCellEditor=new org.web3d.x3d.dom.swing.DOMTreeCellEditor();
                    //tree.setCellEditor(domTreeCellEditor);
                    //org.web3d.x3d.dom.swing.DOMTreeCellRenderer domTreeCellRenderer=new org.web3d.x3d.dom.swing.DOMTreeCellRenderer();
                    //domTreeCellRenderer.addMouseListener(x3dTreeAdapter);
                    //domTreeCellRenderer.addMouseMotionListener(x3dTreeAdapter);
                    //tree.setCellRenderer(domTreeCellRenderer);
                    //tree.addMouseListener(x3dTreeAdapter);
                    //tree.addMouseMotionListener(x3dTreeAdapter);
                    academicSplitPane.setLeftComponent(new JScrollPane(tree));Lot of commented out stuff I need to clean up. There are other examples of opening specific xml docs that have special DOM implementations; svg and mathml for example.
    For saving I use xslt with an identity transform to go from an in memory DOM source to an xml document on disk.
    Follow the saveAs(String filePath) method and the identity.xsl is http://cvs.sourceforge.net/viewcvs.py/mathml-x/mathml-x/stylesheets/identity.xsl?rev=1.2&view=markup

  • How to Read and Generate XML file from java code.

    hi guys,
    how to read the xml file (Condition :we know only DTD or Shema only).
    How to Generate the new xml file ?(using Shema )
    And one more how directly Generate the xml from DB?
    Pleas with code or any URL

    Using XMLbeans you can generate Java objects from an XSD schema (perhaps DTDs aswell)
    Then you can create an instance of the Document object and ask it to write itself.
    This will create an XML document complient to the schema.
    XMLBeans generates a "type" safe DOM where you can only ever have a structure compilent to you schema.
    matfud

  • Read and Write Excel File

    Hi all. I need your need help. I need to know how to read EXCEL FILE and insert it to a certain table. By the way, can anyone tell me how to write to a EXCEL FILE?
    Thank you in advance.

    READING EXCEL
    There are several options how to read excel file - ODBC, on a fly excel-->CSV conversion (if you have 11.2 and want to use external tables preprocessor), ... I put (I think all) options on my BLOG http://jiri.wordpress.com/2010/01/04/load-ms-excel-file-to-oracle-database/
    WRITING TO EXCEL
    Writing to excel is tricky because there is no direct way from Oracle, here are few tips
    1. JAVA - you can create java stored procedure, I did not test this but it's probably doable http://www.java-tips.org/other-api-tips/jexcel/how-to-create-an-excel-file.html
    2. Excel XML format - you can use UTL_FILE and write to XML format Excel can read http://blogs.msdn.com/b/brian_jones/archive/2005/06/27/433152.aspx
    3. Excel can also read CSV files, but it's plan text file with no formatting. You can use UTL_FILE to easily create CSV (comma separated) file and read it from excel, I have few samples on my blog http://jiri.wordpress.com/2009/03/18/oracle-fast-parallel-data-unload-into-ascii-files/

  • How to read and write a file in unicode?

    Hello!
    I have a problem with reading and writing files which are saved in unicode. with my current code I get strange boxes in my text
    Do you need a special Reader/Writer for this?
    Please, help me if you have any ideas.
    cheers
    import java.io.*;
    import java.util.*;
    public class StreamConverter {
       static void writeOutput(String str) {
           try {
               FileOutputStream fos = new FileOutputStream("test_uni.txt");
               Writer out = new OutputStreamWriter(fos, "UTF8");
               out.write(str);
               out.close();
           } catch (IOException e) {
               e.printStackTrace();
       static String readInput() {
          StringBuffer buffer = new StringBuffer();
          try {
              FileInputStream fis = new FileInputStream("file_uni.txt");
              InputStreamReader isr = new InputStreamReader(fis, "UTF8");
              Reader in = new BufferedReader(isr);
              int ch;
              while ((ch = in.read()) > -1) {
                 buffer.append((char)ch);
              in.close();
              return buffer.toString();
          } catch (IOException e) {
              e.printStackTrace();
              return null;
       public static void main(String[] args) {
            String inputString = readInput();
            writeOutput(inputString);     
    }

    Are you saying there's only the three boxes at the beginning, and the rest of the text is okay? That sounds like a Byte Order Mark (BOM). The BOM is optional for UTF-8, but Java's I/O classes act like it's forbidden. They should check for it when reading so they can skip over it, but (for now, at least) we have to do that ourselves.
    All you have to do is read the first three bytes from the InputStream and compare them to the BOM. If they match, you start reading the text from that position; otherwise you reset the InputStream and start reading from the beginning.
    http://en.wikipedia.org/wiki/Byte_Order_Mark

  • Read and Write Text Files

    How do I add text from an input text box from flash to a text
    (.doc) file when you press an OK button. I want to make the button
    have an:
    on (release) {
    //script
    Lets say the URL is "/scene_detail.doc". I can also use .txt
    files, but I'd much prefer someone to tell me how to do this with
    DOC files. Thanks in Advanced!

    Flash cannot write files. You must have some sort of
    serverside script do
    this, something like ColdFusion, php, asp, perl or cgi.
    There is a sample here that writes to an XML file with php:
    http://www.kirupa.com/web/xml_guestbook.htm
    Here is one that writes to a text file with perl:
    http://www.flash-db.com/PerlTut/
    Another sample:
    http://actionscript.org/forums/showpost.php3?p=421960&postcount=70
    Dan Mode
    ->Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    "DjSickNick" <[email protected]> wrote in
    message
    news:eaou83$a31$[email protected]..
    > How do I add text from an input text box from flash to a
    text (.doc) file
    > when
    > you press an OK button. I want to make the button have
    an:
    > on (release) {
    > //script
    > }
    > Lets say the URL is "/scene_detail.doc". I can also use
    .txt files, but
    > I'd
    > much prefer someone to tell me how to do this with DOC
    files. Thanks in
    > Advanced!
    >

Maybe you are looking for

  • How to Connect Apple TV with dish anywhere app on ipad

    How do I connect to Apple TV to sync with my iPad so I can watch movies with the Dish any where app? I keep getting a message saying an error occurred loading this content.

  • How to find List of Erroneous Workitem for single user

    Hi Experts, I need to develop an application to find out Erroneous work items for each user. Is it possible to develop an application using GP API ??? Please give any valuable inputs to my problem. Regards, Satya.

  • Finding out the Batch which is present during creation of delivery

    Dear All, I need to keep track of changes in batch during delivery. I can find out the change using change documents ( tables CDHDR and CDPOS ). The problem is it keeps track of batches only after the document is saved . If during creation the batch

  • Itunes hangs with itunes match in Mountain Lion

    Right! I've seen all the "Itunes hanging" issues that Apple is choosing to ignore. So I'm adding my bitter experience to this too! I have: Re-installed Mountain Lion, tried to run the latest version of itunes, and pulled down my cloud stored library.

  • Suggestion for the next update

    WebOS 1.4.0 had some great improvements...but there is one other improvement I would love to see. If you receive a text message or email with an address, it would be nice to be able to tap and hold the address and have the ability to use that address