About XML file operation

I want to get the configuration of my programme by reading the XML file.But I am not familiar with the class of handling XML file in java.Someone can give an example to me and simply explain.Thank you very much.

That link over at the left there, the one that says "Tutorials"? Follow it to a page full of tutorials. From that page follow the link to the tutorial about Web Services.

Similar Messages

  • Problem about .xml file from PPro CS5 to FCP with RED and P2 file.

    I have create a Project in Premiere Pro CS5.
    I import the RED file R3D or P2  file XMF and editing my media.
    From menù File i select Export to "Final Cut Pro XML.."
    I open FCP and Import file XML but the media are not reconnect.
    "Warrnig: Non-critical error were found while processing an XML document.
    Would you like to see a log of these error now?"
    I want see the log file and...
    "<file>: Unable to attach specified media file to new clip."
    Where is the problem?

    Hi Dennis I re-format my MACPRO 8 Core and I installed Final Cut Studio Suite and CS5 Premium (no CS4)
    I install Blackmagick driver Decklink 7.6.3
    If I open the After Effects  and setting preview card blackmagic, I see the preview in external monitor.
    If I open the Premiere Pro and setting preview, I don't see the blackmagic card but the second monitor, DV....etc.
    In Premiere I see the blackmagic preset, but no the preview card.
    I have a second question.
    About Red file I want editing in Premiere Pro and i whant color correct in Apple Color from FCP.
    My problem is: my color program crash when I send file form FCP to Color (random mode)
    The sequence is:
    I import file red in PPro5 -- editing file --- export file xml.
    Close the PPro5.
    Open FCP import xml (no re-link media)
    Save de project in FCP
    Select sequence and send to Color.
    In this moment the Apple Color crash.
    I shutdown the MAC.
    I power-up the MAC
    Open FCP select the project and send the sequence to Color.
    Color see the project but no media.
    I re link the media and I editing in color my media.
    Why Apple Color program crash?
    Sorry for my English
    Many Thanks
    Distinti saluti
    Gianluca Cordioli
    Alchemy Studio'S di Gianluca Cordioli
    Via Pacinotti 24/B
    37135 VERONA
    cell.:+39 3385880683
    [email protected]
    www.alchemystudios.it

  • Access Denied error with basic XML file operations

    Hi,
    I'm trying to set up a basic read, write and delete code for XML files which I can build upon in the future. The three methods are bound to three buttons on the page and all three calls are awaited. Here's my code:
    Write:
    XElement uservarnodes = new XElement("uservars",
    new XElement("uservar1", "1"),
    new XElement("uservar2", "2"),
    new XElement("uservar3", "3"),
    new XElement("uservar4", "4"),
    new XElement("uservar5", "5"),
    new XElement("uservar6", "6"),
    new XElement("uservar7", "7"),
    new XElement("uservar8", "8"));
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.CreateFileAsync("uservarfile.xml", CreationCollisionOption.ReplaceExisting);
    var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite);
    using (var outputStream = stream.GetOutputStreamAt(0))
    DataWriter mydataWriter = new DataWriter(outputStream);
    mydataWriter.WriteString(uservarnodes.ToString());
    await mydataWriter.StoreAsync();
    await outputStream.FlushAsync();
    Read (outputs the data to a textblock):
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.GetFileAsync("uservarfile.xml");
    string readtext = await Windows.Storage.FileIO.ReadTextAsync(file);
    XElement uservarnodes = XElement.Parse(readtext);
    txtTarget.Text = uservarnodes.ToString();
    Delete:
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.GetFileAsync("uservarfile.xml");
    await file.DeleteAsync(StorageDeleteOption.PermanentDelete);
    When I tap each of the buttons once it all seems to work. But when I tap any of the buttons again within the same debug session I get an Access denied exception (E_ACCESSDENIED). Other people with this error had to await when calling their method, but I'm
    already doing that: private async void btnWrite_Click(object sender, RoutedEventArgs e) { await WriteToXMLFile(); }, etc.
    And the intervals between my taps isn't that short that you'd expect that the previously called method still had not finished completing. I don't understand why I'm getting the access denied error.
    Related to my question: I have added XML to the File Type Associations, File Open Picker and File Save Picker in the appxmanifest, but somewhere I read that you do not need to do this if you're working with local app data only. Is this true?

    var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.ReadWrite);
    I think because of your file stream hasn't been closed.
    by the way, it can be easier  by using System.IO.OpenStreamForWriteAsync extension method
    async public static Task<bool> SaveTextFileAsync(string filename, string data)
    byte[] fileBytes = System.Text.Encoding.UTF8.GetBytes(data);
    StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
    var file = await local.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting);
    try
    using (var s = await file.OpenStreamForWriteAsync())
    s.Write(fileBytes, 0, fileBytes.Length);
    return true;
    catch
    return false;
    (need using System.IO namespace)
    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

  • Basic doubt about XML file generation

    Hi,
    I am new to Java. I am facing some trouble designing and implementing a particular problem involving XML files.
    Problem:
    I have an XML file which contains a set of properties and their default value. What I need to do is to read another file/stream which will have name=value strings and then, for all the names that I find there, change default value to current value. These names can appear in any order. For example,
    <name1 value=default1/>
    <name2 value=default2/>
    <name3 value=default3/>
    And I will get something like "set name3=value3 name1=value1" (This data comes to me from a stream -usb device- and not from a file). Then I should change it to
    <name1 value=value1/>
    <name2 value=default2/>
    <name3 value=value3/>
    What is the best possible way to do this in Java? This has to go into an embedded system so it will be nice if it can be done with minimum memory and less processing power.
    I am currently reading J2EEtutorial (1.4). I have not read much. But I am confused if I should be using SAX, DOM or XSLT. To speak the truth, I don't even know the difference between all those. Any help will be greatly appreciated.
    Thanks & Regards,
    Suseelan

    Use a DOM parser to parse the original XML.
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder domBuilder = domFactory.newDocumentBuilder();
    Document document = domBuilder.parse( inputStreamToFile );Then read in the contents from your USB stream into say an array or Vector. Then go through each child node in the domBuilder class, get the nodes name and see if it's in the Vector of objects from the USB stream. If it is, then replace the "Value" attribute in the dom node with what is in the Vector.
    Make sense?
    Message was edited by:
    bryano

  • Question about XML file transferring over the networking

    Hi, I am now to Java, and now I am going to set up a simple network in the lab.
    I have created a random array of data and transferred to XML file on my client. Now, I would like to send it to the server. I am wondering how I can put the XML file into my client, and do I need any parser to let the server show what random date it has received?
    Anybody can give me any idea or some basic code? Thank you.
    Now, I am referring the KnockKnock example in Java online tutorial. But, not clear how to deal with the XML File.
    Fengyuan

    Four crossposts.
    http://forum.java.sun.com/thread.jspa?threadID=5158198&messageID=9600070#9600070
    http://forum.java.sun.com/thread.jspa?threadID=5158200&messageID=9600074#9600074
    http://forum.java.sun.com/thread.jspa?threadID=5158201&messageID=9600076#9600076
    http://forum.java.sun.com/thread.jspa?threadID=5158202&messageID=9600078#9600078

  • XML files from ABAP programs

    Hi everyone!
    Is there a way in ABAP to output XML files?  Pls. send code/ function module if any.
    From ABAP programs, we are sure that we can output TEXT files, but how about XML files?
    The significance of this question is related
    Currently we are using XI to interface SAP and AMS, this question for ABAP to produce XML file arose, if for example, the XI server is down and we have to still send data from one system to another. IDocs can also produce XML files, pls confirm.  Earlier however, we have preferred XI rather than IDocs to do this.  Anyway, any idea regarding this scenario will be greatly appreciated. 
    Thanks and God bless!
    Celeste

    Hi,
    Please check this sample codes from other thread.
    1. itab --- > xml
        xml ---> itab.
    2. This program will do both.
    (just copy paste in new program)
    3.
    REPORT abc.
    *-------------- DATA
    DATA : t001 LIKE TABLE OF t001 WITH HEADER LINE.
    DATA : BEGIN OF itab OCCURS 0,
    a(100) TYPE c,
    END OF itab.
    DATA: xml_out TYPE string .
    DATA : BEGIN OF upl OCCURS 0,
    f(255) TYPE c,
    END OF upl.
    DATA: xmlupl TYPE string .
    ******************************* FIRST PHASE
    ******************************* FIRST PHASE
    ******************************* FIRST PHASE
    *------------------ Fetch Data
    SELECT * FROM t001 INTO TABLE t001.
    *------------------- XML
    CALL TRANSFORMATION ('ID')
    SOURCE tab = t001[]
    RESULT XML xml_out.
    CALL FUNCTION 'SCMS_STRING_TO_FTEXT'
    EXPORTING
    TEXT = xml_out
    * IMPORTING
    * LENGTH =
    TABLES
    FTEXT_TAB = itab.
    *-------------- Download
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filetype = 'BIN'
    filename = 'd:xx.xml'
    TABLES
    data_tab = itab.
    ******************************* SECOND PHASE
    ******************************* SECOND PHASE
    ******************************* SECOND PHASE
    BREAK-POINT.
    REFRESH t001.
    CLEAR t001.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'D:XX.XML'
    filetype = 'BIN'
    TABLES
    data_tab = upl.
    LOOP AT upl.
    CONCATENATE xmlupl upl-f INTO xmlupl.
    ENDLOOP.
    *------------------- XML
    CALL TRANSFORMATION ('ID')
    SOURCE XML xmlupl
    RESULT tab = t001[]
    BREAK-POINT.
    Regards,
    Ferry Lianto

  • A few questions about using an XML file to add text into a TextArea component set as html

    I'm using AS2 in Flash CS3.
    I have a TextArea component in the stage that's loading its text from an XML and I've been able to use the ul and li tags to create lists. However, when I try to include a nested list it just inserts a line break between the nested list and the main list rather than indent it further. Is there a solution for this issue?
    Failing that, how would I be able to add non-breaking spaces into the XML so they will render inside the TextArea component? I've tried   and &#160; without success. I scoured the net for some help with this and found some information about modifying the font embedding xml file with a new entry for the non-breaking space and that didn't work either, so that leaves me somewhat stumped.

    flash doesn't handle nested lists (as you now know).  you can work-around that limitation using css and creating your own indent styles.  css have a marginLeft property you can use.

  • Operations on XML file

    Hi,
    Is there any API in flex, that allows us to do operations on a XML file, like, adding new tags, searching for a particular tag, modifying a particular tag(s)  deleting a particular tag(s) etc.

    Consider using JSON to put the data in a MySQL database:
    http://www.switchonthecode.com/tutorials/flex-php-tutorial-transmitting-data-using-json
    http://www.switchonthecode.com/tutorials/using-flex-php-and-json-to-modify-a-mysql-databas e
    http://www.switchonthecode.com/tutorials/flex-php-json-mysql-advanced-updating
    This code shows bringing the data into a DataGrid and basic processing:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="studentsSrvc.send();">
      <mx:Script>
        <![CDATA[
          import mx.events.ListEvent;
          import mx.controls.Alert;
          import mx.rpc.events.ResultEvent;
          import mx.collections.XMLListCollection;
          [Bindable] private var studentsXLC:XMLListCollection;
          [Bindable] private var dataValid:Boolean = false;
          private function studentsHandler(evt:ResultEvent):void{
            studentsXLC = new XMLListCollection(evt.result.student as XMLList);
          private function validateData():void{
            if(studentName.text == "" || classNum.text == "" ||
              address.text == ""){
              dataValid = false; 
            }else{
              dataValid = true;
          private function submitData():void{
            mx.controls.Alert.show("Student Name: " + studentName.text +
              "\nClass Number: " + classNum.text +
              "\nAddress: " + address.text);
            // process changed data here.
          private function studentHandler(event:ListEvent):void{
            var xml:XML = studentsXLC.getItemAt(event.rowIndex) as XML;
            studentName.text = xml.name;
            classNum.text = xml.classNum;
            address.text = xml.address;
            validateData();
        ]]>
      </mx:Script>
      <mx:HTTPService id="studentsSrvc" result="studentsHandler(event)"
        resultFormat="e4x" url="data.xml"/>
      <mx:DataGrid dataProvider="{studentsXLC}" itemClick="studentHandler(event)">
        <mx:columns>
          <mx:DataGridColumn headerText="Name" dataField="name"/>
          <mx:DataGridColumn headerText="Class" dataField="classNum"/>
          <mx:DataGridColumn headerText="Address" dataField="address"
            width="150"/>
        </mx:columns>
      </mx:DataGrid>
      <mx:Form>
        <mx:FormHeading label="Edit Student Record"/>
        <mx:FormItem label="Name:">
          <mx:TextInput id="studentName" change="validateData()"/>
        </mx:FormItem>
        <mx:FormItem label="Class:">
          <mx:TextInput id="classNum" change="validateData()"/>
        </mx:FormItem>
        <mx:FormItem label="Address:">
          <mx:TextInput id="address" change="validateData()"/>
        </mx:FormItem>
        <mx:FormItem>
          <mx:Button id="submit" label="Submit" click="submitData()"
            enabled="{dataValid}"/>
        </mx:FormItem>
      </mx:Form>
    </mx:Application>
    <?xml version="1.0" encoding="utf-8"?>
    <root>
    <student>
    <name>Bob Carson</name>
    <classNum>8</classNum>
    <age>25</age>
    <address>123 Main Street</address>
    </student>
    <student>
    <name>Susan Gornda</name>
    <classNum>10</classNum>
    <age>32</age>
    <address>338 Fawn Street</address>
    </student>
    <student>
    <name>Mary Whitman</name>
    <classNum>12</classNum>
    <age>44</age>
    <address>2298 Side Street</address>
    </student>
    </root>

  • Parsing error about "FF FE" in xml file

    dear all
    here is my code
    DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();
    factory.setValidating(false);
    DocumentBuilder builder= factory.newDocumentBuilder();
    builder.setErrorHandler(new MyErrorHandler());
    Document doc= builder.parse(new File(IFName));
    //dont work ,too.
    //Document doc=builder.parse(new InputSource(new InputStreamReader(new FileInputStream(new File(IFName)), "UTF-16LE")));          
    parseNode(doc.getDocumentElement());when i was parsing the xml make by c#
    the xml file is like this
    &#12539;&#65407;<Space><Region name="NorthAmerica"><Route name="TR24" color="blue"><Operation trainnum="980"><Company>Jupiter Railroad Corp.</Company><TrainStyle>Silver</TrainStyle></Operation><Stations><Start>NorthAmerica08</Start><End>NorthAmerica12</End></Stations></Route><Route name="TR39" color="black"><Operation trainnum="321"><Company>Earth Railroad Corp.</Company><TrainStyle>Express</TrainStyle></Operation><Stations><Start>NorthAmerica17</Start><End>NorthAmerica01</End></Stations></Route><Route name="TR52" color="black"><Operation trainnum="627"><Company>Sun Railroad Corp.</Company><TrainStyle>Plain</TrainStyle></Operation><Stations><Start>NorthAmerica19</Start><End>NorthAmerica37</End></Stations></Route><Route name="TR53" color="blue"><Operation trainnum="173"><Company>Neptune Railroad Corp.</Company><TrainStyle>Fast</TrainStyle></Operation><Stations><Start>NorthAmerica24</Start><End>NorthAmerica38</End></Stations></Route><Route name="TR82" color="yellow"><Operation trainnum="986"><Company>Saturn Railroad Corp.</Company><TrainStyle>Silver</TrainStyle></Operation><Stations><Start>NorthAmerica32</Start><End>NorthAmerica20</End></Stations></Route></Region></Space>u can see there is a funny character before the root element
    if change to ascii mode , i can see the FF FE code;
    i found that FF FE means the UTF-16 Little Endian.
    and my parser code will make an exception like SAXParseException: missing document root element
    is there any nice solution for this problem?
    if i use
    SAXTransformerFactory tFactory;
    TransformerHandler transformerH;
    Transformer transformer;
    tFactory= (SAXTransformerFactory)SAXTransformerFactory.newInstance();
    transformerH= tFactory.newTransformerHandler();
    transformer= transformerH.getTransformer();
    FileWriter out= new FileWriter(OFName);
    StreamResult result= new StreamResult(out);
    transformerH.setResult(result);to make my xml file in java without setting specific properties
    it will make the same xml like C#,a FF FE at the file beginning.
    best regards.

    Okay, this reply has been a real long time in coming, but I just had a similar situation. I have an XML file I need to edit with a Java program. A third-party program that I have no control over uses the file, so the XML file must remain compatible. For my needs, the DOM model in the JAXP package seemed like the best solution. As a plus, I also have SAX support built in.
    Here is the self-contained program.
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    import java.io.UnsupportedEncodingException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.OutputKeys;
    import javax.xml.transform.Transformer;
    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.xml.sax.SAXException;
    * This class copies an XML file after first creating a DOM document out of it.
    public class OpenClose {
         public static final void main(String[] args) {
              String fileName = "c:\\test.xml";
              System.out.println("Processing Started.");
              try {
                   Document doc = load(fileName);
                   // Do whatever to the document.
                   fileName = "c:\\testOut.xml";
                   save(fileName, doc);
                   System.out.println("No errors!");
              } catch (OpenCloseException e) {
                   System.out.println("Error reported by module:");
                   System.out.println("\t" + e.getSource());
                   System.out.println("Error:");
                   System.out.println("\t" + e.getMessage());
                   Throwable cause = e.getCause();
                   if (cause != null) {
                        System.out.println("Originating Error:");
                        System.out.println("\t" + cause.toString());
              System.out.println("Processing Ended.");
          * Create a Document from the specified XML document.
          * @param fileName is the name of the external XML file.
          * @return a DOM document.
          * @throws OpenCloseException on any error.
         public static Document load(String fileName) throws OpenCloseException {
              Document doc = null;
              File file = new File(fileName);
              if (!file.exists()) {
                   throw new OpenCloseException(
                        "Load of file \""
                             + fileName
                             + "\" failed because the file does not exist.",
                        null,
                        "OpenClose");
              DocumentBuilderFactory domFactory =
                   DocumentBuilderFactory.newInstance();
              domFactory.setNamespaceAware(false);
              domFactory.setValidating(false);
              domFactory.setCoalescing(false);
              try {
                   DocumentBuilder docBuilder = domFactory.newDocumentBuilder();
                   doc = docBuilder.parse(file);
              } catch (ParserConfigurationException e) {
                   throw new OpenCloseException(
                        "Load failed due to a Document Builder related error:\n"
                             + e.toString(),
                        e,
                        "OpenClose");
              } catch (SAXException e) {
                   throw new OpenCloseException(
                        "Load failed due to Document Builder parsing related error:\n"
                             + e.toString(),
                        e,
                        "OpenClose");
              } catch (IOException e) {
                   throw new OpenCloseException(
                        "Load failed due to a file related error:\n" + e.toString(),
                        e,
                        "OpenClose");
              return doc;
          * Save the XML File object to its external file.
          * @param fileName is the name of the file to save to.
          * @param doc is the document to save.
          * @throws OpenCloseException on any error.
         public static void save(String fileName, Document doc)
              throws OpenCloseException {
              //I cannot seem to get Java to write this automatically, so I
              //force it to do my bidding.
              final int BYTE_ORDER_MARK = 0xFEFF;
              File file = new File(fileName);
              try {
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                   Transformer transformer = tFactory.newTransformer();
                   //UCS-2 is the UTF-16LE of the Microsoft world.
                   transformer.setOutputProperty(OutputKeys.ENCODING, "UCS-2");
                   DOMSource source = new DOMSource(doc);
                   FileOutputStream fs = new FileOutputStream(file);
                   //UCS-2 here would cause an exception.
                   OutputStreamWriter out = new OutputStreamWriter(fs, "UTF-16LE");
                   out.write(BYTE_ORDER_MARK); //Must include
                   StreamResult result = new StreamResult(out);
                   transformer.transform(source, result);
              } catch (TransformerException e) {
                   throw new OpenCloseException(
                        "Save failed due to a Transformer related error:\n"
                             + e.toString(),
                        e,
                        "OpenClose");
              } catch (UnsupportedEncodingException e) {
                   throw new OpenCloseException(
                        "Save failed due to an Unsupported Encoding Exception:\n"
                             + e.toString(),
                        e,
                        "OpenClose");
              } catch (IOException e) {
                   throw new OpenCloseException(
                        "Save failed due to a File error:\n" + e.toString(),
                        e,
                        "OpenClose");
    class OpenCloseException extends Exception {
         private String source = "";
          * Create an exception with a message, a cause, and a source.
          * @param message is the error message.
          * @param cause is the throwable that created this exception.
          * @param source is the class name the initial exception fired in.
         public OpenCloseException(String message, Throwable cause, String source) {
              super(message, cause);
              this.source = source;
          * @return the class name creating the error initially.
         public String getSource() {
              return this.source;
    }

  • Where I could get more detail information about generating xml files

    Hi Tim
    I am a oracle employee. Our project try to use XML Publisher to generate XML files. But there is so little information about this in the XML Publihser Developer Guide.
    It is that any more detail java examples about how to generate xml files using XML publisher. Or some detail java API.
    XML Publisher use which method to generate the xml files?
    Thank you very much!!

    The easiest way is to create an oracle report, switch the output to xml and format using XML publisher. That has worked well for us in most cases.
    Good luck,
    Brett

  • ORA-22288:file or LOB operation FILEOPEN failed while loading XML file.

    Hello all,
    I am getting the following error messages while loading XML file to Oracle 9i table.
    declare
    ERROR at line 1:
    ORA-22288: file or LOB operation FILEOPEN failed
    No such file or directory
    ORA-06512: at "SYS.DBMS_LOB", line 504
    ORA-06512: at line 10
    The script I am using is all follows:-
    1. Created a file ldxmldata.sh on unix server directory
    dd conv=ucase if=$1|sed 's/<?XML/<?xml/'|sed 's/VERSION/version/'|sed 's
    /RECORD/ROW/'|sed 's/DATE/TRANSDATE/'|sed 's/&/-/'|sed 's/\/DATE>// TRANSDATE>/'>$1.UCASE
    sqlplus sales/sales@rac @upld.sql $1.UCASE
    2. Created SQL file upld.sql on unix server
    set serveroutput on
    exec DBMS_JAVA.SET_OUTPUT(1000000);
    @ldxml.sql bsl.xml.UCASE
    commit;
    exit
    3. Created sql file ldxml.sql on unix server
    declare
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    file bfile := bfilename('XML_DIR','&1');
    charContent CLOB := ' ';
    targetFile bfile;
    warning number;
    begin
    targetFile := file;
    DBMS_LOB.fileopen(targetFile, DBMS_LOB.file_readonly);
    DBMS_LOB.loadfromFile(charContent,targetFile,DBMS_LOB.getLength(tar
    getFile),1,1);
    insCtx := DBMS_XMLSave.newContext('sales.s_price');
    rows := DBMS_XMLSave.insertXML(insCtx,charContent);
    DBMS_XMLSave.closeContext(insCtx);
    DBMS_LOB.fileclose(targetFile);
    end;
    4. As Sys,
    Created a directory XML_DIR and assigned it the path of Unix server directory
    where the script files reside.
    Granted read priviledge on XML_DIR to user sales.
    I am getting the above error messages. Kindly help with some possible solution.
    Arun Patodia
    Bokaro Steel City

    Hi guys,
    Sybrand, aplogoies, the second line of the error stack was on one line in the first post, full error stack below:
    ORA-22288: file or LOB operation FILEOPEN failed
    The program issued a command but the command length is incorrect.
    ORA-06512: at "SYS.DBMS_LOB", line 716
    ORA-06512: at "JLMS.LOAD_DATA_UTIL", line 417
    ORA-06512: at line 2I have looked at that error code as you mentioned, but the second line here doesn't really help much.
    Hoek, i took your advice and tried to replace FILEOPEN with OPEn but got the same error.
    Just to clarify as well, I am not using UNC or relative file paths as I know that these can cause problems.
    Rgds
    Dan

  • An example about how to load a XML file

    Hi,
    I've been working on Oracle for many years but fot the first time I was asked to load a XML file into a table.
    As an example, I've found this on the web, but it doesn't work.
    Can someone tell me why? I hoped this example could help me.
    the file acct.xml is this:
    <?xml version="1.0"?>
    <ACCOUNT_HEADER_ACK>
    <HEADER>
    <STATUS_CODE>100</STATUS_CODE>
    <STATUS_REMARKS>check</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>2</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>3</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic administration</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>4</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>5</SEGMENT_NUMBER>
    <REMARKS>rp polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    <HEADER>
    <STATUS_CODE>500</STATUS_CODE>
    <STATUS_REMARKS>process exception</STATUS_REMARKS>
    </HEADER>
    <DETAILS>
    <DETAIL>
    <SEGMENT_NUMBER>20</SEGMENT_NUMBER>
    <REMARKS> base polytechnic</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>30</SEGMENT_NUMBER>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>40</SEGMENT_NUMBER>
    <REMARKS> base polytechnic finance</REMARKS>
    </DETAIL>
    <DETAIL>
    <SEGMENT_NUMBER>50</SEGMENT_NUMBER>
    <REMARKS> base polytechnic logistics</REMARKS>
    </DETAIL>
    </DETAILS>
    </ACCOUNT_HEADER_ACK>
    For the two tags HEADER and DETAILS I have the table:
    create table xxrp_acct_details(
    status_code number,
    status_remarks varchar2(100),
    segment_number number,
    remarks varchar2(100)
    before I've created a
    create directory test_dir as 'c:\esterno'; -- where I have my acct.xml
    and after, can you give me a script for loading data by using XMLTABLE?
    I've tried this but it doesn't work:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns header_no      for ordinality,
              status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '$d/ACCOUNT_HEADER_ACK/DETAILS[$hn]/DETAIL'
      passing acct_doc as "d",
              x1.header_no as "hn"
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    This should allow me to get something like this:
    select * from xxrp_acct_details;
    Statuscode status remarks segement remarks
    100 check 2 rp polytechnic
    100 check 3 rp polytechnic administration
    100 check 4 rp polytechnic finance
    100 check 5 rp polytechnic logistics
    500 process exception 20 base polytechnic
    500 process exception 30
    500 process exception 40 base polytechnic finance
    500 process exception 50 base polytechnic logistics
    but I get:
    Error report:
    ORA-06550: line 19, column 11:
    PL/SQL: ORA-00932: inconsistent datatypes: expected - got NUMBER
    ORA-06550: line 4, column 2:
    PL/SQL: SQL Statement ignored
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    and if I try to change the script without using the column HEADER_NO o keep track of the header rank inside the document:
    DECLARE
    acct_doc xmltype := xmltype( bfilename('TEST_DIR','acct.xml'), nls_charset_id('AL32UTF8') );
    BEGIN
    insert into xxrp_acct_details (status_code, status_remarks, segment_number, remarks)
    select x1.status_code,
            x1.status_remarks,
            x2.segment_number,
            x2.remarks
    from xmltable(
      '/ACCOUNT_HEADER_ACK/HEADER'
      passing acct_doc
      columns status_code    number        path 'STATUS_CODE',
              status_remarks varchar2(100) path 'STATUS_REMARKS'
    ) x1,
    xmltable(
      '/ACCOUNT_HEADER_ACK/DETAILS'
      passing acct_doc
      columns segment_number number        path 'SEGMENT_NUMBER',
              remarks        varchar2(100) path 'REMARKS'
    ) x2
    END;
    I get this message:
    Error report:
    ORA-19114: error during parsing the XQuery expression: 
    ORA-06550: line 1, column 13:
    PLS-00201: identifier 'SYS.DBMS_XQUERYINT' must be declared
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ORA-06512: at line 4
    19114. 00000 -  "error during parsing the XQuery expression: %s"
    *Cause:    An error occurred during the parsing of the XQuery expression.
    *Action:   Check the detailed error message for the possible causes.
    My oracle version is 10gR2 Express Edition
    I do need a script for loading xml files into a table as soon as possible
    Thanks in advance!

    Hello,
    Your code is not readable (no code tags).
    Anyway, you can use SQL*Loader to load a XML document into a table.
    Here is the link of the documentation with both description and an example at the end of the
    article.
    http://docs.oracle.com/cd/B19306_01/appdev.102/b14259/xdb25loa.htm
    Regards,
    Dariyoosh

  • Question about insert date value from xml file

    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by matmnwx:
    I want insert value into table from xml file. Every time I inserted value of date type into the table, I got the unpasable error message as following:
    oracle.xml.sql.OracleXMLSQLException: Exception 'java.text.ParseException:Unpars
    eable date: "2000-04-19 00:00:00.0"' encountered during processing ROW element
    Thanks for anyone that can fix my problem or give me any suggestion.
    email: [email protected]<HR></BLOCKQUOTE>
    Use:
    OracleXMLSave sav = new OracleXMLSave(conn,tabName);
    sav.setDateFormat(<hier the date format in the XML-File>);

  • (newbie) Question about replacing .class files and web.xml file

    I'm new to servlets and I have two quick questions...
    Do I absolutely need a web.xml file to define all my servlets, or can I simply place .class files into the WEB-INF directory and expect them to run?
    If my application server (for example Tomcat) is running and I replace a servlet .class file, do I need to restart the server for the new .class file to take effect?
    ...or are both of these questions specific to the application server I'm using?

    Hi,
    From an article I read:
    With Tomcat 3.x, by default servlet container was set up to allow invoking a servet through a common mapping under the /servlet/ directory.
    A servlet could be accessed by simply using an url like this one:
    http://[domain]:[port]/[context]/servlet/[servlet full qualified name].
    The mapping was set inside the web application descriptor (web.xml), located under $TOMCAT_HOME/conf.
    With Tomcat 4.x the Jakarta developers have decided to stop allowing this by default. The <servlet-mapping> tag that sets this mapping up, has been commented inside the default web application descriptor (web.xml), located under $CATALINA_HOME/conf:
    <!-- The mapping for the invoker servlet -->
    <!--
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    -->
    A developer can simply map all the servlet inside the web application descriptor of its own web application (that is highly suggested), or simply uncomment that mapping (that is highly discouraged).
    It is important to notice that the /servlet/ isn't part of Servlet 2.3 specifications so there are no guarantee that the container will support that. So, if the developer decides to uncomment that mapping, the application will loose portabiliy.
    And declangallagher, I will use caution in future :-)

  • Query about reentrant in ejb-jar.xml file(in case of entity Bean)

    Hi all friends,
    I am new to EJB I couldn't understand in ejb-jar.xml file in case Entity Bean[<reentrant>False</reentrant>
    &<reentrant>true</reentrant>]what is the function of this tag and what is the effect of value true and false of this tag.Can any one please explain it.
    Regards
    Bikash

    Hi,
    Re-entrant tag is used in the ejb-jar.xml to notify the container if you would want your bean to call itself through another bean.
    Most of the time you would want it to be set to FALSE because you would have to consider the multi-threading issues if you set it TRUE.
    Regards
    Meka Toka

Maybe you are looking for

  • PQAH- can't see SAVE button

    Hi friends, I have a test user into 2 environments, Prod and QA. Into prod, using PQAH t-code test user can see SAVE, NEW and OPEN button to use query. But into QA environment, user can't see any of these buttons. User has same roles into both enviro

  • Clearing in local currency

    Hi, I have following situation: a bank account and a customer account, document posted in foreign currency (EUR). Exchange rate differences were posted in this document. Then they realized that wrong bank account was used. In order not to reverse a d

  • Void check with date selection

    Greetings experts - My customer created a check in January, it is now March, and they want to void it as of February.  Is there a way to "trick" the system as to what the current date is so I can void the check as of February? I tried changing my win

  • Need help for file upload - reposted for Steve Muench

    Hi Steve, I have been involved developing a web application that requires a file upload operation. I have studied your example on Upload Text File and Image Example in the Not Yet Documented ADF Sample Applications section. I got the file upload part

  • " SYSTEM ERROR" with ERROR CATEGORY: Message and ERROR ID : GENERAL

    HI all I m doing JDBC -> XI -> SOAP -> XI -> FILE ( XML) scenario .I have implemented it using  BPM . But ,In MONI , i am getting a "SYSTEM ERROR " with "ERROR CATEGORY : MESSAGE" and "ERROR ID : GENERAL" .and  One thing more is there my all adapters