Multiple Selection in XML files

i have been having issue getting this code to work for multiple files. it does work for one xml file but i want it to work for multiple files can anybody help out
here is the code:
import java.sql.*;
import java.awt.*;
import javax.swing.*;   
import java.awt.event.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import org.w3c.dom.Node;
import org.w3c.dom.Element;
import java.io.*;
import java.util.*;
import java.text.*;
public class XMLExtractorPanel extends JPanel implements ActionListener
    JButton button, cButton, exitButton;
    JTextField field;
    JPanel buttonFieldPanel;
    Connection con;
    PreparedStatement stat;
    JPanel imagePanel;
    JPanel exitPanel;
    java.sql.Date sqlDate;
    public XMLExtractorPanel()
        this.setLayout(new BorderLayout());
        imagePanel = new JPanel();
        JLabel consult = new JLabel();
        consult.setIcon(new ImageIcon("images/t.jpg"));
        JLabel unity = new JLabel();
        unity.setIcon(new ImageIcon("images/y.jpg"));
        imagePanel.add(unity);
        imagePanel.add(consult);
        add(imagePanel, BorderLayout.PAGE_START);
        buttonFieldPanel = new JPanel();
        button = new JButton("");
        field = new JTextField(10);
        field.setBounds(30, 50, 200, 25);
        button.setBounds(240, 50, 100, 25);
        buttonFieldPanel.add(field);
        buttonFieldPanel.add(button);
        add(buttonFieldPanel, BorderLayout.CENTER);
        button.addActionListener(new ActionListener()
            public void actionPerformed(ActionEvent e)
                Chooser panel = new Chooser();
                field.setText(panel.fileName);
        JPanel cpanel = new JPanel();
        cButton = new JButton("CLICK TO SAVE DATA");
        cButton.addActionListener(this);
        cpanel.add(cButton);
        add(cpanel, BorderLayout.CENTER);
        exitPanel = new JPanel();
        exitButton = new JButton("EXIT");
        exitButton.setBounds(240, 50, 100, 25);
        exitButton.addActionListener(new ActionListener()
            public void actionPerformed(ActionEvent e)
                System.exit(0);
        exitPanel.add(exitButton);
        add(exitPanel, BorderLayout.PAGE_END);
    public void actionPerformed(ActionEvent e)
        cButton = (JButton)e.getSource();    
            getOperation();
    public void getOperation()
        Chooser panel = new Chooser();
            try
            ArrayList timeStamp = new ArrayList();
                 ArrayList Y = new ArrayList();
             File fXmlFile = new File(panel.fileName);
            DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
            DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
            Document doc = dBuilder.parse(fXmlFile);
            doc.getDocumentElement().normalize();
            BufferedReader rd = new BufferedReader(new FileReader(fXmlFile));
                    String fileUpload = "";
            do
                field.setText(fileUpload);
                System.out.println("Root element :" + doc.getDocumentElement().getNodeName());
                NodeList nList = doc.getElementsByTagName("Item");
                System.out.println("----------------------------");
                for (int temp = 0; temp < nList.getLength(); temp++)
                    Node nNode = nList.item(temp);
                    System.out.println("\nCurrent Element :" + nNode.getNodeName());
                    if (nNode.getNodeType() == Node.ELEMENT_NODE)
                         Calendar cal = Calendar.getInstance();
                        Format formatter = new SimpleDateFormat("dd/MM/yyyy");
                        String creationDate = formatter.format(new java.sql.Date(cal.getTimeInMillis()));
                        Element eElement = (Element) nNode;
                        double transCode =  Double.parseDouble(eElement.getAttribute("TransCode"));
                        double serialNo = Double.parseDouble(eElement.getAttribute("SerialNo"));
                        double amount = Double.parseDouble(eElement.getAttribute("Amount"));
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                                Connection con = DriverManager.getConnection("jdbc:odbc:DataSource", "", "");
                        stat = con.prepareStatement("INSERT INTO ExcelTable(TransCode, SerialNo, Amount) VALUES(?,?,?);");
                        stat.setDouble(4, transCode);
                        stat.setDouble(5, serialNo);
                        stat.setDouble(6, amount);
                        stat.executeUpdate();
                        con.close();
                //JOptionPane.showMessageDialog(null, "Data Recorded!", "Data Entry", JOptionPane.INFORMATION_MESSAGE);
            }while((fileUpload = rd.readLine()) != null); JOptionPane.showMessageDialog(null, "Data Recorded!", "Data Entry", JOptionPane.INFORMATION_MESSAGE);
            catch(SQLException ex)
                System.out.println("SQLException");
                ex.printStackTrace();
                JOptionPane.showMessageDialog(null, "Recorded Altered!", "Data Entry", JOptionPane.WARNING_MESSAGE);
            catch(NumberFormatException ex)
                System.out.println("NumberFormatException");
                System.out.println(ex);
                JOptionPane.showMessageDialog(null, "Recorded Altered!", "Data Entry", JOptionPane.WARNING_MESSAGE);
            catch(Exception e)   
                System.out.println("Error1 "+ e);
                JOptionPane.showMessageDialog(null, "Cannot Record Data!", "Data Entry", JOptionPane.WARNING_MESSAGE);
            if(con != null)
                try
                    con.close();
                catch(SQLException sqle)
                    System.err.println(sqle.getMessage());
                    JOptionPane.showMessageDialog(null, "Cannot Record Data!", "Data Entry", JOptionPane.WARNING_MESSAGE);
class Chooser extends JPanel
    JFileChooser chooser;
    String fileName;
    public Chooser()
        chooser = new JFileChooser();
        chooser.setMultiSelectionEnabled(true);
        int r = chooser.showOpenDialog(new JFrame());
        if (r == JFileChooser.APPROVE_OPTION)
            fileName = chooser.getSelectedFile().getPath();

Hi OCMF!
Thanks for your post, at this time you're only able to select
one document at a time within the my files section, which will
confine your deletion to individual steps.
We plan to improve the usability and functionality during
this beta phase, so keep your eyes peeled for coming updates!
Otherwise, thanks for being a part of Acrobat.com!
Cheers,
Pete

Similar Messages

  • Have found multiple iTunes Library.xml files. Moved Library to new Hard Drive and it needs to be completely rebuilt?

    Hello. I have a Mac Mini operating Mac OS X 10.7.2. I recently had to move my iTunes Library to a new hard drive. I followed the directions on how to move the library and refind everything yet when I do so what comes up is a mere skeleton of what I had. I have had to hunt down my purchased Apps, Music and Movies and re-add them to the library. I also noticed in doing this I have multiple iTunes Library.xml files ... shouldn't there only be one?  If so how do I clean this up without doing any accidental damage (i.e. how do I find the one that is being used and delete the rest?)?  If I delete the others is there any risk of losing purchased content? Lastly syncing my iPads has become a nightmare as I get the "This iPad is currently synced to another iTunes library" message. Obviously something

    It's hard for me to picture the exact situation. It sounds like you still have your library file on the internal but some files on the external, and maybe some on the internal, some of which are in the library and others not...  By re-adding things after consolidating it may have made things into a hodge-podge. Yes, that article you referenced says: "iTunes for Mac: Moving your iTunes Media folder"with Media Folder being the emphasis.  You probably should have just moved your whole iTunes folder.  Still, moving the media folder as instructed should not have messed up the library.  Did you make the mistake of starting up iTunes before the external drive had mounted fully and it then told you it couldn't find many files?  How you proceed to sort it out will depend upon how much time you want to spend and how important things such as ratings and playcount are to you.  I have not actually used the consolidate feature across different drives myself (and don't feel inclined to do so here to test ).
    If you are in the USA you can download some previous purhcases with iCloud, but not all.
    Here's a bit on what an iTunes folder should look like:
    What are the iTunes library files? - [http://support.apple.com/kb/HT1660]
    More on iTunes library files and what they do - [http://en.wikipedia.org/wiki/ITunes#Media_management]
    Library files with graphic and explanation of different iTunes versions - http://discussions.apple.com/message.jspa?messageID=13169517
    Once you get iTunes working off the external drive it should just put new media to the external when you add it.
    I have almost no experience with synching (I synched my neice's iPod, once, about 4 years ago).

  • File Dialog (Details View and Multiple Selections for View File Type)

    I would like to use the generic windows dialog box found in the toolbar under:
    File I/O/Advanced File Functions/File Dialog
    What I would like to do is have multiple selections for the file type, for example one menu selection is *.txt, another is *.rtf, another is *.csv, etc. Listing a single type is straightforward.
    Also does anyone know if there is a way to have the dialog open in the DETAILS view automatically?
    Thanks for any help!
    Carlton

    Hi,
    You can do it in following ways:
    1. Write in pattern input the string "*.txt; *.csv; *.rtf". This will show to the user only files with this extensions in the dialog.
    2. Another way is to create ring or menu where user could specify the extension. Depending on this extension you could wire the appropriate string to the pattern input of "File Dialog.vi"
    I have made an example.
    Good luck.
    Oleg Chutko.
    Attachments:
    fileopen.vi ‏42 KB

  • How can I open the selected many xml files at one time in framemaker?

    I want to open the selected xml files at one time in framemaker,but it allows to select one xml file at one time,if i want to select many files ,
    How can i to do?

    Please repost in the FrameMaker forum.
    Mike

  • How to use multiple ejb-jar.xml files

    Hello -
    If the project you work on has a lot of beans that you need to configure them in one ejb-jar.xml file. Then ejb-jar.xml file will be getting bigger and bigger. I am wondering if there is any way to divide the ejb-jar.xml file into multiple sub ejb-jar.xml files and then combin them together when deploy it. Same question question for the vendor ejb-jar.xml like weblogic-ejb-jar.xml.
    Thanks!
    Ben

    HI Ben,
    No, there is no notion of combining ejb-jar.xmls at deployment time in Java EE. There is no
    set limit on the number of ejb components within an ejb-jar module either.
    --ken                                                                                                                                                                                                                                                                                                                                                                                       

  • How to write multiple ejb-jar.xml file in an ejb module

    i am developing an ejb project. I hav a number of entity beans and session beans and their mapping in ejb-jar.xml. As the number of beans increases the entry of beans and mapping is also increasing. So i want to ask u that is there any mechanism so that i can divide the ejb-jar.xml file so that it will be easy to maintain it.

    ejb-jar is the smallest composable unit for related EJB components. Your best bet is to create multiple ejb-jars and package them within the same enterprise application (.ear).

  • Save multiple selections as separate files

    Hi. I've got a psd with two layers. The background layer is a photo, and the other one is transparent except for several rectangular areas. What I want is use that layer as a mask, and save each area from the photo in a single file.
    I have to do the same process with a lot of files, so an automatic or semiautomatic way would be perfect.
    I thought that the first pass was making a multiple selection of the areas. And then, save each one in a file. I don't know if it is possible.
    Any ideas are welcome. Thanks.

    thanks,
    finally with copy&paste and filter channels, i got it.
    i needed it for a color-course to show the two color systems.
    thanks

  • Working with multiple faces-config.xml files

    I would organize the menu definitions of my application in different faces-config.xml files. I would also put the label in different properties files.
    The SRDemo application uses a unique properties file for the menu used in the el expression from the faces-config.xml.
    Is it possible to have the same approach with not only one faces-config.xml file but has many faces-config.xml i want for my application.
    If yes does the binding name to be different or may be the same for each file ?

    We still have a litlle problem we don't find the reason. May be you can help us.
    The second menu level never appear in the menu list. The menu list appear as empty.
    The menu bar seem to be correct. We put twice the same model tree to be sure it was working well. Both menu appears. It is correct.
    Here is our faces-config-menu-flexsystem.xml file
    <?xml version="1.0" encoding="windows-1252"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
    <managed-bean>
    <description>Create menu item for flex system management</description>
    <managed-bean-name>menu_menuitem_FlexSystem_Create</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuItem</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>label</property-name>
    <value>#{resources['menu.FlexSystem.menuItem.create']}</value>
    </managed-property>
    <managed-property>
    <property-name>viewId</property-name>
    <null-value/>
    </managed-property>
    <managed-property>
    <property-name>outcome</property-name>
    <value>linkToCreateNewFlexSystem</value>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <description>Manage menu item for flex system management</description>
    <managed-bean-name>menu_menuitem_FlexSystem_Manage</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuItem</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>label</property-name>
    <value>#{resources['menu.FlexSystem.menuItem.manage']}</value>
    </managed-property>
    <managed-property>
    <property-name>viewId</property-name>
    <value>\FlexHome.jspx</value>
    </managed-property>
    <managed-property>
    <property-name>outcome</property-name>
    <value>linkToManageFlexSystem</value>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <description>Root menu item for flex system management</description>
    <managed-bean-name>menu_menuitem_FlexSystem_Root</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuItem</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>children</property-name>
    <list-entries>
    <value-class>flex.view.util.MenuItem</value-class>
    <value>#{menu_menuitem_FlexSystem_Create}</value>
    <value>#{menu_menuitem_FlexSystem_Manage}</value>
    </list-entries>
    </managed-property>
    <managed-property>
    <property-name>label</property-name>
    <value>#{resources['menu.FlexSystem.menuItem.root']}</value>
    </managed-property>
    </managed-bean>
    <application>
    <message-bundle>flex.view.resources.MenuFlexSystemProperties</message-bundle>
    <locale-config>
    <supported-locale>fr_CH</supported-locale>
    </locale-config>
    </application>
    <managed-bean>
    <managed-bean-name>resources</managed-bean-name>
    <managed-bean-class>flex.view.util.ResourceAdapter</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/FlexHome.jspx</from-view-id>
    <navigation-case>
    <from-outcome>linkToCreateNewFlexSystem</from-outcome>
    <to-view-id>/CreateNewFlexSystem.jspx</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/FlexHome.jspx</from-view-id>
    <navigation-case>
    <from-outcome>linkToManageFlexSystem</from-outcome>
    <to-view-id>/ManageFlexSystem.jspx</to-view-id>
    </navigation-case>
    </navigation-rule>
    <managed-bean>
    <managed-bean-name>menu_FlexSystem</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuTreeModelAdapter</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>childProperty</property-name>
    <value>children</value>
    </managed-property>
    <managed-property>
    <property-name>listInstance</property-name>
    <list-entries>
    <value-class>flex.view.util.MenuItem</value-class>
    <value>#{menu_menuitem_FlexSystem_Root}</value>
    <value>#{menu_menuitem_FlexSystem_Root}</value>
    </list-entries>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <managed-bean-name>menuModel</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuModelAdapter</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>viewIdProperty</property-name>
    <value>viewId</value>
    </managed-property>
    <managed-property>
    <property-name>instance</property-name>
    <value>#{menu_FlexSystem.model}</value>
    </managed-property>
    </managed-bean>
    </faces-config>

  • Reading multiple messages from XML file.

    Hi, I have such XML file:
    <?xml version="1.0" encoding="UTF-8"?>
    <dataroot xmlns:od="urn:schemas-microsoft-com:officedata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:SchemaLocation="xml_table.xsd" generated="2007-09-30T17:40:55">
    <xml_table>
    <id>1</id>
    <name>Pablik</name>
    <phone>7777777</phone>
    </xml_table>
    <xml_table>
    <id>2</id>
    <name>SomeName</name>
    <phone>2929292</phone>
    </xml_table>
    </dataroot>
    I have past this file through file adapter (using schema definition etc). I can read content of file:
    ora:getContentAsString(bpws:getVariableData('XMLType','dataroot'))
    But I can’t get xml element value, for example name... :
    bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table/ns15:name')
    Error: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 16d59568a10954ee:-4254ad7e:11580ba6d96:-7f38. Please check the process instance for detail.
    bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table[0]/ns15:name')
    Error: com.oracle.bpel.client.delivery.ReceiveTimeOutException: Waiting for response has timed out. The conversation id is 16d59568a10954ee:-4254ad7e:11580ba6d96:-7f3f. Please check the process instance for detail.
    ora:getNodeValue(bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table/ns15:name'))     
    Result: oracle.xml.parser.v2.XMLNodeList@1aa98f1
    ora:getNodeValue(bpws:getVariableData('XMLType','dataroot','/ns15:dataroot/ns15:xml_table[0]/ns15:name'))
    Result: oracle.xml.parser.v2.XMLNodeList@14cb6a0
    Etc.
    How can I get value through assign method?

    It looks to me that your XML data does not have a default namespace.
    You defined namespace "ns15" in your bpel process.
    Are you able to set the default name space in your xml data.
    Marc
    http://orasoa.blogspot.com

  • APEX File Browser ITEM - select only XML Files

    HI ALL,
    I have problem with File Browser Item.
    How to I use file browser item select only xmlfile (*.xml)?
    Edited by: Mahir M. Quluzade on Nov 29, 2010 2:33 PM

    Try using the attribute<tt>accept</tt> attribute using the item's HTML Form Element Attributes:
    accept="text/xml"but note the warnings about poor browser support.

  • [Faces] Criterias for multiple faces-config.xml files...

    Hi, I'm working in a big development proyect migrating an ERP. We know the mechanics of having multiple "faces-config" files, but is there some recommendation about the number of pages supported, or the total file size, or any other? We have found that jDeveloper has serious performance problems (in the development environment) with a big number of pages and navigation rules in one config file, but will it be the same if there are a lot of config files?
    Has someone come to the same questions? Can someone share his or her experience on this particular matter?
    Thanks for your

    See Re: Very slow performance in Jdeveloper

  • Multiple Project XML files

    Can I have multiple deployment project XML files(which makes descriptor file cleaner and easily maintainable)? If yes, how to specify each file name in Sessions.xml and can I use different datasources for different project XML files or it has to use the same datasource for the entire project? Any help is appreciated.
    Thanks,
    Rafi.

    Not in the sessions.xml, but it is possible to merge two projects together at runtime...
    Re: merging two different MWB projects at run-time

  • Upload XML file from Application Server to Internal Table

    Hi Experts,
       i have xml file in application server and i want to convert to internal table .
       i have tried this link http://wiki.sdn.sap.com/wiki/display/ABAP/UploadXMLfiletointernal+table.
       Here the file is loaded from local(presentation Server) ..
       i want to know how to select file from application layer ..and schedule in background..
       i also tried  FM '/SAPDMC/LSM_F4_SERVER_FILE' but this need front end selection of file from application server..
       i need to select a xml file from application server and convert into internal table in background.. help me on this..

    Have a look on
    Re: How to convert XML data to different ABAP internal table
    Thanks
    Ravin

  • Pre-populate a PDF from XML-file in Reader 7.07

    After the release of Reader 7.07, we can't pre-populate our forms any more.
    We are using the Java-script to pre-populate/import the XML into the document, but now the user has to select the XML file from an "open file dialog", so this solution doesn't work for us any more.
    I have seen in the forum that you can certify the PDF, but this doesn't work either, because when you open the PDF and imports the XML it's not certified any more.
    So can anyone tell me what is the procedure, for pre-populating a form in Reader 7.07
    Thanks
    Søren Høy

    After I removed the comma in the filenames of my problematic test files, this solution worked for me, too. I was able to again save the PDFs as enabled for commenting in Adobe Reader (to make them reviewable).
    Thank you, thank you!
    This definitely looks like a bug to me, because a comma IS allowed in filenames in both the PC Windows and Mac OS X operating systems.
    Andrea

  • How to work with .XML files with FINAL CUT PRO HD

    Ok so I am a newby, kind of. We filmed a feature using the SONY XDCAM 350. uses the optical 23.3GB disc. I used the camera to copy all the HD files ( .XML ) to an 1TB external drive. Now the drive is readable, everything looks fine, when I select a .XML file. Final Cut Pro HD opens, but then asks to choose a TRANSLATION file. Where do I go from here. I do not understand that command of action it is asking. Newby here, so pity me for awhile.
    Thanks

    my instinct is "No" but thats no (because the app is expecting th efiles to be located on an mounted XDCAM disc that is formated as such) ... but in your situation I'd be inclined to download the XDCAM Transfer app and try for myself
    what you may need to do though is get hold of the discs and a deck and import using the method above
    failing that you have the option of using Flip4Mac's MXF quicktime components ... not cheap.
    this will allow you to select the local XDCAM source media that you've alreday transfered in the native MXF format, and rewrap as Quicktime for editing in FCP
    (a trial version is available for download)
    ... and if thats out of budget, or for whatever reason not an option, you can sit it out and see if the next FCP revision helps you out any with its direct Log and Transfer support for XDCAM. may have the same restrictions though (ie need a properly attached formatted device)
    ... and other than that, you're looking at switching to an NLE with native MXF support (Avid, Edius, Vegas etc)

Maybe you are looking for