Write into XML file

Hi,
I have a xml file uploaded to the Document Management. I write a script to prompt the caller to leave a recording. I want to save the recording file name into the xml file. How do I do that? How do I append the recording file name into the existing xml file? Or I need to create a new one?
Attached is the xml file that has been uploaded to the Document Management.
Please help.
Thanks & regards,
How Yee

To get you started:
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPDOM7.html#65002
Shows you how to construct a XML Document in memory, so you can put the user data into a XML Document.
Use a Transformer (http://java.sun.com/j2se/1.4/docs/api/index.html) to write out your XML document to a file.

Similar Messages

  • Insert Encoding tag into xml file. ?xml version="1.0"?

    I am using oracle 10g.
    I am using dbms_xmlgen.getxml function to generate xml data for oracle tables. I use utl_file to write data back into xml file.
    Oracle is generating the file in the following manner...
    <?xml version="1.0"?>
    <ROWSET>
    <ROW>
    <RSLT_ID>1</RSLT_ID>
    </ROW>
    </ROWSET>
    I want to change the following xml header to have encoding information in it as follows...
    <?xml version="1.0" encoding = "AL32UTF8"?>
    How do I achieve that?
    Any suggestions?

    I want to change the following xml header to have encoding informationIn 10g I think you could use a xmlroot hack:
    SQL> select xmlroot(xmlelement(e, dummy), version '1.0" encoding="AL32UTF8') xml from dual
    XML                                                    
    <?xml version="1.0" encoding="AL32UTF8"?>              
    <E>X</E>                                               
    1 row selected.

  • How to convert Xls file into Xml file

    Hi,
    I am trying to convert Xls file into Xml  but there  is no any direct procedure for it
    Pls help me out to convert Xls file into Xml file
    Thanks
    Anushree

    you will require to write a module in your file adapter for the same.
    ref: /people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter as mentioned in the earlier post.
    Else you can also use Conversion Agent to read the same.
    Ref: http://help.sap.com/saphelp_nw04/helpdata/en/43/4c38c4cf105f85e10000000a1553f6/content.htm

  • How can i write a XML file with oracle data ?

    How can i write a XML file using PL/SQL.
    Can i do as follows.
    1.Open a file using UTL_FILE.FOPEN(LC_DIR_LOC,'abc.xml','W')     ;
    2.write all the required tag and value using UTL.put_line
    that is enough. Is not, please guide me to write.
    gk

    Having Oracle 9i.
    One more doubt. In the speck, some constand values are there, When i write the same into file, How can i write ?.
    1. l_str := ' "E27" '
    or
    2. l_str := ' E27 '
    UTL_FILE.PUT_LINE(L_FILE_POI,l_str,TRUE);          
    1 case : in XML file : "E27"
    In 2 case : E27
    When we write a XML file through editors , we have to define the constant within quote . is it?      
    Which one can i use ? Or any other way is there ..
    Thanks and Regards
    gopi

  • Writing into XML File in Flex

    Hi,
    I want to create a XML file (dynamically) and writes data
    into that xml file(data coming from web service).
    Thanks in advance.

    i want to write the data(coming from web service) into XML
    file and keep that XML file in Cache,then read that XML file
    contents and post into UI Control(Datagrid).
    <b>Sample Output Data from my Webservice:</b>
    <CoreProgramming>
    <BasicProgramming>
    <ProductId>10049</ProductId>
    <ProgrammingName>America'sTop60</ProgrammingName>
    <Price>29.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>false</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    </Listing>
    </BasicProgramming>
    <BasicProgramming>
    <ProductId>10041</ProductId>
    <ProgrammingName>America'sTop120</ProgrammingName>
    <Price>39.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>true</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DHLTH</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DISC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    </Listing>
    </BasicProgramming>
    <BasicProgramming>
    <ProductId>10045</ProductId>
    <ProgrammingName>America'sTop180</ProgrammingName>
    <Price>49.99</Price>
    <IncludesLocals>false</IncludesLocals>
    <IncludesRSN>true</IncludesRSN>
    <Listing>
    <CategoryName>WOMEN'SPROG</CategoryName>
    <Station>
    <StationCallLetters>TLC</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>DIY</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    <Station>
    <StationCallLetters>LIME</StationCallLetters>
    <Hdflag>false</Hdflag>
    </Station>
    </Listing>
    </BasicProgramming>
    </CoreProgramming>

  • Outbound oracle data into xml file

    Hi Odie,
    Your previous inputs for xml inbound was working fine, in the similar way now I need outbound the oracle apps data into .xml file format. For that I've written one sample script like this. I thought of making use of the utl_file option in Oracle apps.
    declare
    l_log_handle UTL_FILE.FILE_TYPE;
    l_log_name varchar2(50);
    l_path_2 varchar2(40);
    l_global_file varchar2(50);
    l_time number:=1;
    cursor cur1 is
    select xmltype(cursor(select * from fnd_menus where rownum <101)) a from dual;
    --select menu_id from fnd_menus where rownum<100;
    begin
    BEGIN
    SELECT DECODE (INSTR (VALUE, ','),
    0, VALUE,
    SUBSTR (VALUE, 1, (INSTR (VALUE, ',', 1)) - 1)
    INTO l_path_2
    FROM v$parameter
    WHERE NAME = 'utl_file_dir';
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('Error while getting Unix Path ' || SQLERRM);
    END;
    l_log_name := 'XGBIZ_'||TO_CHAR (SYSDATE, 'YYMMDD')||l_time;
    l_log_name := CONCAT(l_log_name,'.xml');
    l_global_file := l_log_name;
    l_log_handle := UTL_FILE.FOPEN(l_path_2,l_log_name,'W');
    for cur2 in cur1 loop
    UTL_FILE.PUT_LINE(l_log_handle, cur2);
    end loop;
    utl_file.fclose_all;
    EXCEPTION
    WHEN UTL_FILE.INVALID_OPERATION THEN
    dbms_output.put_line('Invalid Operation For '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_PATH THEN
    dbms_output.put_line('Invalid Path For '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_MODE THEN
    dbms_output.put_line('Invalid Mode For '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INVALID_FILEHANDLE THEN
    dbms_output.put_line('Invalid File Handle '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.WRITE_ERROR THEN
    dbms_output.put_line('Invalid Write Error '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.READ_ERROR THEN
    dbms_output.put_line('Invalid Read Error '|| l_global_file);
    UTL_FILE.FCLOSE_ALL;
    WHEN UTL_FILE.INTERNAL_ERROR THEN
    dbms_output.put_line('Internal Error');
    UTL_FILE.FCLOSE_ALL;
    WHEN OTHERS THEN
    dbms_output.put_line('Other Error '||'SQL CODE: '||SQLCODE||' Messg: '||SQLERRM);
    UTL_FILE.FCLOSE_ALL;
    end;
    when running this script I am getting error
    ERROR at line 30:
    ORA-06550: line 30, column 2:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    ORA-06550: line 30, column 2:
    PL/SQL: Statement ignored
    if in the cursor declaration happen to use 'select menu_id from fnd_menus ' a plain record then it is successfully creating.
    If tried again revert to actual select statement ' select xmltype(cursor(select * from fnd_menus where rownum <101)) a from dual'
    then its erring out as above said.
    Please give me your valuable inputs in this regard.
    Thanks & Regards
    Nagendra

    Hi,
    There are multiple ways to generate XML documents from relational data.
    Here are some :
    -- SQL/XML functions : XMLElement, XMLAgg, XMLAttributes etc.
    -- DBMS_XMLGEN package
    select dbms_xmlgen.getXML('SELECT * FROM scott.emp')
    from dual;-- XMLType constructor over a REF CURSOR (the one you chose)
    select xmlserialize(document
             xmltype(
               cursor(
                 select *
                 from scott.emp
             as clob
    from dual;-- From a DBUriType
    select xmlserialize(document
             dburitype('/SCOTT/EMP').getXML()
             as clob
    from dual;-- From XQuery using ora:view function
    select xmlserialize(document
             xmlquery('<ROWSET>{ora:view("SCOTT","EMP")}</ROWSET>' returning content)
             as clob indent size = 1
    from dual;If a column is NULL in the result set, those methods (except XMLElement) won't create the corresponding element.
    There's an option available for the XQuery method, but only in version 11.2.
    So if you want to output empty elements, you'll have to use DBMS_XMLGEN with setNullHandling method :
    DECLARE
    ctx   DBMS_XMLGEN.ctxHandle;
    v_out CLOB;
    rc    SYS_REFCURSOR;
    BEGIN
    OPEN rc FOR
      SELECT *
      FROM scott.emp
    ctx := DBMS_XMLGEN.newContext(rc);
    DBMS_XMLGEN.setNullHandling(ctx, DBMS_XMLGEN.EMPTY_TAG);
    v_out := DBMS_XMLGEN.getXML(ctx);
    DBMS_XMLGEN.closeContext(ctx);
    CLOSE rc;
    DBMS_XSLPROCESSOR.clob2file(v_out, 'TEST_DIR', 'test_out.xml');
    END;
    I thought of making use of the utl_file option in Oracle apps.You could, but you might find DBMS_XSLPROCESSOR.clob2file procedure more convenient for that (see above).
    All you have to do is serializing the XML in a CLOB variable, and call the procedure.
    WHERE NAME = 'utl_file_dir';The "utl_file_dir" init. parameter is deprecated since 10g, use directory objects instead.

  • Writting a XML file from a DOM with the reference to a DTD

    Hi everyone,
    how can I write a XML file, that has a reference to a DTD like:
    <!DOCTYPE testdoc SYSTEM "testdoc.dtd">
    I have a DOM that contains my XML-Data and I want to have this line in the XML File. I'm using a Transformer to write this XML stuff in the file.
    Does anyone has an idea?
    Thanks in advance
    Andi

    http://java.sun.com/j2se/1.4.2/docs/api/javax/xml/transform/OutputKeys.html
    transformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, "testdoc.dtd");

  • Why we need to conver Context  Node data into XML file----Export to Excel

    Hi All,
    Let me clarify my dought........today i have gone through the concept of  "Exporting Context Data Using the Webdynpro Binary cache" in SAP Online Help.
    From the SAP Online Help pdf document, i have found that, the context node data has been converted first in to XML file,after that file had been stored in the web dynpor binary cache...bla....bla.........
    Here my qtn is why they had converted context node data into XML file. With out doing that can not we export context node data to excel file..?
    Regards
    Seshu
    Edited by: Sesshanna D on Dec 19, 2007 7:25 AM

    Hi Sesshanna,
    it is not neccessary to do that but xml has the advantage, that it can be easily transformed into every output format that might occur in later project stages.
    If it's simply about blowing out some Excel, I suggest using an OSS library such as jexcelAPI or Jakarta POI and building the Excel how you need it.
    regards,
    Christian

  • HELP!!!!!! - How to write into a file?

    How to write into a file?
    I want to make a script that will connect(not enter) to my website[for example, www.vasa.com] every time i connect to the internet.
    Now i have 3 problems:
    1. i dont know how to write into a file
    2. i dont know how to make it connect to my 'server' without entering the website
    3. i dont know what file to write it to
    so if someone can help me, please do.

    Well, how about RTFM?? In this case that can be found here:
    http://developer.java.sun.com/developer/onlineTraining/
    BTW - these things have been asked azillion times, search the forum.

  • How to read from one file and write into another file?

    Hi,
    I am trying to read a File and write into another file.This is the code that i am using.But what happens is last line is only getting written..How to resolve this.the code is as follows,
    public String get() {
         FileReader fr;
         try {
              fr = new FileReader(f);
              String str;
              BufferedReader br = new BufferedReader(fr);
              try {
                   while((str= br.readLine())!=null){
                   generate=str;     
              } catch (IOException e1) {
                   e1.printStackTrace();
              } }catch (FileNotFoundException e) {
                   e.printStackTrace();
         return generate;
    where generate is a string declared globally.
    how to go about it?
    Thanks for your reply in advance

    If you want to copy files as fast as possible, without processing them (as the DOS "copy" or the Unix "cp" command), you can try the java.nio.channels package.
    import java.nio.*;
    import java.nio.channels.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    class Kopy {
         * @param args [0] = source filename
         *        args [1] = destination filename
        public static void main(String[] args) throws Exception {
            if (args.length != 2) {
                System.err.println ("Syntax: java -cp . Kopy source destination");
                System.exit(1);
            File in = new File(args[0]);
            long fileLength = in.length();
            long t = System.currentTimeMillis();
            FileInputStream fis = new FileInputStream (in);
            FileOutputStream fos = new FileOutputStream (args[1]);
            FileChannel fci = fis.getChannel();
            FileChannel fco = fos.getChannel();
            fco.transferFrom(fci, 0, fileLength);
            fis.close();
            fos.close();
            t = System.currentTimeMillis() - t;
            NumberFormat nf = new DecimalFormat("#,##0.00");
            System.out.print (nf.format(fileLength/1024.0) + "kB copied");
            if (t > 0) {
                System.out.println (" in " + t + "ms: " + nf.format(fileLength / 1.024 / t) + " kB/s");
    }

  • J2ME write into a file

    hello,
    I succeed to read a file which at the address "http://localhost:8004/hello.txt" but I don't succeed to write into a file which the same address
    How write into a file, in a midlet?

    An example using ASP:
    Set fs=server.CreateObject("Scripting.FileSystemObject")
    If fs.FileExists(Request.ServerVariables("APPL_PHYSICAL_PATH") & relative_path_and_file_name)=false then
         Set file=fs.CreateTextFile(Request.ServerVariables("APPL_PHYSICAL_PATH") & relative_path_and_file_name,true)
    Else
         Set file=fs.OpenTextFile(Request.ServerVariables("APPL_PHYSICAL_PATH") & relative_path_and_file_name,8) ' 8 is for append, 2 for overwriting
    End If
    file.WriteLine(some_text)
    file.close

  • How can convert HTML file into xml file?

    Hi,
    I am receving one HTML file as an input and i want to convert that receiving(html file) into .xml file.Is there any converter (tools)to do this.Pls if any give me the details with regard.
    Regards,
    mahesh.

    Use the HTMLEditorKit to parse the html file.
    this kit is having the callback methods which
    are called wenever the tag appears in the HTML
    stream.

  • How should convert text file into XML file?

    I do a project "WEB SERVER LOG ANALYZER" using JSP. For that i copy the content of log file into the other file . how i convert it into XML file . xplain with coding

    Read this [page.|http://www.devx.com/getHelpOn/10MinuteSolution/20356]

  • How Do I write an XML file using Java?

    Hello there!! to everyone reading my post.
    I have this project I need to do, and I have no clue where to start, I was wondering if you guys could help me out.
    I need to know how to write an XML file using a Java Program, but without using a Third party library.... just using java native APIs.
    I will probably take the values to construct the file from a form.
    I will certainly appreciate if you could post some sample code for me.
    Thank you very much in advance..

    Hello there!,
    I have some doubts about the Tutorial I am currently reading. correct me If I'm wrong, but the section "Write a simple XML file" teaches you how to do so using a text editor. I need to create my XML file from a running Java Program written by myself, that takes the values to build it from some variables.
    If I'm totally wrong about what I'm saying, could you please point me to where I can find the information of how to do what I'm asking for, inside the tutorial.
    Thank you very much,...
    sincerely.

  • How to convert database table into xml file

    Hi.
    How to convert database table into XML file in Oracle HTML DB.
    Please let me know.
    Thanks.

    This not really a specific APEX question... but I search the database forum and found this thread which I think will help
    Exporting Oracle table to XML
    If it does not I suggest looking at the database forum or have a look at this document on using the XML toolkit
    http://download-east.oracle.com/docs/html/B12146_01/c_xml.htm
    Hope this helps
    Chris

Maybe you are looking for