Some trouble with getElementById method

Hi
I have an XML file just like that:
<?xml version="1.0" encoding="UTF-8"?>
<persons id="root">
    <firstname1 id="firstname1">John</firstname1>
    <lastname1 id="lastname1">Brown</lastname1>
    <firstname2 id="firstname2">Andrew</firstname2>
    <lastname2 id="lastname2">Clark</lastname2>
    <firstname3 id="firstname3">Sylvie</firstname3>
    <lastname3 id="lastname3">Steevens</lastname3>
    <firstname4 id="lastname3"></firstname4>
    <lastname4 id="lastname4"></lastname4>
</persons>I enter this one into the Document by using the standard way, problem is with calling gsome etElementById method. When I put there any one id value, firstname1, or root for instance, then I get null.
What do I do wrong?
Regards
Krzysztof Malinowski

http://javaalmanac.com/egs/org.w3c.dom/GetById.html

Similar Messages

  • I have some trouble with Safari!  Everytime i google something, I expect safari to open the link i click in the same window and same tab - as it did before - but now it always opens a new tab! I'm getting really tired of that! So please help me!

    I have some trouble with Safari! 
    Everytime i google something, I expect safari to open the link i click in the same window and same tab - as it did before - but now it always opens a new tab! I'm getting really tired of that! So please help me! I want safari to open the google search link in the same window and tab! How to fix that?
    Please help me!!!
    Thank you!

    From the Safari menu bar, select
    Safari ▹ Preferences ▹ Extensions
    Turn all extensions OFF and test. If the problem is resolved, turn extensions back ON and then disable them one or a few at a time until you find the culprit.

  • TROUBLE WITH PAYMENT METHOD USED DIFFRENT VISA PAYMENTS STILL WONT WORK

    TROUBLE WITH PAYMENT METHOD USED DIFFRENT VISA PAYMENTS STILL WONT WORK

    This is a case for the iTunes Store Support:
    1. Go to expresslane.apple.com
    2. select 'itunes' and then 'itunes store' on the right
    3. select a topic and a subject
    4. click 'continue' and then 'email'
    5. fill out the form and explain your situation
    6. they will respond within 24 hours usually
    Good luck
    Stijn

  • I have some trouble With the graph XY, if I display a curve and try to zoom on it, it may be corrupted, or may disappeare​d.

    In fact this happens on some computers. the graph XY causes some trouble when zooming. Sometimes, when I run my main program and open the window with the graph, it has change the displayed it overflows to the edge of the windows. Or somtimes it works but if I zoom the curves disappeared, or is corrupted.
    I have this for instance on a computer with win 98 and a ATI graphic board. So I try to update all drivers but noting has changed. I try to decrease the hardware acceleration, and it seems to happen less oftenly.
    Does anybody have seen that kind of trouble ?

    > I have some trouble With the graph XY, if I display a curve and try to
    > zoom on it, it may be corrupted, or may disappeared.
    >
    I think what you are describing is not due to video driver, but rather
    to the way the graph works. The LV graph maps points to integer screen
    coordinates and draws lines be tween those point. When the numbers are
    way to large to fit on the screen, the numbers are pinned to a special
    large value. When this happenson one axis but not the other, it causes
    the slope of the line to change and potentially not cross the screen.
    If this is the same effect I'm describing, it only takes place when you
    zoom into the data by a large extent, pushing the other points about ten
    to fifteen monitors away. At this point you are no longer
    looking at
    measured data, but rather just on the interpolation of a line between
    two points. The solution if you must have one is to resample your data
    on the diagram to contain more points.
    Greg McKaskle

  • Hi! I have some troubles with my iphone 4...

    Hi! I have some troubles with my iphone 4 since a few months. Sometimes, suddenly, it pretends to discharge very fast, but when it comes to 1% I can still use it for hours. Also, when I recharge it, nothing would change at the 1%-note but the battery seems to be fully charged. The first and second time this happened, I made the mistake to turn the phone off because I thought a restart would solve the problem. But it made it worse: The Iphone wouldn't turn on again. I tried all the tricks with home + power button and also tried to connect it to itunes on my macbook, but nothing happend. When I connect the charger it shows me that the battery is empty (which isn't the case - I also tried different wires). After a few hours a little miracle occured and the **** thing turned on all by itself and pretended as if nothing happened.
    The third time this happend I didn't turn the phone off and just used it normally. I took care that the battery is always full and after a few days it was normal again.
    Now it happened again but I had no wire with me at work and the battery ran low and the phone turned off. Now I'm trying to "reanimate" it for 2 days now...nothing. The last times it took 3hours to 12 hours until it would awake but now...
    Does anyone know this problem and knows how to solve it? As I said, I already tried the "press the home button and powerbutton and both and whatever" tricks for a few times but it doesn't change anything....
    Cheers,
    Diana

    Buzz! Thank you for playing!
    You're out of luck. At least here. Discussing jailbroken devices is forbidden by the terms of service.
    It's likely the jailbreak has permanently hosed it.

  • HT201365 Hello . I have an iphone for which is currently IOS 7 updated. I have had some trouble with its batery life after IOS 7 update. I advised from the phone shop that I need to give it a factory restart and I made it. Now i have icloud activation loc

    Hello . I have an iphone for which is currently IOS 7 updated. I have had some trouble with its batery life after IOS 7 update. I advised from the phone shop that I need to give it a factory restart and I made it. Now i have icloud activation lock and I have no idea when I create an icloud account. I donr remember any related email or password. I am completely losttt
    Any help guys ? ( I am currently stuck with Nokia 2210

    Welcome to the Apple community.
    Unfortunately, unless you know the Apple ID, there is absolutely nothing that can be done, you cannot use your mobile device. You may be able to find your Apple ID at Look up your old and forgotten Apple ID

  • With the latest update, i have some trouble with youtube. Every videos that i watch are shaking. Is there something to fix it?

    With the latest update, i have some trouble with youtube. Every videos that i watch are shaking. Is there something to fix it?

    Instantly worked, found this on other thread!!
    1. System Preferences >  Flash Player > Advanced >  Delete  All
         Press the "Delete All" button
    2. Safari > Preferences > Privacy
        Press the button “ Remove All Website Data”.
    *Dont forget to restart Safari

  • I had some troubles with Raid 0

    Hello, I'm having some troubles with my computer. Before nothing excuse me please if i'm not writting english very well its just because i'm not speak it very well.
    This is my computer's configuration:
    Motherboard MSI 875P Neo Series (MS-6758)
    Pentium IV Hyper Threading 3GHz
    2GB Ram DDR 400 Kingston
    2 HDD Maxtor Diamond 9 80GB @ 7200RPM (With ventilator and dissipator each one)
    DVD Rom Samsung
    DVD Ram Sony
    NVidia GeForce FX-5200 128MB (MSI, too)
    Power Supply AOpen ATX-300GU (The Computer Housing haves 2 ventilators behind and 1 more in the front)
    I'm just trying to use good components for this computer, but i have these problems:
    1. When I'm working with Windows XP Professional, suddenly the PC resets itself. I was trying to disable the "Restarts Automatically" option from My PC Properties to see if it was a Windows problem or a Hardware one, but the second problem becomes more persistent and I neglect it.
    2. This problem is the hardest one for me (I lost just 2 weeks trying to solve it but I cannot solve it). Sometimes, when I restart the PC, I can see that in the First Screen (The MSI's Logo) the system it's blocked and I must  restart the PC from the front button or turn off (Sometimes the PC don't block this part). Then When I restart, In the Raid Bios (when you must press ctrl + i) it don't recognize the Raid 0.  Sometimes send these messages:
    Raid 0: Failed
    Maxtor 0: Missing
    Maxtor 1: Fine
    Or simply:
    Raid 0: Failed
    Maxtor 0: Fine
    Maxtor 1: Fine
    If this message appears, I can enter pressing Ctrl + I and the system question me if some hard disks belongs to the Raid 0 array, I answer "YES" and the Raid is repaired. Then I restart the PC and I can work very well in Windows. But suddenly if I restart or turn off the PC the problem appears again. It don't causes information Trouble or missing files or Operating System,  but it's very annoying and therefore it doesn't have to happen... This is a list of things that I was made to try to repair it but I simple and simply fail.
    a) I was change the motherboard for another 875P MSI but it was equal.
    b) I was change the memory too, and decrease it.
    c) I upgrade the BIOS to Version 1.8 I guess
    d) I disconnect the 5 extra ventilators thinking in a probably power fail, but not
    e) I was change (too) the Hard Disks for 2 Seagate Barracuda (I don't have the model but it's of 80GB too)
    f) I was change the motherboard for an 865 but I forget a little detail: It don't have the Raid option  
    g) I was change the Power Supply for another similar but.... not....
    h) I was change too the SATA cables...
    i) I was change too the processor and I was installing a PIV HT 2.4GHz but....  
    Like you can see, I was almost assembling a new pc but i continued with the troubles. The configuration in BIOS is correct, I was checking it in this page and everythings seems to be OK... Right now i'm working with this pc without a Raid 0 array and I'm working fine (for now) but it's very important for me to be working with the array. I'm not sure if I'm forgetting something in BIOS, but I'm sure that everything is OK... I would be happy if someone can help me....

    This power supply is too small.
    Acer shows the +12 rail as having a normal current of 4.3A and a max of 13A. Your CPU will draw around 10A, plus your drives and fans draw from this rail as well.
    This site indicates your power supply should be around 500W.

  • Some trouble in setSize() method

    I writed some code for resize jpanel's size,It work well in J2SE131,but it have some trouble in J2SE141.
    Now I write one test program for test this problem.code list under this statement.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Frame1 extends JFrame {
    private JPanel contentPane;
    private BorderLayout borderLayout1 = new BorderLayout();
    private JScrollPane jScrollPane1 = new JScrollPane();
    private JPanel jPanel1 = new JPanel();
    //Construct the frame
    public Frame1() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    contentPane = (JPanel) this.getContentPane();
    contentPane.setLayout(borderLayout1);
    this.setSize(new Dimension(400, 300));
    this.setTitle("Frame Title");
    jPanel1.setPreferredSize(new Dimension(400, 280));
    jPanel1.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
    jPanel1_mouseClicked(e);
    contentPane.add(jScrollPane1, BorderLayout.CENTER);
    jScrollPane1.getViewport().add(jPanel1, null);
    catch(Exception e) {
    e.printStackTrace();
    //Overridden so we can exit when window is closed
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if (e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void jPanel1_mouseClicked(MouseEvent e) {
    System.out.println(jPanel1.getSize());
    jPanel1.setSize((int)(jPanel1.getWidth()*1.2),(int)(jPanel1.getHeight()*1.2));
    System.out.println(jPanel1.getSize());
    System.out.println("*******");
    public static void main(String[] args){
    Frame1 f = new Frame1();
    f.show();
    compile it,and run it under J2SE131,jPanel1 can zoom in container--jScrollPane1.
    but in J2SE141,it can setSize,out windows:
    java.awt.Dimension[width=400,height=280]
    java.awt.Dimension[width=480,height=336]
    java.awt.Dimension[width=400,height=280]
    java.awt.Dimension[width=480,height=336]
    java.awt.Dimension[width=400,height=280]
    java.awt.Dimension[width=480,height=336]
    it said setSzie() work OK,but jPanel1's size recover again.
    I want know why it happend,and how to make it work well in J2SE141.
    Thanks a lot.
    [email protected],cn

    I add one statement after setSize() sttement,it can work well in J2SE141.
    jPanel1.setPreferredSize(new Dimension((int)(jPanel1.getWidth()*1.2), (int)(jPanel1.getHeight()*1.2)));
    It maybe get preferred size in update method(),why sun'doc not notice about this?

  • Trouble with forward() method in a Servlet

    I am new to Servlets and am having trouble with one that queries a database and forwards the data to a JSP. A portion of the code is below (The <i> are really , but are being displayed wrong).
                   for(int i = 0; i < numberOfRows; i++)
                        data2[0] = rs.getString("REIMBUR_DATE");
                        data2[i][1] = occupancyPCT;
                        data2[i][2] = rs.getString("RMBR_RATE_REVENUE");
                        data2[i][3] = rs.getString("RMBR_ROOM_TAX");
                        data2[i][4] = "reimbur total";
                        data2[i][5] = rs.getString("BOOK_RATE_REVENUE");
                        data2[i][6] = rs.getString("BOOK_ROOM_TAX");
                        data2[i][7] = "rebate";
                        data2[i][8] = "tax rebate";
                        rs.next();
                   request.setAttribute("CERT_INFO", data);
                   request.setAttribute("OTHER_INFO", data2);
                   request.setAttribute("NUMBER_ROWS", new Integer(numberOfRows));
                   ServletContext context = getServletContext();
                   RequestDispatcher dispatcher = context.getRequestDispatcher("/certdetails.jsp");
                   dispatcher.forward(request, response);
              catch(Exception ee)
                   PrintWriter out = null;
                   response.setContentType("text/html");
                   out = response.getWriter();
                   out.println("<html>");
                   out.println("<body>");
                   out.println("Exception !!<br>");
                   out.println(ee.getMessage());
                   out.println("</body>");
                   out.println("</html>");
    When I include the line with the forward() method, I get an exception and the message is "1998-08-20", the contents of data2[numberOfRows - 1][0]. I don't know why an exception is being generated or how it is getting this database value as its message. What's going on?

    Nevermind, I found the problem. There was an error in my JSP. I don't know how it affected the Servlet as it did, but...who cares!!

  • I have some troubles with my lovely iPod nano :(

    Dear readers
    I have troubles with my iPod nano.
    Trouble #1: The pictures are not in the right order (by date).
    Trouble #2: Some songs just skip to the next one. **** annoying!
    Trouble #3: What is error 69?
    Trouble #4: I forgot how to make my iPod reappear in my iTune, so it would be very nice if you tell me how to do it.
    Thanks
    Nonstupid_Billy (Billy is my nickname)

    Ahhh, the new Error 69. Many people but not all have the same problem. E-mail Apple about this and try to use the last version of iTunes. For the songs skipping, there is an error when syncing those songs and were not synced properly. Try reseting the ipod to factory settings

  • Having trouble with "main" method

    I have just installed j2re1.4.1 and I am having trouble running my applications. Every time I try to run even the smallest of apps I get an error message about the "Main" method.
    In textpad i get this message:
    "Exception in thread "main" java.lang.NoClassDefFoundError:"
    and in Jcreator I get this message:
    "The system couldnt find a suitable main method"
    what is going wrong?How can I fix this?

    It could be something as simple as Case :-/
    If you have a file Foo.java with a class Foo with a main()
    you can compile it with javac foo.javawhich will create Foo.classbut you cannot run it with java fooyou will get Exception in thread "main" java.lang.NoClassDefFoundError: roids (wrong name: Foo)whereas java Foowill work just fine.

  • I am having some trouble with receiving messages from iMessage users when I don't have my iMessage turned on. When I called for support, I spent 30 min waiting and the woman's response to me was "Turn on your iMessage." I prefer not to use it

    I have an iPhone 5s and a MacBook Pro. Ever since I updated my computer software to Yosemite, it linked my Apple ID with my phone number and I am not receiving messages from iMessage users on my phone, but rather to my computer. I don't like to use iMessage so I keep it off and would like to receive all messages as SMS texts. I have already tried changing my Apple ID password, logging off of my Apple ID in iMessage on my phone and turning it off, and changing settings on messages on my computer. Nothing is working. Either the messages continue to go to my computer or the messages trying to be sent say they cannot be sent.
    After spending 30 + minutes waiting for technical support, the woman helping me (who did not give me her name) told me I should just turn on iMessage. After explaining that I don't like having iMessage on and asking why it worked for at least a year up until this point she said "things change and sometimes we don't know why things do what they do". She asked me about various other things on my phone such as bluetooth and told me to turn on and off airplane mode and the call disconnected. I have not been contacted since, even though she has my phone number.
    I am hoping for some help and also hoping people don't get the type of service I received tonight.

    I think you can solve your problems by removing your AppleID email address from BOTH the Messages setting on your iPhone and the iMessages settings on your Mac.
    On iPhone:
    Settings > Messages > iMessage > Dissabled
    Settings > Messages > Send & Receive > touch the "(i)" < touch "Remove This Email"
    On Mac:
    Open "Messages" application
    Click "Messages menu > Preferences
    Click "Accounts"
    Select your AppleID account
    Under the "You can be reached for messages at" settings, uncheck your AppleID email address and your phone number
    Then uncheck the "Enable this account" setting
    And lastly, ask all of your friends with iPhones to delete all iMessage conversations (blue bubbles) in their entirety.
    To test, send a friend a new text using their phone number (not their email address) and watch the color of the bubble.  If it's green then you are using SMS.

  • I am having some trouble with Adobe Flash Player

    I have tried to record an audioboo and when I press record the Adobe Flash Player comes up and asks to allow the mic etc... I set it up to allow but then can't close the box!? I have tried lots of times and it just won't close and hence I can't record the boo. I don't have a problem closing the flash player any other time and I have in fact recorded audioboo's before, but for some reason I can't now? Any help or advice would be great. 

    I have the exact same issue - but the funny thing is that it is only on my iMac - my MacBook Pro is fine and they both have 10.7.2 and the same latest Flash Player, so I think it might be a hardware problem to be honest.
    Ever since upgrading to Lion my iMac has been that way - my MacBook Pro had the problem with the first update from Adobe but after the second update of the Flash Player everything is fine on the MacBook Pro.
    How old is you MacBook Pro?

  • Some troubles with filetransfers

    I have to transfer files from a Webserver running with ancient OS to Tigermaschines (Powerbooks...) and back.
    So I can mount activate Filesharing and mount the Tiger on the old machine; transfered files have false characters in the filename in case of some signs in german..
    With a ftp application (Cyberduck) sitting on Tiger all fetched files beyond html and text files have an second fileextension hqx and are not referenced in webpages, resulting in an linkerror...
    On settings in Cyberduck I have Automatic, Binary, or ASCII; changing the settings brings no better result.
    Lies my mistake on the Tiger or on the ancient software (FTP-Server)?
    Thank you,
    Karl
    Powerbook 15 alu; iMac G5; iMac G4; ibook 2002   Mac OS X (10.4.3)  

    is there any problem with artcovers in the ipod cos when i put artcover in the song i have in my ipod it doesnt sync with itunes
    If you are adding artwork to the songs directly to the iPod it won't sync this to the same songs in iTunes. For a start, to add artwork directly to the iPod it must be set to "manual" and under those circumstances nothing syncs from iPod to iTunes.
    The correct way is to add artwork to the songs in your iTunes library, then transfer those songs to your iPod either manually or automatic sync.
    You should try adding the artwork to the songs in iTunes first, not directly to the songs on the iPod (through iTunes).
    If you add artwork directly to the iPod, the artwork is sometimes not displayed when playing songs.

Maybe you are looking for

  • I saved an email as a draft,but couldn't figure out how to send it.

    I rarely save emails to the draft folder,but I did yesterday,as I wanted to wait before sending the email.I shut the computer down,and when I returned to the draft folder today,my composed email was there,but for the life of me,I couldn't figure out

  • Refresh fails on materialized view with CLOB data type

    Hi, Hope somebody can help me with this issue. Some materialized views get status broken on refreshment, but only sometime. When I try to refresh them manually I get following message: "ORA-01400: cannot insert NULL into...". But I know for sure that

  • DB_BLOCK_BUFFERS PARAMETER TUNING(ORACLE7)

    제품 : ORACLE SERVER 작성날짜 : 2002-04-12 DB_BLOCK_BUFFERS PARAMETER TUNING(ORACLE7) ========================================== Purpose Oracle7 version의 database에서 db block buffer의 값이 적당한 지를 알아보고 Tuning 하는 방법을 알아보자. Explanation 1. DB_BLOCK_BUFFERS paramet

  • Combo of T61 and customer support problems

    My main problem is that my T61 freezes up.  It came with a 2 gig ram, sbbb Intel core 2 duo t7500 processor, 1 gig turbo memory window's ultimate 32 bit os and an 80 gig hard drive. This problem has been going on intermittently (odd) since I  receive

  • HOWTO: nikon nef thumbs in gnome 3 nautilus

    install gnome-raw-thumbnailer from the aur. as root create, then edit the file /usr/share/thumbnailers/nef-thumbnailer.thumbnailer to contain the following [Thumbnailer Entry] Exec=/usr/bin/gnome-raw-thumbnailer -s %s %i %o MimeType=image/x-nikon-nef