How to build a xml file dynamically with given data.

hi there
i need to create a writer that can create a xml with some given data. what is the procedure of creating a xml file? if it is possible, please post some samples, thank you.

I would reccomend JDOM, although it is not the only way(DOM is another), i have found it the easiest document model to work with. http://www.jdom.org
the code is as easy as:
Document doc = new Document();
Element root = new Element( "element-name" );
root.setAttribute( "id", "1234" );
doc.setRootElement( root );
etc etc

Similar Messages

  • How to set connecting database file dynamically with MS-Access?

    I have to manipulate data in the MS Access file,
    and the file name is dynamically according to date.
    If there is any method to do this.
    In the OCA documents, it say we can use
    'username/password@odbc:<data_source_name>:<database_name>'.
    But it can not work.

    The following forum thread might be enlightening:
    http://forum.java.sun.com/thread.jspa?threadID=573855&messageID=2870785
    I myself do not use MS Access, but a PreparedStatement is in general the best option.
    You can set parameters in the SQL which then get converted and even protected against SQL injection hacking.

  • How to create an XML file from a given EDI file?

    Hi All,
    I am trying to write some BPEL processes that will be sending EDI Documents to Integration B2B using the AQs.
    BPEL works with XML data and finally enqueues it to the AQ IP_OUT_QUEUE. From there B2B will pick up and send to Trading partner. I have sample EDI documents but they are not xml. Can anyone tell me if i can convert these EDI docs to XML?
    Can the EDIFECS builder be of any use here?
    TIA,

    B2B adapter? I just want some test data. Finally the setup is going to be such that some xml is going to be posted to the B2B internal channel and then on it will translate and send to Trading Partner.

  • Load a XML file 47mbyte (with records data) in the RTF

    I load a XML data in the RTF file, but when I tried generate the EXCEL file, it get a error.
    Can somedy help me?
    Thanks.

    Can you paste the error message here?

  • Generate XML file dynamically using java

    Hi,
    I searched on this topic on the net and also in this forum but everything leads to parsing an existing file using JAXP technology. But i need to create an xml file dynamically from the data coming from a different source. I can do it manually by writting the content to a file. But i am sure there is a better way for it. I would be obliged if some one could give me and example java class which produces a simple xml file or direct me to any resource online.
    Thank you in advance.

    Yes you can create the xml file dynamically. Like this,
    BufferedWriter bw = new BufferedWriter(new FileWriter("xyz.xml"));
    bw.write(buffer.toString()); //where buffer is StringBuffer whcih contains the your xml data
    bw.close();
    Remember to close the BufferedWriter, otherwise it will create the file but don't write anything.
    Hope this will help u.
    ....yogesh

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

  • How to find PG.xml file name and path associated with a FUNCTION

    Hi,
    I am having a function:IRC_VIS_HOME_PAGE with Web HTML value as below:
    OA.jsp?akRegionCode=IRC_VIS_HOME_PAGE&akRegionApplicationId=800&OAPB=IRC_BRAND
    How to find PG.xml file name and path assoicated with above funtion.
    Thanks,
    ashok

    Ashok,
    Function IRC_VIS_HOME_PAGE will have 2 parameter defined for it which are OASF and OAHP where
    OASF=<SelectedFunctionName> - this tells the Framework to select this function in the given "Home Page" menu context.
    OAHP=<HomePageMenuName> - this is used ONLY with the OASF parameter, and it is used to establish the current menu context. It should point to a "Home Page" menu.
    --Shiv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Xml publisher enterprise!!! create rtf file dynamically with load xml data

    i am new to xml publisher enterprise , i want a solution for this question ...
    i want create rtf file dynamically with loading xml data....means i wrote a program in jsp where the the output in xml file simultaneously create rtf file..but i enable load the xml data in rtf file but when i goto rtf file from where data in that load xml then it genrate the columns..but i want in dynamiclly to load the data will you please guide me ......

    Hi Atiq
    Im not quite clear on the requirement here:
    1. Do you just want to be able to extract the data and apply a template to the XML data from your jdp and render output?
    If so then you can use the XMLP APIs ... the are in the user guide. Particularly:
    RTFProcessor - converts RTF template to XSLFO stylesheet
    FOProcessor - takes, XML data, XSLFO stylesheet and output format and generates the required output.
    2. Do you want a template that will accept any data and just format it into rows and columns ? This can be written but your XML structure is going to have to be static, the data of course can be dynamic.
    Regards, Tim

  • Binding XML file Dynamically

    Can I bind a xml file dynamically to a form? say, bind to a different xml file after user select a value from a drop down list in the form?how to do it? Thanks.

    I think it's best to create different XPD files for each language and add an XML tag <language>countryCode</language> to your XML dataset and XSD file. this way you could tell the workbench to use a different xpd file for generating the PDF file.
    Anyway if you want to load an XML file from your local filesystem you should check out this URL: http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm it shows you how to read & write files using javascript.
    The problem you'll be facing is editing the binding and reading + validating the given XML file. Especially validating the XML vs the XSD file used in the designer will probably cause a few errors, yet this is highly recommended in order to make sure you're not modifying your PDF with the wrong (or even malicious) data.
    Security-wise i would not implement it your way but make a different XPD file for each language. In the LiveCycle Workbench you can select the correct XPD file based on the data you provide. Then it's just the user who needs to specify his/her language and your pdf is always build correctly. Yet I do not know if this is applicable to your situation and/or needs.

  • Urgent, creating xml files dynamically, request dispatcher problem

    hi all,
    Problem 1:
    There is a problem we are facing, while request dispatching.
    The files CBECBC.XML & CBECBC_Envelop.XML,
    both xml files. These files are created on request from the user, dynamically, and displayed on the browser,
    by including them in a jsp page.
    Here we face a problem when they are to be included into the jsp page.
    The error is the following :
    //////// Error ////////
    Could not find request dispatcher for the url CBECBC.xml
    Could not find request dispatcher for the url CBECBC_Envelop.xml
    The created files are stored in the "d:\pstudio35\desks\bank\BankWeb\".
    We are using " <jsp:include page="...."/> " (dynamic jsp include tag), to include the xml files.
    Problem 2:
    And could you just let me know how to include a xml file in a jsp file,
    so that the xml file is displayed in the exact format of xml(with the tags).
    I am using Pramati Studio 3.5
    Its urgent!!!
    Regards,
    Deepa Datar

    problem 2:
    either translate all < en > into < and > or display the XML in a textarea

  • Building an XML file

    I'm trying to build an XML file in Java to persist data for an application between sessions. I'd like to build a structure like this
    <Files>
    <Entry>somefile.txt</Entry>
    <Entry>otherfile.txt</Entry>
    </Files>
    How can I do this using JDK 1.4? I've figured out how to generate it with attributes:
    <Files>
    <Entry entry=somefile.txt/>
    <Entry entry=otherfile.txt/>
    </Files>
    But that's not the way I need to do it. Can anyone make a suggestion?
    Thanks.

    You need to create Text nodes and append them to your Entry nodes. Say you have a Document, doc:
    Element files = doc.createElement("Files");
    doc.appendChild(files);
    Element Entry = doc.createElement("Entry");
    files.appendChild(entry);
    Text text = doc.createTextNode("somefile.txt");
    entry.appendChild(text);Output:
    <Files>
    <Entry>somefile.txt</Entry>
    </Files>
    Hope that helps.

  • How to Merge multiple XML  files in one file ( Env: XML Publisher 5.6.2)

    All,
    I have recently started working on XML publisher and have developed 3 reports in last 2 days using XML Publisher and integrating them with Concurrent programs.
    This is a great tool.
    I have got another requirement, where i need to use xml file generated by multiple run of same report with various parameters and then merge all xml file to a single report. Developing the whole custom process will take very long time and sure will have bugs in it. Instead i was thinking to use xml file generated by Oracle report itself.
    Report "US Gross to net summary" generates xml output in standard output directory and then show output in PDF file. I have 7 such file generated for each payroll. I want to merge output of xml into a single xml so that i can create single report having data from all 7 xml files showing me All payroll output in a single report.
    Can someone please guide me , how can i read xml file data from the output directory of a seeded concurrent program and how to manipulate data in it.
    Thanks
    Ankur

    Hi Tim,
    Thanks for replying. I have looked for "PDFBookBinder class" in xml publisher user guide for ver 5.6.2. I didn't get any reference of this text. Can you please guide me to a tutorial/link where i can get more information about this class.
    Also, i originally thought of similar to your second logic, as my design basis. Oracle process generates the xml file in output directory which i can get. What i didn't get is how do i "pick them up and merge" using publisher. Also, is there way to do this merging process using pl/sql ? Can you please give little more information on your second approach.
    My original plan of action is that i will create a report set in which i will call oracle seeded report for all 7 payrolls in a sequential manner. Then using the child requests of the report set i will get to 7 xml files generated by seeded oracle process. Then the piece i am not sure of , i will use those 7 files to generate a single xml file having payroll name as tree top for each output. Once single xml is ready, i can easily design a template and register the process to generate output as Excel.This process will not require me to actually change any data or do any calculation. It will only reformatting the feilds we see and abiity to see all 7 payroll at one time rather then entering these numbers manually into an excel to do analysis.
    Please provide your feedback, if you think above plan is not feasible or need corrections.
    Best Regards,
    Ankur

  • How to create a textfile dynamically(with in the loop) with given data?

    Hi all,
    Can anyone Please guide me how to create a text file in the given path dynamically? (with in the loop) with given data.
    For example:
    <%
    String data1="name";
    String data2="address";
    for(int i=0;i<10;i++)
    create the textfile at c:/test/sample.txt//name of the each file created being "sample.txt"
    //contents of text file will be
    data1+i; //to get name1,name2.....
    data2+i// to get add1,add2........
    delete(sample.txt) //to enable to create another file in the loop with same name
    %>

    The code which Ashokan mentioned is not is not creating a file.
    i used code given below to create and write into it.
    But, not is writing into it. I don't konw, where i am going worng !
    Code
    String sample2="C:/Ash/sample2.txt";     
                                                                                    FileWriter fw = new FileWriter(sample2,true);
                                            BufferedWriter bw=new BufferedWriter(fw);
                                            bw.write("EMP ID");     
                                            bw.newLine();
    Please help
    Regards
    aSh

  • Does anyone know how to convert an XML file to a readable file?

    All,
    I have been using an APP called "SMS Backup & Restore" to backup my message conversations to my Laptop PC.  It works fine BUT the backup file, once in my PC, has an XML extent such as "filename.XML"
    I would like to read and/or print and/or save the text message file so does anyone know how to convert the XML file to something else so it shows all the messages without all the formatting instructions.   
    When I try to see the XML file it shows all the formatting.  If I replace the .XML with .TXT that too shows all the formatting mixed in with the text message narrative.
    When I look at the XML file in SMS Backup & Restore in the Charge phone it looks great showing all the messages just as they were on the phones display.  The problem with this is that there is no way to print or read or save the messages as they appear in the file from the phone itself.  I tried screen capture but if you have, let's say, a 28 message conversation you have to do 7 or 8 screen captures to get them all.
    If only I could convert the XML in my PC to something that is printable or savable or readable that would be the "cats meow."
    Anyone know how???
    JerryF
    PS, You might take a look at my related post.
    https://community.verizonwireless.com/message/809832#809832

    Ann154,
    You were correct again.  I deleted everything I had done to date and re-did the entire SMS backup of my 28 message conversation again and YES I was able to open it using IE-8.  It looks great and it prints great and life is good!  I am going to go make a donation.
    Thanks again for the help.  I marked this thread as answered by you.
    JerryF

  • How to transfer a xml file?

    Dear friends,
    I have a question about how to transfer a xml file between server and client using axis or weblogic.
    My application needs to send xml files instead of primitive data types and bean objects.
    Is it possible to tranfer files between server and client?
    thank you very much for your great help!
    jayanandan.

    hi,
    There are two ways in which u can send an xml file.
    1) U send it along with the body of the soap message.
    2)u can send it as an attachment in the soap envelope. this method u can use for any type of files.
    If u send it in soap body the it will take more time for the processing of the soap body.so attachment is the best way.
    I case of any queries please feel free to post it in the forum
    Regards
    Sandy

Maybe you are looking for