Generating a XML file from a JSP request Page

Hi,
I am very new to JAVA with XML. My need is i want to capture some data in in a JSP page then after submitting ,it will generate a XML file. How can i do that??? Any help will be highly appriciated. If anybody can give me a good example....
Thx

<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
Are you using our XML SQL Utility that comes with the Oracle XDK for Java? Is the correct result produced, but you are having trouble writing it to a file?<HR></BLOCKQUOTE>
hi steven,
yes i am using xml sql utility and have solved the problem..... as i was working from a remote system i didnot give the correct path that is the c:\.....etc of the machine i was giving http:// thats why i did not write to a file... now its working

Similar Messages

  • Generate an XML file from a DOM tree

    Hi,
    I'm trying to generate an XML file from a DOM tree that I obtained from another XML file with the Xerces library. I used the following operation :
    public static void writeXmlFile(Document doc, String filename) {
    try {
    Source source = new DOMSource(doc);
    File file = new File(filename);
    Result result = new StreamResult(file);
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.transform(source, result);
    } catch (TransformerConfigurationException e) {
    System.err.println(e);
    System.exit(1);
    } catch (TransformerException e) {
    System.err.println(e);
    System.exit(1);
    But I have this Windows/Linux problem. When I execute this on Windows, everything is correct. But if I try on Linux (every distribution does the same thing), I obtain an XML file where everything is written on just ONE LINE : there is neither identation nor carriage return at the end of a line ... And that is pretty annoying 'cause I need to SEE what I generate ...
    Thanks for your answer,
    Blueberryfin.

    Actually I would think that no indents and no new-lines would be more correct, but maybe it's an option for parsers to do it either way if you don't specify it. If you want to specify it, look at this post from last month:
    http://forum.java.sun.com/thread.jsp?forum=34&thread=383400

  • How I could generate an XML file from a report in version 4.0B

    Good morning,
    How could I generate an XML file from a report? Please note that I am using version 4.0B
    I don't have access to
    Billy Vital

    Hi,
            In the Class CL_XML_DOCUMENT,
                 we have a method  EXPORT_TO_FILE to download an XML file.

  • Writing XML file from a jsp page

    how can i write a xml file from my jsp and store the values and after sometime, for example when the user clicks on the submit button, i check the values from xml file and compare those values from the data base.
    it means both writing and reading xml file from a jsp page...
    urgent help needed......thanks

    You need some API like XSL or JDOM to read data from/to XML file
    you can get a best tutorial from
    http://www.javaworld.com/javaworld/jw-05-2000/jw-0518-jdom.html
    and
    http://www.javaworld.com/javaworld/jw-07-2000/jw-0728-jdom2.html
    after reading both articals you will be able to do both the tasks

  • How to generate a XML file from a XML schema...?

    Hi guys...!
    I have a XML schema and I want to write a XML file based on that schema. I have heard about this feature that eclipse has, which given a XML schema, can generate a XML file for you.
    Does anyone of you know about this feature? or is there another way to do it. The schema that I have is very huge...
    I will really appreciate any help from you guys...
    Thank...you..
    --- Spirit Away...

    don't cross post
    http://forum.java.sun.com/thread.jspa?threadID=649205&tstart=10

  • How to generate an XML file from SSIS (based on an XSD)?

    I have an XSD that describes an XML format. I also have a sample XML file as well from the XSD. I am trying to understand SSIS's capability to generate the XML file in an ETL process. I would need to create the XML file based on the XSD that
    I have. It is safe to assume that all the data elements are in the DB that I am incorporating in the ETL and it is also safe to assume that the data in the XML may be from multiple different tables (so massaging is probably necessary). 
    Would this be a job for C#/VB or can I do this through an SSIS process/task? Please help me understand my options. Thanks.

    Dear All,
    Indeed the post by RamJaddu did not answer the question. I am having the same issue: I have been provided an .xsd file which contains a data schema, and I have all of the necessary
    data in a .mdf file in order to create the required .xml file. Having queried SQL Server and received my data in "myDataSet" I can use C# to create the .xml ignoring the schema using
    string strSchemaFile = @"F:\Documents\UserCost\VictorianDataCollection\VCDCSchema_v2.xsd";
    string strXmlFile = "testXmlExport.xml";
    myDataSet.WriteXmlSchema(strSchemaFile);
    myDataSet.WriteXml(strXmlFile, XmlWriteMode.IgnoreSchema);
    but how do I export the .xml file so that is conforms with the .xsd format?
    If any of you have worked this out the answer would be most appreciated.
    All the best,
    Nick
    "Everything should be made as simple as possible, but not simpler" - Einstein

  • Generate multiple XML files from one Invoices file in AR Selected Invoices

    I have converted our Oracle EBS 11i Selected Invoice RAXINV.rdf to XML and created a template for XML Bursting. I'm bursting fine at the:
    /ZRAXINV/LIST_G_ORDER_BY/G_ORDER_BY/LIST_G_CF_NO/G_CF_NO. My question is since I'm writing out my pdf output invoices to the filesystem on Sharepoint; I also need to archive the XML part of each invoice broken down by the same group as .//LIST_G_CF_NO/G_CF_NO. When I convert the rdf to XML it produces one XML file from which I created the templates.
    My requirement is to archive both the individual invoices from the templates and the corresponding XML pieces on Sharepoint so that we will be able to search and link the xml to the pdf written out to the filesystem on Sharepoint.
    Any idea how should go about this requirement will be much appreciated.
    Thanks,
    Leo

    So how does it take this file
    file>
    <statement>
    <name>John Dow </name>
    <address>123 Main</address>
    <phone>972-213-3434</phone>
    </statement>
    <statement>
    <name>Jane Dow </name>
    <address>345 Main</address>
    <phone>972-213-3534</phone>
    </statement>
    <statement>
    <name>Marry Dow </name>
    <address>678 Main</address>
    <phone>972-213-3435</phone>
    </statement>
    </file>
    and create these three different one?
    1.)
    <statement>
    <name>John Dow </name>
    <address>123 Main</address>
    <phone>972-213-3434</phone>
    </statement>
    2.)
    <statement>
    <name>Jane Dow </name>
    <address>345 Main</address>
    <phone>972-213-3534</phone>
    </statement>
    3.)
    <statement>
    <name>Marry Dow </name>
    <address>678 Main</address>
    <phone>972-213-3435</phone>
    </statement>
    Is it not going to just grab each element after the file tag? I'm just confused about that.

  • Best way to generate the XML files from a DTD file

    Hey,
    I am writing an application that needs to convert a complicated data structure into an xml file. I have design a DTD file that describes the data structure.
    My question is what is the best, most efficient way to covert the data structures (objects) into the XML files with a DTD file.
    Thank you very much.
    Candy

    Convert the DTd to an XML Schema. Generate java classes from Schema with Jaxb. Create an XML document from the java classes.

  • Generate an xml file from Database query results

    Hi, can anyone help me out with this problem I'm having. What are the steps in creating an xml file directly from the results of a database query. I currently have a very simply process that queries a database via a partner link. The query returns the data but it's from this point that I am stuck. I need to create an xml file with the data along with the xml tags. I've looked at dozens of tutorials with no luck.
    I would greatly appreciate help with this.
    bpel rookie

    Should be quite simple.
    Create another partnerlink, configure it to use the file adapter, and write to an XML file. In this case you need to create an XML Schema (.xsd) of the file you want to create.
    Before you write to the file, either add assign steps to copy individual attributes or use a transform activity to convert from the database format to the file (xml) format.

  • How to generate an xml file from a soapbody

    i'm trying to use SOAPMESSAGE from a webservice as a Datasource for my JasperReport, I'm thinking of doing it as getting the SOAPBody and saving it as xml file and setting that xml file as datasource to my JasperReport. My problem is how will a get the SOAPBody and save it as an xml file? or is there other way to make SOAP from webservice as a datasource for my Jasperreport?
    Thanks in advance for your help.

    Dear All,
    Indeed the post by RamJaddu did not answer the question. I am having the same issue: I have been provided an .xsd file which contains a data schema, and I have all of the necessary
    data in a .mdf file in order to create the required .xml file. Having queried SQL Server and received my data in "myDataSet" I can use C# to create the .xml ignoring the schema using
    string strSchemaFile = @"F:\Documents\UserCost\VictorianDataCollection\VCDCSchema_v2.xsd";
    string strXmlFile = "testXmlExport.xml";
    myDataSet.WriteXmlSchema(strSchemaFile);
    myDataSet.WriteXml(strXmlFile, XmlWriteMode.IgnoreSchema);
    but how do I export the .xml file so that is conforms with the .xsd format?
    If any of you have worked this out the answer would be most appreciated.
    All the best,
    Nick
    "Everything should be made as simple as possible, but not simpler" - Einstein

  • How to create a xml file from the jsp page?

    I'm a beginner of the develop xml,my question like this,
    there has a jsp page,some parameters in it,I wanna get the parameters and create a xml file,so,what parser method should I use?
    And how to create a new xml file,when the file haven't exist at first?
    pls give some code,thanks.

    a ggod link for u http://www.theserverside.com/resources/article.jsp?l=JSP-XML2

  • Generate to XML file from a SBO system form ....

    Hi gurus,
       If I remember right, a standard form (ex:A/R invoice, A/P invoice ...) in the SBO system, we can ganerate to XML file. But I don't remember how to do it, anybody know about it, pls help me, tell me ... pls. Thanks.

    Hello Andy,
    The answer of your question could be found in SAP samples, UI API sample 4.(default path C:\Program Files\SAP\SAP Business One SDK\Samples\COM UI\VB6\04.WorkingWithXML)
    The code is below.
    There are lots of samples delivered with SDK, and I think you would benefit a lot from them.
    HTH,
    Nick
    Private Sub SaveAsXML(Form As SAPbouiCOM.Form)
    '// Add a reference to "Microsoft XML, v3.0"
        Dim oXMLDoc As MSXML2.DOMDocument
        Dim sXMLString As String
        Set oXMLDoc = New MSXML2.DOMDocument
        '// get the form as an XML string
        sXMLString = Form.GetAsXML
        '// load the form's XML string to the
        '// XML document object
        oXMLDoc.loadXML (sXMLString)
        '// save the XML Document
        Dim sPath As String
        sPath = CurDir
        oXMLDoc.save (sPath & "MySimpleForm.xml")
    End Sub

  • Best Practices:: How to generate XML file from a ResultSet

    Hi all,
    Could someone please suggest the best practices of how to generate an XML file from a resultset? I am developing a web application in Java with Oracle database and one of my tasks is to generate an XML file when the user, for example, click a "download as XML" button on the JSP. The application is basically like an Order with line items. I am using Struts and my first thought has been to have an action class which will extend struts's DownloadAction and through StAX's Iterator API to create an XML file. I intend to have a POJO which will have properties of all columns of my order and line items tables so that for each order I get all line items and:
    1. Write order details then
    2. Through an iterator write line items of that order to an XML file.
    I will greatly appreciate for comments or suggestions on the best way to do this through any pointers on the Web.
    alex

    Use a OracleWebRowSet in which an XML representation of the result set may be obtained.
    http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/oracle10g/webrowset/Readme.html
    http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/jcrowset.htm

  • How to Generate XML File from Java Code.

    I want to generate the xml file from the java code.
    Could you plz suggest any webSite address with example?

    Here is the code
    import java.io.File;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.FactoryConfigurationError;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerConfigurationException;
    import javax.xml.transform.TransformerException;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    public class CreateXML {
         private DocumentBuilderFactory factory = null;
         private DocumentBuilder builder = null;
         private Document document = null;
         public CreateXML() {
              try {
                   factory = DocumentBuilderFactory.newInstance();
                   builder = factory.newDocumentBuilder();
                   document = builder.newDocument();
              } catch (FactoryConfigurationError e) {
                   e.printStackTrace();
              } catch (ParserConfigurationException e) {
                   e.printStackTrace();
         /** Creates the document for xml. */
         public Document createDocument(){
              try{               
                   Element root = document.createElement("Root");
                   Element child = document.createElement("child");
                   root.appendChild(child);
                   document.appendChild(root);
              }catch(RuntimeException e){
                   e.printStackTrace();
              return document;
         /** Saves the document as xml. */
         public void saveDocument(Document document){
              try{
                   TransformerFactory transFactory = TransformerFactory.newInstance();
                   Transformer transformer = transFactory.newTransformer();
                   DOMSource source = new DOMSource(document);
                   StreamResult stream = new StreamResult(new File("sample.xml"));
                   transformer.transform(source, stream);
                   System.out.println("XML Created !!");
              }catch(TransformerConfigurationException e){
                   e.printStackTrace();
              } catch (TransformerException e) {
                   e.printStackTrace();
         public static void main(String args[]){
              CreateXML createXML = new CreateXML();
              Document document = createXML.createDocument();
              createXML.saveDocument(document);
    }

  • Generating xml file from database table

    Could anyone please explain how to generate a xml file from a database table.examples will be highly appreciated.
    thanks in advance

    See the release notes for our XSQL Pages component of the Java XDK for a tutorial. There are also lots of examples in Building Oracle XML Applications.
    You use the XML SQL Utility component to accomplish the task. It's part of our Java XDK that you can download from http://otn.oracle.com/tech/xml

Maybe you are looking for

  • Oracle View that stores the Query execution time

    Hi Gurus i m using Oracle 10G in Unix. I wudiold like to know which Data dictionary view stores the execution of a query. If it is not stored then hw to find the query execution time other than (Set timing on) command. What is the use of elapsed time

  • Java on Solaris 10

    Dear All, I need some guidance on Java version compatibility and configuration with Solaris 10. We are having SunOS 5.10 Generic_144488-17, but in the DSEE installation we have used JES 5 which have built in problems, which actually de graded system

  • Help needed with the script

    Hi all, I am a novice in scripting... Could someone help me writing script for the following.... Assume that there are 5 folders 1 /etl/dev/work/wellness/enrl_rej/records 2 /etl/dev/work/wellness/enrl_rej/metadata 3 /etl/dev/work/wellness/enrl_rej/he

  • CM2320 Printer Duplex question

    Hi We had our CM2320 replaced by HP due to a technical fault about a year ago.  I know this has taken a while but only one machine can now print duplex successfully.  The other two machine must print duplec manually.  As in print pages then reverse t

  • Time machine logs

    Does anyone know where the Time Maching backup logs are with OS-X 10.10.2? They don't show up in the Console window but do show in the widget for the Time Machine. It would be nice if Apple posted some of the minor changes and tweaks they make with v