I need for a simple example of  reading a xml file using jdom

Hello
I have been looking for a simple example that uses Jdom to read am xml file and use the information for anything( ), and I just can't find one.since I'm just beggining to understand how things work, I need a good example.thanks
here is just a simple cod for example:
<xmlMy>
     <table>
          <item name="first" value="123" createdDate="1/1/90"/>
          <item name="second" value="456" createdDate="1/4/96"/>
     </table>
     <server>
          <property name="port" value="12345"/>
          <property name="maxClients" value="3"/>
     </server>
</xmlMy>Dave

Hi,
        FileInputStream fileInputStream = null;
        try {
            fileInputStream = new FileInputStream("my_xml_file.xml");
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } finally{
            if (fileInputStream == null) return;
        SAXBuilder saxBuilder = new SAXBuilder();
        saxBuilder.setEntityResolver(new EntityResolver() {
            public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
                return new InputSource(new StringReader(""));
        Document document = null;
        try {
            document = saxBuilder.build(fileInputStream);
        } catch (JDOMException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (document == null) return;
        Element element = document.getRootElement();
        System.out.println(element.getName());
        System.out.println(element.getChild("table").getName());

Similar Messages

  • Where can I find an example of a vi which reads a xml file using the Labview schema (LVXMLSchema.xsd)?

    Where can I find an example of a vi which reads a xml file using the Labview schema (LVXMLSchema.xsd)?
    �Unflatten From XML� is of little use in parsing because it requires the data type. So it seems that the user has to parse each data value, and then �Unflatten From XML� can help a little.
    I would like to see NI provide a VI for parsing it�s own schema.

    LabVIEW's XML functions are another way of saving data from controls and indicators that is in a more standardized format. If you look at the Unflatten From XML shipping example, it shows taking the data that you would normally send to a Digital Wveform Graph and converting it to XML instead. This data is then unflattend from XML and wired to the graph. Since you know what you wrote to the file, this is an easy thing to do. If what you are looking for is a way to look at any data in any LabVIEW XML file, then you are right, there is not a VI for that. However, I do not believe that that was the intention of the XML functions in the first place.
    By wiriting data in XML, this allows other applications outside of LabVIEW to parse and recognize the dat
    a. In LabVIEW, you would already know the types and can place a generic item of that type. The issue of knowing the type is that you need to know the type of the wire that comes out of the Unflatten function so that the VI will compile correctly. You could always choose a variant value to unflatten and then do some parsing to take the variant a part. Maybe this will help you out.
    See this example for using the Microsoft parser for XML. (http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_guid=B123AE0CB9FE111EE034080020E74861&p_node=DZ52050&p_submitted=N&p_rank=&p_answer=)
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Exception thrown while reading an XML file using Properties

    Exception thrown while reading an XML file using Properties.
    Exception in thread "main" java.util.InvalidPropertiesFormatException: org.xml.sax.SAXParseException:
    The processing instruction target matching "[xX][mM][lL]" is not allowed.
    at java.util.XMLUtils.load(Unknown Source)
    <?xml version="1.0"?>
    <Config>
         <Database>
              <Product>FX.O</Product>
              <URL>jdbc:oracle:thin:@0.0.0.0:ABC</URL>
         </Database>
    </Config>Am I missing anything?

    Thanks a lot for all yr help.I have got the basics of
    the DTD
    However,when I say thus
    <!DOCTYPE Config SYSTEM "c:/PartyConfig">
    ?xml version="1.0"?>
    <Config>
         <Database>
              <Product>FX</Product>
              <URL>jdbc:oracle:thin:@0.0.0.0:ABC</URL>
         </Database>
    </Config>I get the error
    Invalid system identifier: file:///c:/ParyConfig.dtd
    Please advise?for goodness sake, how many times do I have to tell you that you can't just expect the Properties class to accept arbitrary XML in any format? it reads XML in the format I linked to, and nothing else. Properties is not a general purpose XML binding. you can't do what you're trying to do with it. read this and in particular pay attention to the following
    The XML document must have the following DOCTYPE declaration:
    <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
    Furthermore, the document must satisfy the properties DTD described above.
    you are not reading my answers properly, are you? kindly do so

  • Reading from XML file using DOM parser.

    Hi,
    I have written the following java code to read the XML file and print the values. It reads the XML file. It gets the node NAME and prints it. But it returns null when trying to get the node VALUE. I am unable to figure out why.
    Can anyone please help me with this.
    Thanks and Regards,
    Shweta
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import oracle.xml.parser.v2.*;
    import org.w3c.dom.*;
    import org.xml.sax.SAXException;
    public class ReadNodes
    private static XMLDocument mDoc;
    public ReadNodes () {
         try {
    DOMParser lParser = new DOMParser();
    URL lUrl = createURL("mot.xml");
    System.out.println("after creating the URL object ");
    lParser.setErrorStream(System.out);
    lParser.showWarnings(true);
    lParser.parse(lUrl);
    mDoc = lParser.getDocument();
         System.out.println("after creating the URL object "+mDoc);
    lParser.reset();
    } catch (Exception e) {
    e.printStackTrace();
    } // end catch block
    } // End of constructor
    public void read() throws DOMException {
    try {
         NodeList lTrans = this.mDoc.getElementsByTagName("TRANSLATION");
         for(int i=0;i<lTrans.getLength();i++) {
              NodeList lTrans1 = lTrans.item(i).getChildNodes();
              System.out.println("lTrans1.item(0).getNodeName : " + lTrans1.item(0).getNodeName());
              System.out.println("lTrans1.item(0).getNodeValue : " + lTrans1.item(0).getNodeValue());
              System.out.println("lTrans1.item(1).getNodeName : " + lTrans1.item(1).getNodeName());
              System.out.println("lTrans1.item(1).getNodeValue : " + lTrans1.item(1).getNodeValue());
         } catch (Exception e) {
         System.out.println("Exception "+e);
         e.printStackTrace();
         } catch (Throwable t) {
              System.out.println("Exception "+t);
    public static URL createURL(String pFileName) throws MalformedURLException {
    URL url = null;
    try {
    url = new URL(pFileName);
    } catch (MalformedURLException ex) {
    File f = new File(pFileName);
    String path = f.getAbsolutePath();
    String fs = System.getProperty("file.separator");
    System.out.println(" path of file : "+path +"separator " +fs);
    if (fs.length() == 1) {
    char sep = fs.charAt(0);
    if (sep != '/')
    path = path.replace(sep, '/');
    if (path.charAt(0) != '/')
    path = '/' + path;
    path = "file://" + path;
    System.out.println("path is : "+path);
    // Try again, if this throws an exception we just raise it up
    url = new URL(path);
    } // End catch block
    return url;
    } // end method create URL
    public static void main (String args[]) {
         ReadNodes mXML = new ReadNodes();
         mXML.read();
    The XML file that I am using is
    <?xml version = "1.0"?>
    <DOCUMENT>
    <LANGUAGE_TRANS>
    <TRANSLATION>
    <CODE>3</CODE>
    <VALUE>Please select a number</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>5</CODE>
    <VALUE>Patni</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>6</CODE>
    <VALUE>Status Messages</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>7</CODE>
    <VALUE>Progress</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>8</CODE>
    <VALUE>Create Data Files...</VALUE>
    </TRANSLATION>
    <TRANSLATION>
    <CODE>9</CODE>
    <VALUE>OK</VALUE>
    </TRANSLATION>
    </LANGUAGE_TRANS>
    </DOCUMENT>

    because what you want is not the node value of CODE but the node value of the text nodes into it!
    assuming only one text node into it, try this:
    System.out.println("lTrans1.item(0).getNodeName : " + lTrans1.item(0).getFirstChild().getNodeValue());

  • How To read an XML file with JDom

    I have read through some tutorials after installing JDom on how to read an existing XML file and I was confused by all of them. I simply want to open an XML file and read one of the node's content. Such as <username>john doe</username> this way I can compare values with what the user has entered as their username. I am not sure were to start and I was hoping someone could help me out.
    I know that this seems like an insecure way to store login information but after I master opening and writing XML files with JDom I am going to use AES to encrypt the XML files.

    Here is a test program for JDom and XPath use considering your XML file is named "test.xml" :import org.jdom.input.*;
    import org.jdom.xpath.*;
    public class JDomXPath {
    public static void main(String[] args) {
      SAXBuilder saxBuilder = new SAXBuilder("org.apache.xerces.parsers.SAXParser");
      try {
       org.jdom.Document jdomDocument = saxBuilder.build("test.xml");
       org.jdom.Element usernameNode = (org.jdom.Element)XPath.selectSingleNode(jdomDocument, "//username");
       System.out.print(usernameNode.getText());
      } catch (Exception e) {
       e.printStackTrace();
    }(tested with Eclipse)

  • Reading large XML file using a file event generator and a JPD process

    I am using a FileEventGenerator and a JPD Subscription process to read a large XML file. The large XML file basically contains repeated XML elements. My understanding is that the file subscription method reads the whole file in memory which causes lots of problem for huge file size like 1MB. Is there a way to read the file size-wise or is there a way to read chunks of data from a large size file..or any other alternative. I would like to process the file in a loop iteration by iteration.

    Hitejain,
    Here are a couple of pointers you could try. One is that the file event generator has a pass by reference (filename) functionality which you could use so that you could do the following inside of your process.
    1) Read file name from the reference
    2) Move the file to a processed directory (so it doesn't get picked up again. Note: I don't know how the embedded archive methods of the file event generator plays with pass by reference.
    3) Open a stream to the file.
    4) Use a SAX or SAX - DOM combined approach to parse your XML while managing the memory usage inside of your process
    There is another possibility which might fit your needs and it is related to the RawData object that BEA provides. If I understand it correctly provides wrapping functionality around a stream object, but depending on your parsing methods might just postpone the problem.
    Hope this helps
    Chris Falling
    Stormforge Software

  • Reading an XML file using Java

    Dear all,
    Currently, I'm planning to write a java program that will read from an xml file. This is my XML file:
    <?xml version="1.0"?>
    <HUMIDITYMEASURE>
    <HUMIDITY>32.0</HUMIDITY>
    </HUMIDITYMEASURE>
    Now, here is my Java code:
    import java.io.*;
    class ReadAFile{
    public static void main(String[]args){
    try{
    File myFile=new File("XMLFile.xml");
    FileReader fileReader= new FileReader(myFile);
    BufferedReader reader = new BufferedReader(fileReader);
    String line = "null";
    while ((line = reader.readLine()) !=null){
    System.out.println(line);
    reader.close();
    catch(Exception ex){
    ex.printStackTrace();
    So far the program displays the content of the xml file (with the tags). However, my aim is to make the program display the values, not the tags. For example, in this case, i'd like my program to display the value '32.0' rather than:
    <?xml version="1.0"?>
    <HUMIDITYMEASURE>
    <HUMIDITY>32.0</HUMIDITY>
    </HUMIDITYMEASURE>
    Can anyone provide me with any advice as to how i can do this please? I tried using the tokenizer and split, but to be honest, they dont really work. If anybody has any suggestions, please reply if possible.
    Regards,

    I have found the solution to my task.
    Many thanks to those who have viewed/replied to my message.
    For those of you who may be wondering how the problem was solved, it is useful to refer to some documents relating to Java and XML (as combination).
    Imported packages such as:
    import java.io.File;
    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    and variations of import javax.xml were used.
    The use of Nodes and NodeLists I used to.
    Thanks again.
    p.s. More details on XML and Java are found on the Sun Website.
    Regards,
    Raheal

  • Problem reading an xml file using java

    i have a Com File which is called through .Net application and i made another java application that call the same COM file using JNI . but the problem is that the xml format generated from the Com file in case of the .Net application is approx 49.9K and the same Xml file Contents generated through java is half the size of the previous file in .net about 24.9K . I had figured out that the .Net application generates the xml file as unicode format while the java application generates the same xml format as ANSI format which is approx the half of the .Net counterpart .
    but the problem now is that i can't deserialize the java generated xml to convert it into its java object using XMLDecoder because it is ill formed xml whereas its tags are well structured .
    even when i try to open that .NEt xml file into the IE browser it structures the xml file successfully
    while the java xml file version tells me that the file is ill formed knowing that the file is well structured and all the tags are valid.

    First of, that's not "Unicode" and "ANSI". Those are not really encodings per-se. "Unicode" is sometimes used to refer to UTF-16/UCS-2, and "ANSI" is sometimes used to refer to whatever the current 1-byte encoding of the machine is. But again: Those are not valid encoding names. The encodings used are probably UTF-16 (or UCS-2) and UTF-8, respectively.
    Next: unless you tell us some exact error message we can't tell you what went wrong.
    And if you want to find out if any given XML file is valid, just run it through some validator (such as [the one from the W3C|http://validator.w3.org/]).

  • Successful Read of XML File by Transforms Return Null

    Hi:
    I'm starting out with a simple BPEL process: Read an XML file, transform two fields. write an XML file. Both the read and write operations use the same .xsd file.
    I am successful at creating, compiling, deploying, and executing the process. The output file contains empty tags. In the BPEL Console and can see each activity. The read activity shows the data read from the input file, arranged as expected. The I conclude that this activity works correctly. Here is what I see when I drill down on the first activity:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <user-details>
    - <user-list>
    - <user>
    <first-name>test1</first-name>
    <last-name>abc</last-name>
    <gender>male</gender>
    <age>1</age>
    </user>
    </user-list>
    </user-details>
    The second activity shows empty values for the tags defined for the target variable. Here's what I see for the second activity, the Transform activity:
    <Invoke_WriteOut_Variable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="user-details"><user-details xmlns:ns0="http://www.example-irfan.org" xmlns="http://www.example-irfan.org">
    <ns0:user>
    <ns0:firstName/>
    <ns0:lastName/>
    <ns0:gender/>
    <ns0:age/>
    </ns0:user>
    </user-details>
    </part></Invoke_WriteOut_Variable>
    This second activity, the Transform, simply maps fields received from activity one too a new variable defined using the same .xsd as the first variable.
    The third activity writes to the output file. Here is that file:
    <?xml version="1.0" ?><user-details xmlns:ns0="http://www.example-irfan.org" xmlns="http://www.example-irfan.org">
    <ns0:user>
    <ns0:firstName/>
    <ns0:lastName/>
    <ns0:gender/>
    <ns0:age/>
    </ns0:user>
    </user-details>
    This is a "simple" 3-activity process, and I've reviewed it thoroughly. Can anyone help? It seems that the variable defined to accept the input xml file is not getting populated, although the process manager seems to say differently. Why would this be?
    Thanks.

    Thank you for your response. My problem and confusion indeed relate to the xsd file. I know this because I can take one of the sample processes and modify it to perform the simple task that I want: open an xml file, transform a field or two, write to a new xml file. Still I have not been able to understand what BPEL considers a "valid" xsd file. I have tried like heck to match my xsd file to match the sample, but it still doesn't work.
    So, my next question to anyone: does any documentation exist on the proper format for an xsd file? I have tried to take examples from on-line postings and blogs, but these don't work. It seems to me that the initial <schema> tag is the most important and that the http references in this tag are vital, but I can't tell for sure.
    Any suggestions are appreciated.

  • How to read the attribute of the xml file using jaxb

    Thanks,
    Buddy as i have a issue i have to read the xml file using jaxb and xml file contains this data and i have read the attribute like name , desc and action for a particular menu name pls tell the code how to do this it will be a great favour to me
    thanx in advance
    Rasool
    <contextmenu>
    <menu name='Lead' >
    <menuitem name='newlead' desc='New Lead' action='/leads.do?dispatch=insert' />
    <menuitem name='editlead' desc='Edit Lead' action='' />
    <menuitem name='leadinfo' desc='Lead Information' action='' />
    </menu>
    <menu name='Cases' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    <menu name='Contact' >
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    <menuitem name='' desc='' action='' />
    </menu>
    </contextmenu>

    What my program do is to get the encoding of XML files and convert them to UTF-8 encoding files, while I need this "encoding" information of the original XML document thus I can convert...
    After reading specifications and JDOM docs, the truth turns to be disappointed, no function is provided to get this information in JDOM level 2(the current released one), while it's promissed that this function will be provided in JDOM level API....
    Thanx all for your help and attention!!!

  • Retrieve and Read XML Files using Oracle6i Forms

    Dear all .. i have some problem here: How can i retrieve and read a XML files using Oracle6i Forms? What should i do? Thanks - ASAP -

    Several ways - Pick up a copy of the Oracle XDK off of OTN. This provides Java and PL/SQL toolkits for dealing with XML files.
    The PL/SQL one would be in the Database, so you might have to use the Java one of you need to do it on the Forms machine.
    You can use the Java Importer in 6i to create PL/SQL wrappers that you can call from forms into the Java XDK APIs.
    Or of course you can just use the TEXT_IO package to read the XML as a text stream and parse it in your own PL/SQL code...

  • Cannot close an XML file used for parsing

    Hi All,
    I appears to have difficulty closing (possibly flushing it first) an XML file that was subsequently being parsed without success. The error generated is:
    org.jdom.input.JDOMParseException: Error on line 23: The element type "form" must be terminated by the matching end-tag "</form>".
    Below is the code snippets of readData() to retrieve (HTML) data from a website, save it to a file, then convert to XML format before returning the new filename:
    public String readData() {
        try {
              URL url  = new URL("http://www.abc.com");
              URLConnection connection = url.openConnection();      
              InputStream isInHtml = url.openStream();   // throws an IOException    
              disInHtml = new DataInputStream(new BufferedInputStream(isInHtml));         
              System.out.flush();
              FileOutputStream fosOutHtml = null;
              fosOutHtml = new FileOutputStream("C:\\Temp\\ABC.html");
              int oneChar, count=0;
              while ((oneChar=disInHtml.read()) != -1)
                  fosOutHtml.write(oneChar);
              isInHtml.close();
              disInHtml.close();
              fosOutHtml.flush();    // optional
              fosOutHtml.close();
        try {
              File fileInHtml = new File("C:\\Temp\\ABC.html");
              FileReader frInHtml = new FileReader(fileInHtml);
              BufferedReader brInHtml = new BufferedReader(frInHtml);
              String string = "";
              while (brInHtml.ready())
                  string += brInHtml.readLine() + "\n";
              fwOutXml  = new FileWriter("C:\\Temp\\ABC.xml");
              pwOutXml  = new PrintWriter(fwOutXml);
              light_html2xml html2xml = new light_html2xml();
              pwOutXml.print(html2xml.Html2Xml(string));
              system.out.flush()     // optional
              fwOutXml.flush();      // optional
              fwOutXml.close();
              pwOutXml.flush();      // optional
              pwOutXml.close();
              return fileInHtml.getAbsolutePath();
    // parseData reads the XML file using the name returned by readData()
    public void parseData(String XMLFilename)
        try
            FileReader frInXml = new FileReader(FileName);
            BufferedReader brInXml = new BufferedReader(frInXml);
            SAXBuilder saxBuilder = new SAXBuilder("org.apache.xerces.parsers.SAXParser"); // JDOMParseException generated.
    }These codes would worked when they were in a single method but I have since placed some structure around them using a number methods.
    This issue has risen in th past where I have been able to close the XML file prior to reading them again. However, I don't have a solution for it this time round.
    I am running JDK 1.6.0_10, Netbeans 6.1, JDOM 1.1 on Windows XP platform.
    Any assistance would be appreciated.
    Many thanks,
    Jack

    Hi Alain,
    I have added the additional I/O statements in the finally clause as follows but the problem still persisted:
    readData()
    // reading data (html) from the webpage and save it in html format.
    try {
    catch { …. }
    finally {
           System.out.flush();
           isInHtml.close();
           disInHtml.close();
           fosOutHtml.flush();
           fosOutHtml.getFD().sync();
           fosOutHtml.close();
    // convert the html webpage format to xml format
    try {
    catch { …. }
    finally {
           System.out.flush();
           fwOutXml.flush();
           fwOutXml.close();
           pwOutXml.flush();
           pwOutXml.close();
    Below is a short listing of the new XML file:
      <?xml version="1.0" encoding="iso-8859-1" ?>
    - <html>
    - <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <meta name="keywords" content="California, cities, towns, villages, list, zipcodes, postal codes, united states, ca" />
      <meta name="description" content="Cities, towns and suburbs in California, United States (CA) starting with A" />
      <title>Cities and Towns in California starting with A – ABC Company</title>
      <link rel="stylesheet" href="http://www.abc.com/style.css" type="text/css" media="screen" />
      </head>
    - <body>
      <a name="top" />
    - <div id="container">
    - <div id="header">
      <div id="postmark" />
    - <a href="http://www.abc.com/" class="imglink">
      <img id="logoimg" src="http://www.abc.com/images/zipcodes.gif" width="192" height="33" alt="Zipcodes America Logo" />
      </a>
      <hr />
      </div>
    - <div id="nav">
    - <ul>
    - <li>
      <a href="http://www.abc.com/" title="Home Page">Home</a>
      </li>
    - <li>
      <strong>Search</strong>
      (zipcode or suburb)
    - <div class="hide">
      <form method="post" action="http://www.abc.com/search" />        // line 23
      </div>
      <input type="text" name="q" class="searchbox" alt="Search query" />
      <br />
      <input type="submit" value="find!" class="searchbutton" alt="Perform search" />
      <div class="hide" />
      </li>
    …What I find it interesting is that it is possible to parse the above XML file with the same parseData() from another class without any problem. As a result, I have come to the following conclusion so far:
    ( i ) There is some file locking that is prevent saxBuilder from parsing the XML file at the time.
    ( ii ) The light_html2xml does not appears to have correctly converted over the orginal Html to Xml but some how it has been picked up by the parser in the same class, but not by the same parser from another class.
    ( iii ) I would like to use another conversion tool such as Tagsoup in place of light_html2xml to determine where the cause of this issue is coming from. As a result, would you or anyone be able to assist me coming up with a few lines of conversion statements using Tagsoup since I am not familiar with using this tool?
    ( iv ) light_html2xml is good as it strip out all namespace, DTD, Entity Resolver, etc and only return what I need. JTidy does correct conversion but include namespace, DTD, Entity Resolver which makes parsing difficulty.
    Many thanks again,
    Jack

  • Read XML File Using PL/SQL

    Hi,
    I have to read a XML file using PL/SQL. I am new to this so please explain in easy steps.
    Regards,
    SF

    STEP - 2
    SQL>
    SQL> DECLARE
      2    l_ctx dbms_xmlsave.ctxType ;
      3    l_xml CLOB :=
      4  '<?xml version="1.0" encoding="UTF-8" ?>
      5  <NewDataSet>
      6      <ROW>
      7          <DEPARTMENT>BA52</DEPARTMENT>
      8          <PCS_CONTRACT_TAG>MD-3GSM</PCS_CONTRACT_TAG>
      9          <LOCATION>Australia</LOCATION>
    10          <MAY_2006>21668</MAY_2006>
    11      </ROW>
    12      <ROW>
    13          <DEPARTMENT>BA501</DEPARTMENT>
    14          <PCS_CONTRACT_TAG>MD-3GSM</PCS_CONTRACT_TAG>
    15          <LOCATION>China</LOCATION>
    16          <MAY_2006>8166</MAY_2006>
    17      </ROW>
    18      <ROW>
    19          <DEPARTMENT>BA522</DEPARTMENT>
    20          <PCS_CONTRACT_TAG>MD-3GSM</PCS_CONTRACT_TAG>
    21          <LOCATION>Australia</LOCATION>
    22          <MAY_2006>21668</MAY_2006>
    23      </ROW>
    24  </NewDataSet>' ;
    25  BEGIN
    26      l_ctx := dbms_xmlsave.newContext(targetTable => 'XML_INSERT');
    27      dbms_output.put_line(dbms_xmlsave.insertXML(ctxHdl => l_ctx,
    28                                                  xDoc   => l_xml) ||
    29                           ' rows inserted.');
    30      dbms_xmlsave.closeContext(l_ctx);
    31  END;
    32  /
    3 rows inserted.
    PL/SQL procedure successfully completed.Regards.
    Satyaki De.

  • Reading/Writing .xlsx files using Webdynpro for Java

    Dear All
    I have a requirement to read/write excel files in .xlsx format. I am good in doing it with .xls format using jxl.jar. The jxl.jar doesn't support .xlsx format. Kindly help me in understanding how do I need to proceed on reading/writing .xlsx files using Webdynpro for Java.
    Thanks and Regards
    Ramamoorthy D

    i am using jdk 1.6.22 and IBM WebSphere
    when i use poi-3.6-20091214.jar and poi-ooxml-3.6-20091214.jar  to read .xlsx file. but i am getting following errors
    The project was not built since its classpath is incomplete. Cannot find the class
    file for java.lang.Iterable. Fix the classpath then try rebuilding this project.
    This compilation unit indirectly references the missing type java.lang.Iterable
    (typically some required class file is referencing a type outside the classpath)
    how can i resolve it
    here is the code that i have used
    public class HomeAction extends DispatchAction {
         public ActionForward addpage(
                             ActionMapping mapping,
                             ActionForm form,
                             HttpServletRequest request,
                             HttpServletResponse response)
                             throws Exception {     
                             String name = "C:/Documents and Settings/bharath/Desktop/Book1.xlsx";
               FileInputStream fis = null;
               try {
                   Object workbook = null;
                    fis = new FileInputStream(name);
                    XSSFWorkbook wb = new XSSFWorkbook(fis);
                    XSSFSheet sheet = (XSSFSheet) wb.getSheetAt(0);
                    Iterator rows = sheet.rowIterator();
                    int number=sheet.getLastRowNum();
                    System.out.println(" number of rows"+ number);
                    while (rows.hasNext())
                        XSSFRow row = ((XSSFRow) rows.next());
                        Iterator cells = row.cellIterator();
                        while(cells.hasNext())
                    XSSFCell cell = (XSSFCell) cells.next();
                    String Value=cell.getStringCellValue();
                    System.out.println(Value);
               } catch (IOException e) {
                    e.printStackTrace();
               } finally {
                    if (fis != null) {
                         fis.close();
                return mapping.findForward("returnjsp");

  • Procedure for read/write an XML-File using UCCX9

    Hi Team!
    Is there someone who can explain me the procedure of reading/writing an XML-File using Cisco UCCX Rel. 9.0?
    In the last couple of days I did a lot of research on the partner community as well as reading the CRS-Editor-PDFs.
    But I can’t find a solution.
    There are some templates available but they all didn’t seem to work.
    I have two xml-files, both uploaded to “Document Management\en_us\”.
    The script itself is attached to this posting.
    I build that my script according to a sample script I found in the community.
    From my point of view I have configured my script exactly like the sample script.
    But it still doesn’t work.
    I am especially interested in where to store the the appropriate files.
    I would be very happy if there is someone who can explain me, what’s wrong there.
    Many thanks in advance.
    Kind regards
    Michael

    I'm experiencing the same issue [reading XML causes errors that say things from "no such file" to some odd Java exception.] I'm able to use a template XML file and after authenticating a user, transform the template into a proper XML file and then successfully save it to the en_US Doc Repository with updated values.
    However, no matter what I've tried or who I've asked, the READ on the XML file so that I can actually script something that does some routing based on the value of the XML file created in my first script? Ultra fail.
    I've even worked with three separate TAC IPCC engineers who were able to reproduce the issue in their test environment, but they were unable to assist. Eventually, whe pressed, I received this response from the last IPCC engineer.:
    "Hello Brad,
    Yes I know what I provided you with is what you already have achieved and this missing step is precisely what you need: how to setup the script to check the status and value of this XML document and then decide routing according to the state.   But unfortunately this is what I found internally.  The other resources are the ones you already know:  support forums, scripting guides.  The other resource with suggest to customer looking for script assistance is the Cisco Account Manager of your company, they know where to get the resources for such issues.   Then again as I mentioned before on our phone conversation TAC does not support scripting but certainly if I find something else on my side I will let you know for sure."
    I would do ponderous cartwheels of joy if someone who has this working in version 9.x [9.0.2 specifically] could share the deep magic.

Maybe you are looking for

  • Customer open iteam reversal

    HI Experts I have problem in customer  open iteams i am having open iteams on different dates in different years is it possible to reverse all open iteams at a same time what is the best way to reverse number of open iteams at a same time can any one

  • Error in format date Oracle - SAP

    Hi Abapers, I am facing the following issue: i have a date field in ORACLE database and in SAP a have the corresponding field as DocDate(8),   When i read the field to the internal table i receive 12-JUN-1. I get the same result even if the field in

  • Fetching Data from SAP ECC to BODS 4.0

    HI, I am trying to fetch tables like LFA1 and ADRC into BODS from ECC. I am able to connect to the ECC system from BODS. In Data services Designer I go to Datastore and add a new datastore as SAP Applications. I am able to connect to ECC using this.

  • No MIC on front panel, when using LineIn from the Ca

    Hi My TV Card ist connected at the lineIn FLexiJack at the Card. When I connect a Microphone into the FrontPanel of my Fatalty I only get the sound from the TV Card. How can I use the Microphone? Which switch do I have to move?

  • Sony Handycam DCR-SX65 iMovie compatible?

    I can't log into the Sony site forums for some reason. One person I talked to on the site said that you can just not use the Sony software and just import into iMovie and be on your way. He also said I need to have at least iMovie 7.1.4. Mmmm my one