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

Similar Messages

  • How can (parse) i use XML file with missing EndTag

    hi,
    i have an application which writes an "XML file".
    another application should read that XML file, build an DOM and
    access the nodes with xpath.
    my problem. if the first application is not finished there are tags
    missing. e.g. </xml>. but the seconds application cannot wait until the first application finishes it task.
    if i now read the XML file the parser cannot load it because the end tags are missing.
    my question:
    how can i deactivate the check or how can i read the XML file and access it via XPath (my application is using at the moment XPath to access the nodes and i dont want to change that)
    as parser i am using XERCES
    alex

    As far as I know, you can't do this - xml must be well formed (this is sort of a bedrock of xml). There may be some work around's, but I'm not aware of any - and they would most likely be hacks.

  • How can I save a XML file with JAXP1.1?

    Dear All.
    I write a program to create XML file with DOM model, but I can't know how to save it? My environment is JAXP1.1 and JDK1.3.1,I has been required not use other XML parser toolkits,only JAXP1.1.
    How can I do? thank you.
    Many person give me a idea the com.sun.xml.tree.XmlDocument, but I can't find the class in API document or JAXP1.1's packages. why?
    what is it? How can i use it?
    thank you very much.

    The way to save an XML Document is using a Transformer.
    To have access to a transformer use the packages :
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    Then for saving your Document Object (named dXml) get a Transformer Object with the TransformerFactory Object :
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer();
    Now you have got your Transformer Object, to save your Document Object use the method :
    Document dXml = getMyDocument(); // this is your Document Object.
    OutputStream osSave = getMySaveStream(); // this the OutputStream you need to save your Document.
    try
    t.transform(new DomSource(dXml), new StreamResult(new OutputStreamWriter(osSave)));
    finally
    osSave.close();
    And your Document was now saved.

  • How can I pass a xml file to the webservice?

    Hello friends,
    How can I pass the XML file to any webservice API ?
    I have all the inputs of API in to the XML file.
    Please note:- I don't intend to do any .NET or Java coding to populate the data in the objects .Instead I plan to input the data to the webservice direcly from the XML file required schema.
    If necessary I can use Oracle Bpel process manager for it.
    Thanks and regards
    Ram Krishna Tripathi
    [email protected]

    Well, I've used it (or rather: tried it); did not/could not find the many options to export at a nearly lossless conversion for HD footage (hence my disclaimer "don't know"). Here is a screenshot of the Handbrake options:
    And here are the choices and settings from MPEG Streamclip:
    Maybe not empirical, but enough for me to have an opinion.

  • How can I open a cpr- file with snow leopard ?

    How can I open a " cpr " file with my Mac OS X 10.6.8. ?

    Thank you for your fast reply ! The recommended software referes to video data. I received the cpr file from the ALDI fotobook software, if a want to secure a footobook layout. Therefor cpr must be a foto file.

  • How can I automatically create the files with serie-name?

    Hello, Everyone,
    I have a question again.
    How can I automatically create the file with a serie-filename?
    e.g. I have a program, it will repeat 5 times, and every time it will create a bmp-file, and I want to let this program automatically save these 5 files with a Serie-filename like File001.bmp, File002.bmp, .... File005.bmp.
    How can I do it?`
    Thanks a lot.
    Regarts,
    Johnny

    Hi Deepu,
    one more comment
    The format code should be "%04d" to get leading zeros and have filenames with same length...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How to export a data as an XML file from oracle data base?

    could u pls tell me the step by step procedure for following questions...? how to export a data as an XML file from oracle data base? is it possible? plz tell me itz urgent requirement...
    Thankz in advance
    Bala

    SQL> SELECT * FROM v$version;
    BANNER
    Oracle DATABASE 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS FOR 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    5 rows selected.
    SQL> CREATE OR REPLACE directory utldata AS 'C:\temp';
    Directory created.
    SQL> declare                                                                                                               
      2    doc  DBMS_XMLDOM.DOMDocument;                                                                                       
      3    xdata  XMLTYPE;                                                                                                     
      4                                                                                                                        
      5    CURSOR xmlcur IS                                                                                                    
      6    SELECT xmlelement("Employee",XMLAttributes('http://www.w3.org/2001/XMLSchema' AS "xmlns:xsi",                       
      7                                  'http://www.oracle.com/Employee.xsd' AS "xsi:nonamespaceSchemaLocation")              
      8                              ,xmlelement("EmployeeNumber",e.empno)                                                     
      9                              ,xmlelement("EmployeeName",e.ename)                                                       
    10                              ,xmlelement("Department",xmlelement("DepartmentName",d.dname)                             
    11                                                      ,xmlelement("Location",d.loc)                                     
    12                                         )                                                                              
    13                   )                                                                                                    
    14     FROM   emp e                                                                                                       
    15     ,      dept d                                                                                                      
    16     WHERE  e.DEPTNO=d.DEPTNO;                                                                                          
    17                                                                                                                        
    18  begin                                                                                                                 
    19    OPEN xmlcur;                                                                                                        
    20    FETCH xmlcur INTO xdata;                                                                                            
    21    CLOSE xmlcur;                                                                                                       
    22    doc := DBMS_XMLDOM.NewDOMDocument(xdata);                                                                           
    23    DBMS_XMLDOM.WRITETOFILE(doc, 'UTLDATA/marco.xml');                                                                  
    24  end;                                                                                                                  
    25  /                                                                                                                      
    PL/SQL procedure successfully completed.
    .

  • How can I make an XML file print �, � and �

    When I write an xml file by hand I can use the European alphabet and the letters �,� and �. I can also write to an ordinary text file from my Java code and still be able to display the letters as they should.
    But when writing to an xml file in my Java code the letters are converted to some weird mishmash characters.
    Why is this? What can I do?
    // Elin

    I'm assuming you are working on a Windows computer (although you can run into this on any computer.)
    If you don't tell java the kind of character encoding you want, then you get an assumed desired character encoding - in Windows, the OEM characterset which does not include the characters you are trying to write.
    A way to handle this is to output the kind of file you really want - that is - with the encoding you want. I suggest you might try UTF-8, which you can get by simply instantiating your output writer with the encoding string "UTF-8".

  • 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 can I create a exe file with a tab control on it that work´s ?

    I have a VI with many controls and indicators,these are spread on a tab control.This tab control works with out any problems but if i create a exe file then the tab control is fixed. How can I create a exe file so that the tab control on it work´s ?

    I have made a new Posting with the same question but this time I added a screenshot of the VI.
    Attachments:
    project7.1.jpg ‏129 KB

  • How do I Ftp a XML file with out namespace attribute

    Hi All,
    How do I FTP an xml file that is validated against a schema on the ftp adapter with out the namespace attribute being added to the first and second element of the XML file.
    For example the xml looks like this when I transfer the file.
    <XML_Event xmlns="http://xmlns.oracle.com/PlannedEventSTORMRequestProcess/STORM">
    <Event_Begin xmlns="">
    <XML_File_Header>
    <Originating_System>xxx</Originating_System>
    <ID>387</ID>
    </XML_File_Header>
    </Event_Begin>
    </XML_Event>
    However I want it to be….
    <XML_Event>
    <Event_Begin>
    <XML_File_Header>
    <Originating_System>xxx</Originating_System>
    <ID>387</ID>
    </XML_File_Header>
    </Event_Begin>
    </XML_Event>
    How do i achieve this using the ftp adapter.
    Cheers

    Here is an example that will try to reach the given size in steps of 4 in quality.
    var saveFile = File(Folder.desktop + "/test");
    var fileSize = 70;
    try{
    tmpFile = File(saveFile+".jpg");
    for(var z =100;z>5;z -=4){
    SaveForWeb(tmpFile,z);
    var chkFile = File(saveFile+".jpg");
    //$.writeln(tmpFile + " qual = " + z + " Size = " +(chkFile.length/1024).toFixed(2) + "k" );
    if((chkFile.length/1024).toFixed(2) < (fileSize +1)) break;
    tmpFile.remove();
    if(!tmpFile.exists)  SaveForWeb(tmpFile,5);
    }catch(e){$.writeln(e + " - " + e.line);}
    function SaveForWeb(saveFile,jpegQuality) {
    var sfwOptions = new ExportOptionsSaveForWeb();
       sfwOptions.format = SaveDocumentType.JPEG;
       sfwOptions.includeProfile = false;
       sfwOptions.interlaced = 0;
       sfwOptions.optimized = true;
       sfwOptions.quality = Number(jpegQuality);
    activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

  • How can I write to a file from a livecycle designed PDF?

    I am producing a PDF in Livecycle designer and would like to write a sub-set of data from the document.
    I have tried methods such as exportData() but this exports everything which i don't need.
    I have seen another method which is to attach a file and write to that but ideally I'd just like to be able to create a new file.
    var data = xfa.data.nodes.item(0).nodes.item(1).saveXML()  var oFile = util.streamFromString(data , "utf-8");
    I would like to write oFile.
    Thanks in advance
    Edit:
    I would like to add that ideally the user would be presented with a save as dialog  box, so the can choose the location of where to save the xml data.

    an extraction out of expert one-on-one from Thomas Kyte
    <quote>
    when an oracle istance is created the services that support it are setup to 'log on as' the system (or operating system) account, this account has very few privileges and no acces to Window NT Domains. To access another Windows NT machine the OracleServiceXXXX must be setup to logon to the appropriate Windows NT Domain as a user who has acces to the required location for UTL_FILE.
    To change the default logon for the Oracle services go to (in Windows NT):
    Control Panel | Services | OracleServiceXXXX | startup | log on as; (where XXXX is the instance name)
    In Windows 2000, this would be:
    Control Panel | Administrative Tools | Services | OracleServiceXXX | Properties | Log on tab; (again XXXX is the instance name)
    Choose the This Account radio button, and then complete the appropriate domain login information. ONce the services have been setup as a user with the appropriate privileges, ther are two options dfor setting UTL_FILE_DIR:
    * Mapped Dirve: To use a mapped drive, the user that the service starts as must have setup a drive to match UTL_FILE_DIR and be logged onto the server when UTL_FILE is in use.
    * Universal Naming Convention: UNC is preferable to Mapped Drives because it does not require anyone to be logged on and utl_file_dir should be set to a name in the form \\<machine name>\<share name>\<path>
    You will of course need to stop and restart Oracle after changing the properties of the service.
    <\quote>
    I want to write some data to a (external) file. I have it working with the function UTL_FILE.
    My problem is I want to write to a file on a mapped drive (so a drive on a different machine). This is not working.
    Does anyone know a way to build this.
    Please send your responses to [email protected]
    Many thanks,
    Alex Nagtegaal

  • Can I route non-XML files with NW PI 7.0?

    Hello,
    I have NW 7.0 PI installed. I need to implement very simple scenario:
    1. There are two folders Source and Target
    2. Any file (non-XML, binary for example) comes to the Source folder
    3. File needs to be picked up and routed without any modifications to the Target folder
    Questions:
    1. Can I implement that with NW? I guess I can
    2. How do I do that? Is there any example or some description of implementing such a simple scenario (I have a few samples on how to implement complex scenarios that work with XML files, but I don't need that complexity)
    Thanks in advance.

    Hi,
    Check out the Sravya's blogs for starters, It has lot of links which will help you to learn various pieces of XI.
    Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part I
    Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part II
    Aspirant to learn SAP XI...You won the Jackpot if you read this!-Part III
    Thanks,
    Pooja

  • How can I return an xml file to normal print?

    I typed out a list of CD and saved it but it is filed in xml format and I don't know how to return it not normal print so that I can print it out.  As you may realise I am not very computer literate! Please can someone help.Thanks

    coda, textwrangler, textedit should all be able to open and display xml files
    but there is no direct print or word proccessor route from xml it's a broad format it's
    just tags and how those tags are read and write are up to the program which writes and read the file in question
    so you may end up having to fish out the text you want to print from inside X different tags in the file
    xml can be seen as a text version of .dat which is the binary counterpart

  • How can I upload and download files with uiXML?

    I want to implement upload and download files with uiXML. In some previouse topic I got answare to look in AbstractPageBroker class in JavaDOC. I did it but this is a very-very little resolution description for this problem. I think for developers YOU (UIX Team) must in very quick time to put some examples on the NET because this is a nice technology but with adecvate samplase and developers guide it will be dead very soon. I digging this forum for information. I see many many people have same problems about this technology. They like it and want to use and try but documentation is very very poor.
    WE WANT EXAMPLES and separate forum for UIX. I think it deserve this.
    If You have any more detailed documentation would be nice to put on the net. I have uixdemo.zip file but this is in very early fase of development. I downloaded it before fwe months. And now I can't find it anymore on youre site. What happend?

    Attila -
    I went back and re-read the JavaDoc for AbstractPageBroker and MultipartFormItem and put together the following sample PageBroker based on the description from the JavaDoc:
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletContext;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.Page;
    import oracle.cabo.share.util.MultipartFormItem;
    import oracle.cabo.servlet.xml.UIXPageBroker;
    * An extension of UIXPageBroker which stores all uploaded
    * files in the temporary directory.
    public class UploadingPageBroker extends UIXPageBroker
    * Override of AbstractPageBroker.doUploadFile() which saves
    * all files to the temporary directory.
    protected String doUploadFile(
    BajaContext context,
    Page page,
    MultipartFormItem item) throws IOException
    // Get the location of the file to create in the temp directory.
    // Of course a real application probably wouldn't upload files to
    // the temp directory - just using this contrived example to
    // demonstrate basic uploading support.
    File file = _getFile(context, item);
    if (file != null)
    // Create a FileOutputStream. Of course, a real application would
    // probably want to buffer the output
    FileOutputStream out = new FileOutputStream(file);
    // Write out the file
    item.writeFile(out);
    // Close up the output stream
    out.close();
    // We can return a value here to add to the PageEvent
    // if so desired.
    return null;
    // Gets the File for the item that we are uploading
    private File _getFile(
    BajaContext context,
    MultipartFormItem item
    // Get the file name
    String name = item.getFilename();
    // If we don't have a file, bail...
    if (name == null)
    return null;
    // Get the path to the temporary directory
    File dir = _getTempDir();
    // Return the File object
    return new File(dir, name);
    // Returns the path to the temprary directory
    private File _getTempDir()
    // Get the temporary directory from the ServletContext
    ServletConfig sConfig = getServlet().getServletConfig();
    ServletContext sContext = sConfig.getServletContext();
    return (File)sContext.getAttribute("javax.servlet.context.tempdir");
    In this sample, each uploaded file is simply saved in the temporary directory. You'll want to replace the code that creates the FileOutputStream for the uploaded file to use whatever OutputStream makes sense for your application.
    BTW - I used the following UIX page to test this out:
    <?xml version="1.0" encoding="UTF-8"?>
    <page xmlns="http://xmlns.oracle.com/uix/controller">
    <content>
    <pageLayout xmlns="http://xmlns.oracle.com/uix/ui">
    <contents>
    <form name="uploadForm" usesUpload="true">
    <contents>
    <fileUpload name="uploadedFile"/>
    <submitButton name="upload" text="Upload"/>
    </contents>
    </form>
    </contents>
    </pageLayout>
    </content>
    </page>
    Hope this sample helps with the uploading part of your question. I'll see if I can provide a download sample in a later post.

Maybe you are looking for

  • SpamAssassin's AWL database growing and growing

    I know that this is a known problem, but maybe someone has found a solution in the meantime that did not came to my attention: I'm using the auto whitelist feature of SpamAssassin. Unfortunately I'm forced to erase the entire database from time to ti

  • Calling PL SQL in a Javascript function

     

  • Where should my videos go?

    I recently upgraded my Hard Drive from 80 to 500Gb. In the past I have stored my video clips of my kids, from my cannon elph point and shoot camera, on an external hard drive, not on my Macbook hard drive. But, I find that I never see the video becau

  • I want to cancel the subcription but there is no cancel Button

    Hi, I want to ask about how to cancel the my subscription. I check the subscription cancel guide provide from Adobe but I figure out a problem. Image at below is subscription which I want to cancel. PS : I'm using CC service at South Korea so every t

  • Basic Java - On file name

    if a java class is not a public class, we need not want to give its class name as file name. why ..... ? Kindly answer...