Could not read XML nodes

Hi, I have a simple xml file:



  
  
  
  

but I can't not only to what is in the first line, I mean: the values A, B, C, D and e. by this code:

_fileConnection = (FileConnection)
                Connector.open("file:///store/home/user/"+_fileName, Connector.READ);

            _documentBuilderFactory = DocumentBuilderFactory.newInstance();
            _documentBuilder = _documentBuilderFactory.newDocumentBuilder();
    _is = _fileConnection.openInputStream();
    _document = _documentBuilder.parse(_is);
    _rootElement = _document.getDocumentElement();
    _rootElement.normalize();

vector.addElement(_rootElement.getAttribute("A")); //and so on

but then, when I want to access to the:


 
 
 

I can't. I do something like this:

_nodeList = _rootElement.getChildNodes ();

for (_i int = 0; _i<_nodeList.getLength();>

System.out.println ("type" + _nodeList.item (_i) .getNodeValue ());

}

and what I get is:

type

value of type null

type

value of type null

and so on...

What's wrong? How can I get these items?

concerning

OK, I got it solved:

 for( int _i = 0; _i < _nodeList.getLength(); _i++ ){

        _node = _nodeList.item(_i);

        if( _node.getNodeName().equals("item") ){

 System.out.println.("value "+_node.getAttributes().getNamedItem("max_ammount"));

                }

            }//end of for

Java docs are very useful. but when you don't know how to start and are not even getting the general idea - you ask on the forum

best regards and thx for the help!

Tags: BlackBerry Developers

Similar Questions

  • Impossible to analyze the xml.aspx contained in the main.js.Iam get the following error"could not obtain XML document, and the connection has failed: status 500

    Impossible to analyze the xml.aspx contained in the main.js.Iam get the following error"could not obtain XML document, and the connection has failed: status 500

    My main.js resembles

    xmlDataSource var = {}
     
    URL: 'dcds. - symbianxml.aspx", etc. (sample).
     
    init: function() {}
    URL, successful reminder, the reminder of failure
    This.Connect (this.) (URL, this.responseHandler, this.failureHandler);
    },
     
    /**
    * Analyzes the XML document in an array of JS objects
    @param xmlDoc XML Document
    * @returns {table} array of objects of the device
    */
    parseResponse: {function (xmlDoc)}
        
    var chElements = xmlDoc.getElementsByTagName ("channel");
       
    channels of var = [];
      
    Console.log (chElements.Length);
      
    for (var i = 0; i)< chelements.length;="">
        
    var channel = {};
       
    for (var j = 0; j)< chelements[i].childnodes.length;="">
        
    var node = Sublst.ChildNodes(1).ChildNodes(0) chElements [i] [j];
                
    If (node.nodeType! = 1) {//not an element node}
    continue;
    }
           
    Channel [node. TagName] = node.textContent;
    }
       
    Channels.push (Channel);
    }
    Console.log (Channels.Length);
    return the strings;
    },
     
    /**
    Manages the response and displays the data from device web app
    @param xmlDoc
    */
    responseHandler: {function (xmlDoc)}
      
    var channel = this.parseResponse (xmlDoc);
    var markup = "";
       
    for (i = 0; i< channels.length;="">
       
    markup += this.generateHTMLMarkup (i, channels [i]);
    }
    document.getElementById("accordian").innerHTML = mark-up;
    },
     
    /**
    Generates HTML tags to insert in to the DOM Web App.
    * @index i, index of the device
    @param device, device object
    */
    /*
    generateHTMLMarkup: function (i, channel) {}
      
    var str ="";
    "Str += '.


    ' onclick =-"mwl.setGroupTarget ('#accordian ',' #items_" + i + "', 'ui-show ',' ui - hide');" + ".
    "mwl.setGroupTarget ('#accordian ',' item_title_ #" + i + "', 'ui-open', 'ui-farm'); Returns false; \ » > » ;
    "" Str += "" + channel ['name'] + ' ";
    "Str += '.
    ";
    "Str += '.
    ";
    "Str += '.
    "+" id: "+ channel ['id'] +" ' "
    ";
    "Str += '.
    "+" type: "+ channel ['type'] +" ' "
    ";
    "Str += '.
    "+" language: "+ channel ['language'] +" ' "
    ";
    "Str += '.
    «+ "bandwidth:" + "fast" channel + "»»
    ";
    "Str += '.
    "+" cellnapid: "+ channel ["cellnapid"] +". "
    ";
    "Str += '.
    «+ ' link: '+'start the video »»
    ";
    "Str += '.
    ";
    return str;
    },*/
    generateHTMLMarkup: function (i, channel) {}
       
    var str ="";
    "Str += '.
    ";
    str +=  "" +
    "" + channel ['name'] + ""+""
    ";
    "Str += '.
    «+ ' link: '+'start the video »»
    ";
         
    return str;

    },
     
    failureHandler: {function (reason)}
    document.getElementById("accordian").innerHTML = "could not get XML document.
    '+ reason;
    },
     
    /**
    Retrieves a resource XML in the given URL using XMLHttpRequest.
    @param url URL of the XML resource to retrieve
    @param called successCb, in the XML resourece is recovered successfully. Retrieved XML document is passed as an argument.
    @param failCb called, if something goes wrong. Reasons, in text format, is passed as an argument.
    */

    Connect: {function (url, successCb, failCb)
      
    var XMLHTTP = new XMLHttpRequest();
      
    XMLHTTP. Open ("GET", url, true);

    xmlhttp.setRequestHeader("Accept","text/xml,application/xml");
    xmlhttp.setRequestHeader ("Cache-Control", "non-cache");
    xmlhttp.setRequestHeader ("Pragma", "non-cache" "");
      
    var that = this;
    XMLHTTP.onreadystatechange = function() {}
       
    If (xmlhttp.readyState == 4) {}
        
    If (XMLHTTP. Status == 200) {}
         
    {if (!) XMLHTTP.responseXML)}
    try {}
    If server has not responded with good an XML MIME type.
    var domParser = new DOMParser();
    var xmlDoc = domParser.parseFromString(xmlhttp.responseText,"text/xml");
           
    successCb.call (that, xmlDoc);
           
    } catch (e) {}
    failCb.call (, "answer was not in an XML format.");
    }
              
    } else {}
    successCb.call (that, xmlhttp.responseXML);
    }
    } else {}
    failCb.call (this, "connection failed: status"+ xmlhttp.status ");
    }
    }
    };
    XMLHTTP. Send();
    }
    };

    Please see the content in main.js is fully analyzed.

    Forward for the solution to my request all members of the community...

  • "Could not read data" when you try to print from Android

    Hello. I have a printer HP Officejet 6700 Premium, which is connected via ePrint/HP connected to my Google account so that I can print from my Google devices (Cloud Print). While this works very well when printing from my laptop (29 Chrome on Ubuntu 13.04), it does not when printing my Nexus 10 (Android 4.3) or my Galaxy Nexus (CyanogenMod 10.1.3). I tried printing both outside and inside the network on which the printer is on, but whenever I get "could not read data" in the Cloud Print dialog box. It seems that Cloud Print knows that the printer exists, since it is on the list, but it cannot communicate with the printer. Any way to solve this problem? He's good enough additional features only on my previous printer, who died of old age.

    It seems to me that the question is in fact Cloud Print related. Here is the support page: https://support.google.com/cloudprint/?rd=1

    Remember that Google Cloud Print is still in beta phase. Good luck tomslominski.

  • Microsoft Outlook 2016 "could not read the calendar. Unknown error.

    iCloud version 5.1 Windows last 10 develop Outlook 2016 Dell XPS8300

    iCloud moved very well and without error messages. iCloud Contacts and reminders are OK, but when I access iCloud calendar I get this message: "could not read the calendar. Unknown error'

    Three facilities on other similar configuration PCs were flawless with every feature works perfectly.

    Have reinstalled Office 365 and iCloud 5.1 on affected PC several times with the same error when access iCloud calendar.

    Corrections and troubleshooting suggestions are most appreciated.

    Surprisingly, all that was necessary to solve this problem was to select the iCloud in 2016 Outlook tab and press the button refresh!

  • "Setup could not read the CD you inserted, or the CD is not a valid Windows CD"

    Well, I'm going to install a Windows XP operating system. It is a upgrade disk. However, when I tried, I get error message saying:

    "Setup could not read the CD you inserted, or the CD is not a valid Windows CD", and it gives me a list of other operating systems.
    This is a new computer, so it is not any previous operating system.
    The manual says I can do a fresh install, but it allows me, I get this error message. Any ideas?

    Hi Branden,

    It is quite possible that the CD you are trying to use is corrupted. Wipe the disc with a clean cloth.

    In addition, it may be due to the fact that you are using a CD to upgrade and you are trying to do a clean install.

    ·         You have an earlier version of Windows CD?

    If so, you need to first install the previous version and then upgrade to Windows XP.

    Also, check for a similar description here.

    Not a valid Windows CD - Microsoft Answers

  • How to "Windows did not start because of a configuration of the disk of the computer problem. Could not read the selected startup disk... "on a netbook without a CD/disk drive?

    I did a lot of research and unfortunately havnt found a road toward the front of the detroit to a fix. Long story short... I installed Jolicloud as a dual boot with windows xp on netbook gateway of my wife. This netbook has no cd/dvd drive. Jolicloud wanted to screw up the startup option to not allow me to boot into windows, going Strait to jolicloud without option of windows. I tried to change it via the "menu.lst" and Grub.cfg file (I think) the only value I changed was I think 'boot... ". ' value between 1 and 2. When I restarted, then finally got a startup list (although I don't think that my modification of the value gave me the list, I had already installed manually "Grub" via the cmd prompt. I should have just restarted from there without changing anything else... because when I chose 'windows xp' in the start menu... He gave me a black screen and kept going back to the start menu. Then, I tried the "Vista loader" option... hoping that it would some how solve my problem... He asked me if I wanted to run a repair any. I agree with him and when he finished he told me that there is no enough space on the hard disk to copy the files (or something like that) then it froze kind of there. I had to do a hard reboot after that that it froze, then I got the code "Windows did not start because of a computer disk configuration problem. Could not read from the selected boot disk.  check the hardware path and startup disk, please check the windows documentation about hardware disk configuration and your hardware for more information reference manuals.

    Again, I have no drive cd/dvd on a netbook... IM assuming that im going to have to return a key USB with windows boot info to load the Manu F2 at startup... But I do not know... Help, please. Thank you

    Hello

    Follow method 1 and 4 in the article below and check if that helps resolve the issue.
    Error message: "Windows did not start because of a configuration of the disk of the computer problem.
    http://support.Microsoft.com/kb/314477/en-us

    I hope this helps.

  • Dual Boot with windows XP Pro with 2 HARD drive, error on secondary windows install: "Windows did not start because of a configuration of the disk of the computer problem. Could not read the selected boot disk. Check boot path and disk hardware... »

    Hi, I recently bought a new Hitachi 1 TB internal hard drive. I wanted to do a clean install on the new drive (d), be able to dual boot my computer and leave my old 300 GB disk (C :) as the primary windows installation. After physically installing the new HARD drive, I noticed that "new hardware found" and the the brand name flashed in the bottom right corner. I thought I'd see the new hard drive in my computer, but I did not. I initialized the new HARD drive with the computer management window (right click on my computer - manage) and I also formatted in NTFS (I had to change my printer hard drive letter to assign the new HARD drive with the letter D, but I've made other changes after this step). Now, I could see and use in my main windows on the C: installation. I then installed a windows new copy XP pro with the installation CD I got for my C: but on the D: (Note: I have a Dell computer (and the Dell reinstallation CD) and my current version of windows has SP3 while the installation CD is only SP2) (I also reformatted my HARD drive during the installation of windows to NTFS)

    Now when I try to start on installing the new on my D: I get "Windows did not start because of a configuration of the disk of the computer problem. Could not read the selected boot disk. Check startup disk and hardware access path. "and another line saying to refer to manuals HARD drive and windows.

    My Boot.ini file at this time was:

    [boot loader]
    Timeout = 5
    default = multi (0) disk (0) rdisk (0) partition (2) \WINDOWS
    [operating systems]
    "multi (0) disk (0) rdisk (0) partition (2) \WINDOWS="Microsoft Windows XP Professional "/ noexecute = optin/fastdetect
    "signature (ac516a5c) disk (0) rdisk (0) partition (1) \WINDOWS="Microsoft Windows XP Professional own "/ noexecute = optin/fastdetect

    I looked towards the top of this help page, but for now I'm unlucky:

    http://support.Microsoft.com/kb/314477

    (The next steps I took by throwing from the Windows CD and go into the repair console)

    I tried to use the bootcfg /rebuild but the line to boot.ini for my secondary HARD drive still does not work.

    He gave me something like:

    [boot loader]
    Timeout = 5
    default = multi (0) disk (0) rdisk (0) partition (2) \WINDOWS
    [operating systems]
    "multi (0) disk (0) rdisk (0) partition (2) \WINDOWS="Microsoft Windows XP Professional "/ noexecute = optin/fastdetect
    "signature (ac516a5c) disk (0) rdisk (1) partition (1) \WINDOWS="Microsoft Windows XP Professional own "/ noexecute = optin/fastdetect

    I also tried to change the signature() to multi (0), but it did not work. (or try almost all possible permutations of disk() and rdisk() partition() 0 to 2).

    I also tried to use expand F(dvd-drive):\i386\ntkrnlmp(I_have_a_duo-core).ex_ D:\windows\system32\ntoskrnl.exe and a few other combinations, but I when I login as D:\windows simply, it fails to extend with a message like "could not develop" or C:\windows I get "restricted access".

    I have not yet tried CHKDSK/r, but since I did a clean install on a newly formatted drive... I don't think it would work.

    I've also marked the partition on the D: as active (in computer management), but it did not help me.

    I've done a first installation of windows repair, strangely, I couldn't fix this one... Still does not work...

    My default windows installation yet works very well & I see that windows has been installed on the D: but I'm ideas from how to operate the dual-boot, can someone throw me a BONE on what to do?

    Maybe try to do something with the Boot Manager (whatever it is?) Create a new partition and use it as a boot manager? I don't really want to do this, because if I made a mistake I will be unable to use my computer and dual boot should work without going through all this trouble... But I found this page: http://technet.microsoft.com/fr-fr/library/ee829686%28WS.10%29.aspx

    Could a clean install two HDD help? I hope I won't have to do...

    Someone has an idea?

    PS: I'm not such an advanced user so I need a solution step by step, thanks!

    Edit: I also noted that I can't see my new HARD drive in my BIOS... weird... SATA-0 is my old drive HARD 1 and 2 are my dvd 3-5 readers are 'off' and it doesn't seem to be anything that it is plugged in. I also have 4 bays for internal HARD disks. Now, 2 are busy.

    Edit2: I looked inside my case and enabled the good Sata in the Bios after a reboot it detected the drive correctly. Dual boot doesn't always work well... The fact that it was disable in the BIOS while I was installing the new HARD drive could change anything? Hmm...

    In case I wasn't clear enough: I had a windows XP Pro installed on my C:, bought a new hard drive and installed the same copy of windows on it (d). I think that should allow me to double boot between the two installs different. Even if for some reason I can't boot from one on my D:. Andrew, I do not understand why you so far physically disconnect the other drive, the point of the whole operation is to build a boot.ini file so that the BIOS knows that it y facilities 2 windows and you allow to choose (and not have conflicting problems between the 2 systems), someone correct me if I'm wrong? "Expand" the part of my first post made reference to one of the solutions provided by Microsoft in the first link that I have included in my previous post (but I can't seem to work).

    In addition, it is the procedure that I followed: http://www.ehow.com/how_5950826_boot-two-different-hard-drives.html

    (except I've had the first installation already done).

    Andrew "also, once a new hd is plugged on the pc & running, most of the BIOS will place (them) as 1st priority hd, set the BIOS to do this", you mean that by installing separately from windows on each unit when the other is not plugged in, I could choose what disk to start from defining their priority in the BIOS once they are all plugged back? It's too tedious (as I intend to move frequently between the 2 installs) and requires a computer to other users of the lack of computer knowledge. Unfortunately, it is not a viable option.

    EDIT: I DID IT! Hmmm... Well, I double checked in the recovery console, the path of the new HARD drive with the arc command Scan. Tried to start again with the MULTI (0) in my boot.ini and it worked... I also had my windows install CD in. Maybe that is why I could not start, windows needs the CD to complete the installation? Weird, I don't know what I did to the difficulty it... but hey, it works! Thanks for your ideas guys!

  • Free extractor error - could not read the news SFX

    I hope I am in the right forum!

    I am downloading Gamblock on my laptop, but when I run the file and try to check out I get the error "FreeExtractor error - an error prevents this program to continue - could not read the news SFX - it is probably corrupted.

    GamBlock are several that this isn't a problem with the link, and to be honest I have not had problem with it in the past. I am at my wits end with it but now and wonder what it is that it blocks and think it must have something to do with the system in some way.

    The laptop is brand new

    Any help would be great!

    Hello les150,

    I suggest that you run the System File Checker to see if you have corrupted system files.

    First of all, we run System File Checker to see if you have a corrupt file system.

    Click Start
    Type: CMD, according to the results, right-click CMD
    Click on "Run as Administrator"
    At the command prompt, type: sfc/scannow

    This will check for any violation of the integrity and repair any damaged operating system files.

    Restart your system

    Now run the command chkdsk:
    1 disable any security software before you attempt to upgrade or do a clean install.
    2. make sure that your computer is updated (devices and applications)
    3. disconnect all external devices before installing.
    4. check your hard disk for errors:
    Click Start
    Type: CMD, according to the results, right-click CMD
    Click on "Run as Administrator"
    At the command prompt, type: chkdsk /f /r
    When you restart your system, your computer will be scanned for errors and will try to correct them.

    If please reply back and let us know if this helped with your question.

    Sincerely,

    Marilyn
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • How can I fix this "Setup was unable to find (or could not read) the language specific setup resource dll, unable to continue." Error if please restart and try again. » ?

    I'm trying to install Microsoft FreeLancer on Windows 7 64 bit Home Premium edition (according to WinVer: Version 6.1, build 6701, Service Pack 1).

    After inserting the DVD in the drive and run "Setup.exe", I am invited by the UAC to elevate permissions - who I am agreement - then the following error message appears: "Setup was unable to find (or could not read) the language specific setup resource dll, unable to continue." If please restart and try again. »

    The only valid technote, I found the issue was http://support.microsoft.com/kb/258496. The below is the list of the things that I tried after reading this technote - but no avail.

    • Of course, I tried to restart.
    • I checked the DVD is in good condition, even with regard to the attempts to install from the disc to a friend and even went up to compare the MD5 of all files on two DVDs, the checksums match.
    • I tried using the compatibility mode for XP, although according to the report of another user on the statements of the Windows Compatibility Center that this should not be necessary.
    • I ran a full "chkdsk" (i.e. one scheduled for after a reboot, rebooted) and chkdsk reported no error.
    • I deleted all files "di - use ' %TEMP%, immediately after the restart and before you run setup.exe.
    • I've looked at this the EMET tool had an exemption for 'setup.exe' and my tool anti-virus was disabled before installation.

    Everything I try seems to have no effect on the resolution of this problem.

    Can anyone suggest any possible causes of--and, ideally, solutions to-this issue?

    Kind regards

    Alex.

    ... "Step 1: perform the clean boot to verify if it's a software conflict matter. '...

    -Tried but not given to impact.

    ... "Step 2: System File Checker tool"...

    -Tried but not given to impact.

    ... "I would have you check the same DVD on another computer and check if it works. '...

    -The only other machine that I use Ubuntu. My other half uses only his Mac.

    I managed to work around this problem by using the following workaround solution:

    I installed Freelancer CD on a Windows XP virtual machine running in VMWare Workstation. I then moved the installation directory (C:\Program Files\FreeLancer) off the coast of the virtual machine on my Windows 7 computer in (C:\Program Files (x 86) \FreeLancer).

    The game seems to work fine as long as it is run with administrative privileges (that is, the freelancer.exe running). Without administrator rights, the games is never recorded. With them, they are registered under "C:\Program Files (x 86) \FreeLancer\EXE\Accts\SinglePlayer" successfully.

  • 25541 error could not open xml file c:\windows\microsoftnet\framework\v2.0.50727\config\machine.config, 2147024786 system error... what kind of error is it?

    25541 error could not open xml file c:\windows\microsoftnet\framework\v2.0.50727\config\machine.config, 2147024786 system error... what kind of error is it?

    I had tried... .but not possible... someone has this problem soluton...

    Prom KrishnaNyaupane Hello,

    Please check the TechNet link below for a proposed solution.
    http://social.technet.Microsoft.com/forums/en-us/officesetupdeploy/thread/86787c69-5909-4885-843e-b8b977e5cc33

    Let us know if it helps.

    Marilyn

  • Error message on the 'open' file: 'cannot place the illustration. Could not read the tiff preview.

    To all,

    When you try to open an illustrator file I get the following error message:

    "Cannot place the illustration. Could not read the tiff preview.

    Anyone know how I can recover my document?

    Thank you

    Ian

    Version of IT? OPERATING SYSTEM?

    Does the linked graphics?

    You have several versions of the installed AI? If so, try all versions.

    Have you tried to drag the Acrobat file? Maybe he will open it.

    Just noticed you said "Can PLACE the illustration. You place instead of open by chance?

  • Recently, I buy a Sony camera a6000.  I am currently using 2.5 Lightroon.  When I tried to load my raw files from a card reader to Lightroom, but failed as Lightroom could not read images.  Can anyone help?  Thank you, Eric

    Recently, I buy a Sony camera a6000.  I am currently using 2.5 Lightroon.  When I tried to load my raw files from a card reader to Lightroom, but failed as Lightroom could not read images.  Can anyone help?  Thank you, Eric

    Upgrade, or -.

    Convert raw DNG images using the Adobe DNG Converter program free of charge your Sony raw images. Then import the DNG versions in Lightroom.

    "Adobe DNG Converter" is not part of Lightroom (or Photoshop), but a separate (standalone).

    You "run" program, select the folder of images from Sony, select a folder for the output DNG files.

    Using Photoshop | Digital Negative (DNG)

  • Could not copy a file at the location requested. Mac OS 10, Version 10.10 [1].  I JUST bought this new macbook pro and Lightroom installed, imported 2 lots of pictures, but all of a sudden he kept denying my imports with "could not read the file" or "coul

    Could not copy a file at the location requested. Mac OS 10, Version 10.10 [1].

    I JUST bought this new macbook pro and Lightroom installed, imported 2 lots of pictures, but all of a sudden he kept denying my imports with "could not read the file" or "couldn't copy file at the location requested.  Help, please!

    Your use of the word "files" (in the plural) still makes me believe that you have not checked the permissions on the folder that is appropriate (in the singular).

    You must determine the Destination of the Lightroom Import dialog window Panel and see which folder Lightroom is really tr6ing to copy photos in (which may have been accidentally changed and is not what you may have used in the past) and change the permissions to write to this folder.

  • Could not read from the source. Please check if it is moved or eliminated

    Hi all

    When I try to make a project afx since media encode I get the following message

    "Could not read from the source." Please check if it is moved or eliminated.

    I read on the forum that this is due to an old installation of first.

    I use a brand new computer. the only installed software is my master collection cs5 and updates from the adobe Web site.

    Win7 pro

    I7

    16 gig RAM

    see you soon

    s

    I think that it maybe because - adobe cs5 installation of plug-ins in a central location

    C:\Program Files\Adobe\Common\Plug-ins\CS5\MediaCore

    (probably a file path different bit on a mac)

    Media Encoder cannot load these plugins.

    I tried to get out of there and put after effects plugins folder

    that seems to work for me

  • CS4 Pr-encoder: "Encoding not a not/could not read in the source...". »

    When I start the tail layout it apears to be loading fine but then after a few minutes, it gives me the triangle of yellow danger on the status column. I have tryied changing the settings and still the same.

    "Could not read from the source." Please check if it is moved or eliminated. »
    .. .is that details notebook displays

    It is my first Pr CS4 retouching, help please.

    Thank you!

    This Article from KB Adobe can help you.

    Good luck

    Hunt

Maybe you are looking for