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].

Similar Messages

  • 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

  • Writing and updating XML file on client side

    Hello,
    I'm looking for a simple example which permit to write and
    update a xml file on the client side.
    Someone can help me, please?

    meghashyamgr ,
    Because of security reasons a swf running in a browser cannot
    read or write xml files to a user's computer. What can be done,
    however, is write xml to what is known as a SharedObject.
    SharedObjects act as cookies for Flashplayer.
    If you would like an example of this I'd be more than happy
    to show you...

  • 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

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

  • How to read from a xml file(in String format) using a java program

    hi friends
    i have a string , which is xml format. i want read the values and display it.can any one suggest how to read a xml file of string format using a javaprogram
    thanks

            final DocumentBuilder db =  DocumentBuilderFactory.newInstance().newDocumentBuilder();      
            final InputStream documentStream = new ByteArrayInputStream(documentXMLSourceString.getBytes("utf-8"));
            final Document document = db.parse(documentStream);

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

  • How to read and write PDF files

    I need to read pdf file and get information about its pagenumbers and format and permission allowed ...........
    then i want to ghange some of this attribute ....................
    how can do this ....................and what's API i have to use.......................

    http://www.pdfbox.org/
    regards

  • 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

  • How to read and write Binary files from Forms 6i C/S ?

    Hi There,
    I have a situation, where user wants to store attachements to a record (Could be any type of file, TXT, TIFF, or Word Doc etc.) and wanted to retreive later if they wanted to edit/read.
    We are using forms 6i and Oracle 9i in client/server environment setup. Does anybody know how to solve this requirment. I'm ale to load image files with read_image_file, but it could be text some times and it could be some thing elses like word doc or excel.
    Also i have to give user an option to view existing file attachments. I'm Planing to use BLOB in database table to store files.
    Any help in this regards is appreciated

    Thanks,
    Venkat

  • How to read and write to the same external HDD using Mac and PC

    Hello,
    I am using a mid 2014 MacBook Pro.
    I read somewhere that to write to an external HDD from a Mac, you need to format it in a particular way.
    But this would stop it from being used on my PC. Is there any way I can write to the same HDD from both OSes ?
    Thanks !

    Yes.  Format the HDD to FAT or ExFAT.  It seems best to do that on a PC.
    Ciao.

  • How to read and write a string into a txt.file

    Hi, I am now using BEA Workshop for Weblogic Platform version10. I am using J2EE is my programming language. The problem I encounter is as the above title; how to read and write a string into a txt.file with a specific root directory? Do you have any sample codes to reference?
    I hope someone can answer my question as soon as possible
    Thank you very much.

    Accessing the file system directly from a web app is a bad idea for several reasons. See http://weblogs.java.net/blog/simongbrown/archive/2003/10/file_access_in.html for a great discussion of the topic.
    On Weblogic there seems to be two ways to access files. First, use a File T3 connector from the console. Second, use java.net.URL with the file: protocol. The T3File object has been deprecated and suggests:
    Deprecated in WebLogic Server 6.1. Use java.net.URL.openConnection() instead.
    Edited by: m0smith on Mar 12, 2008 5:18 PM

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

Maybe you are looking for

  • How do i get my hp laptop to boot without the recovery disc?

    I have an HP 2000 laptop that dumped it's files when I tried to restart.  I put in Norton 360 2012 version and it was cleaning up virus' when I told it to restart.

  • Dynamically selection of Message Subject in AS2 adapter. Urgent Help..!!

    Hi All, I need to send the message to partner by using AS2 adapter. And i need to keep the Message Subject by taking dynamically from the payload message. ie. Iam sending the Purchase Order to Partner and i need to pass OrderNO which is coming in one

  • Upgrade 7.1.1 issue

    I get the following error after I installed 7.1.1. The error did not happen before the upgrade and I can use audio with other apps. I have tried reinstalling several times. Can I go back to the previous version which run fine. I am on Windows XP. Err

  • Adding Sales Employeed Name to Query

    Hi Guys, I have this query and would like to add to it the name of the Sales Employee that created the Sales Order, I am relatively certain I need to use the OSLP table to get this information but am not so sure on the JOINS required to add it. Any h

  • ESS / MSS Implementation for ECC 5.0 (ERP2004)

    Hello, We are preparing to implement ESS/MSS for ERP2004.  We are using EP6.0 SP9.  The notes for both ESS and MSS business packages refer to OSS Note 761266 regarding the versioning of XSS components.  Are the patches for the XSS components supposed