Can't parse beyond a certain point... HELP!!

Hey folks,
A cute little problem happens to me with a SAX parser:
I have an XML document with a number of "objects" in it. All the objects are made up of the same attributes.
If I parse the whole document and retrieve the values of every element successively (I have re-written the "startElement" and "characters" fonctions), all works fine. I can for example out.print each value in tun.
However, if I wait to be in a particular object (by comparing its value to a know String) to then out.print only its elements values, I can only retrieve the first 2 elements. After this all "characters" method are only passed with a null "ch" (the character array passed on that contains the characters making up the value string of that element).
It is the same for all xml files that I try, so it is definitely not that. And like I said if I retrieve them all in order it works...
here is some code:
(the second check in the if statements is the one that messes the whole thing, if it is not there, they will all print out fine...)
public void characters(char[] ch, int start, int length) {
        //depending on which element we are, we update the corresponding variable
        if(name){
            //copy to the name string
            Name=new String(ch,start,length);
            if (Name.compareTo(troopName)==0)
                System.out.println(Name);
            name=false;
        }else if(profile && Name.compareTo(troopName)==0){
            //copy to the profile string
            ProfileStr=new String(ch,start,length);
            System.out.println(ProfileStr);
            profile=false;
//This is the point after which "ch" is always null
        else if(minsquad && Name.compareTo(troopName)==0){
            number=new Integer(new String(ch,start,length));
            minSquad=number.intValue();
            System.out.println(minSquad);
            minsquad=false;
        }else if(maxsquad && Name.compareTo(troopName)==0){
            number=new Integer(new String(ch,start,length));
            maxSquad=number.intValue();
            System.out.println(maxSquad);
            maxsquad=false;
        }else if(weapons && Name.compareTo(troopName)==0){
            //copy to the name string
            Weapons=new String(ch,start,length);
            weapons=false;
        }else if(options && Name.compareTo(troopName)==0){
            //copy to the name string
            Options=new String(ch,start,length);
            System.out.println(Options);
            options=false;
        }else if(specialrules && Name.compareTo(troopName)==0){
            //copy to the name string
            SpecialRules=new String(ch,start,length);
            System.out.println(SpecialRules);
            specialrules=false;
        }else if(maxarmy && Name.compareTo(troopName)==0){
            number=new Integer(new String(ch,start,length));
            maxArmy=number.intValue();
            System.out.println(maxArmy);
            maxarmy=false;
    }I'm puzzled. Anybody?

You are assuming that the characters() method is passed the entire text node every time? That is not necessarily the case, you may get two or more calls which contain pieces of the text node.

Similar Messages

  • Payslip Programme unable to read beyond a certain Point(points guaranteed)

    Hi
    My client is unable to get the payslip  for employees beyond a certain period.I have used Transaction SARA and PC_PAYRESULT but still unable to find out the real reason.My questions:
    i.How do I find out till how much the data is archived?
    ii.Is the payslip programme RPCETD00 unable to read the arcfived data?
    iii.Can archived data be read from the clusters?
    Thanks and Regards
    Aniket C

    Hallo Aniket,
    My experience is that you can read archived data from transaction pc_payresult
    Also H99CWTR0 report can retrieve archived data.
    However, I am looking for a payslip report that can retrieve archived data. I have not found it yet.
    Regards Bente

  • What did I do wrong? I used to have iTunes installed on this computer and lost it when it crashed. No I can't get past a certain point in the installation point. I keep getting an error message stating that I need to verify that I have access to this file

    Help!! What's going wrong here. I used to have iTunes installed on this computer but lost it when it crashed. I've tried re-installing it numerous times but I keep getting the same error message. "Error writing to file: C:\ProgramFiles\iTunes.Resources\es.lproj\iPadLicense.rtf. Verify that you have access to that directory." I know I have access to that directory because on a different computer I can sync my iPad and iPhone. What am I doing wrong? What do I need to go in and authorize or turn on? Any help greatly appreciated. Thank you.

    That one's consistent with disk/file damage. The first thing I'd try with that is running a disk check (chkdsk) over your C drive.
    XP instructions in the following document: How to perform disk error checking in Windows XP
    Vista instructions in the following document: Check your hard disk for errors
    Windows 7 instructions in the following document: How to use CHKDSK (Check Disk)
    Select both Automatically fix file system errors and Scan for and attempt recovery of bad sectors, or use chkdsk /r (depending on which way you decide to go about doing this). You'll almost certainly have to schedule the chkdsk to run on startup. The scan should take quite a while ... if it quits after a few minutes or seconds, something's interfering with the scan.
    Does the chkdsk find/repair any damage? If so, can you get an install to go through properly afterwards?

  • Script not working beyond a certain point

    I have a script that checks a field for multiple ranges and changes another field's value depending on which range the first field's value falls within.
    If I clear the "Page1_Experience_Actual" field's value, the "Page1_Player_Level" field is equal to 0. This is as expected.
    If I enter 5 into the "Page1_Experience_Actual" field's value, the "Page1_Player_Level" field is equal to 1. This is as expected.
    if I enter 100 into the "Page1_Experience_Actual" field's value, the "Page1_Player_Level" field is equal to 2. This is as expected.
    If I enter 225 or more into the "Page1_Experience_Actual" field's values, "Page1_Player_Level" field is equal to whatever it was prior to entering the number. This is where the script hangs up.
    I can go back and enter any value <= 224 and the script appears to work again.
    I have looked over the script several times and the issue doesn't jump out at me. I need a few extra sets of eyes to help me out.
    Pastebin

    In that case, lines like this:
    this.getField("Page1_Player_Level").value = 0
    should be:
    event.value = 0;
    And at the beginning, I'd suggest doing this:
    // Get the field value
    var v = getField("Page1_Experience_Actual").value;
    // Set this field's value based on the value of the input
    if (v == "") {
      event.value = 0;
    } else if (v > 0 && v <= 99) {
      event.value = 1;
    } // etc.
    to make the code easier to maintain and decrease its size.
    If you're still having problems, check the JavaScript console (Ctrl+J) to see if any errors are reported.

  • My ipod touch is showing a usb pointing to the itunes logo on the screen and nothing else.  It won't switch on beyond that.  Please help!

    my ipod touch is showing a usb pointing to the itunes logo on the screen and nothing else.  It won't switch on beyond that.  Please help!

    Sounds like your iPod is in restore mode. Connect it to iTunes. iTunes will pop a little message up saying that your iPod is in restore mode and asking you if you want to restore it, click yes. Your iPod will restore to factory settings and you will be given the chance to restore from a backup. You can do this or set it up as a new iPod.
    Here is Apple's page on restoring your iPod.
    http://support.apple.com/kb/ht1414
    Hope that helps.

  • Can't link to a cell in another sheet at certain point

    Hello,
    this is the first time I use the support communities.
    I have a continuing promblem with numbers ( v. 2.3). I'm working on a projekt for my univerity and are quite familiar with number. But at a certain point it get's impossible to link to another cell on a different sheet! This works fine until a certain point (which I actually don't know).....
    I do the same stuff which I did very often before but it dosent work....
    1. I click on the cell I want to have the linked value in it
    2. I press = to start linking.
    3. I go to the cell i want to take the data from (in another sheet).
    4. The Box becomes white with the name and position of the source cell in it. But when I klick enter it dosn't work....
    I really don't have an idea what this could be... It worke fine in the same way before a few hundered times... Is there any limitation of link's between the single sheets or something?
    I'm very glad for any help in this issue
    Regards,
    Gregor

    On your last screenshot, you had moved off of the cell you were working on. The resulting formula/reference was not shown.
    Becasue it is not in English, it is hard for me to tell for sure what might be going on.  The reference in your third screnshot looked odd to me.  In English it would be one of the following forms when referencing a cell on a different sheet:
    Sheet name::Table Name::Cell address
    Table Name::Cell Address
    or, if "use header names as cell addresses" is on
    Sheet name::Table name::column name row name
    Table name:: column name row name
    column name row name
    The reference shown in your third screenshot doesn't seem to fit that pattern
    I am assuming if you look at your resulting formula, the cell reference is not in a colored oval, it looks like plain text.
    I've seen header names get misinterpreted by Numbers, like it can't figure them out and make a reference from them. If you are using header names as cell references, changing the names can fix it.  Turning off that feature might also fix it. I don't use that feature usually; it often makes my formulas too long and complicated.
    I have not seen a similiar problem with table and sheet names but you could try changing them to see if it helps.
    Sometimes Numbers simply has a problem with a reference and you have to start over with the formula and it will work the next time. I don't know why, it just happens sometimes.

  • I'm having problems creating a slideshow that I can burn to a DVD. I can see all of the pictures but it goes black at a certain point every time. I'm using iPhoto. I've tried copying it but the same thing happens. Ideas?

    I've loaded about 100 photos into a slideshow that I would like to burn into a DVD to share with friends at a 50th birthday celebration. It keeps going black at a certain point but I can see the pictures in the cue. Any ideas on how to correct this and how to burn it to disc easily? Thanks! This is my first time trying to do this.

    With the amount of information you've provided it's impossible to offer a potential solution.  We can't see your computer so we need to know the details of your problem and setup, i.e.:
    what version of iPhoto are you using?
    what system version are you running?
    how are you trying to export the slideshow?
    Here's how I recommend one get a slideshnow to iDVD: export the slideshow out of iPhoto as a QT movie file via the Export button in the lower toolbar.  Select Size = Medium or Large.
    Open iDVD, select a theme and drag the exported QT movie file into the open iDVD window being careful to avoid any drop zones.
    Follow this workflow to help assure the best quality video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    OT

  • HT4623 my iphone 3 when turned on shows  a picture of the jack and an arrow pointing to Itunes. I can't get it off this screen. help!

    my iphone 3 when turned on shows  a picture of the jack and an arrow pointing to Itunes. I can't get it off this screen. help!

    Do what you are being told. Plug the phone into a computer running iTunes and restore the phone.

  • Hey, I'm trying to install Adobe Flash on my Macbook Air. At a certain point it asks for my password but it doesn't take it. So I cannot continue installment. I have reset my password already. Still the same problem. How can I continue to install when it

    Hey, I'm trying to install Adobe Flash on my Macbook Air. At a certain point it asks for my password but it doesn't take it. So I cannot continue installment. I have reset my password already. Still the same problem. How can I continue to install when it keeps asking for a password it doesn't recognize over and over again? How many times do I have to reset it then? Advice please

    You have to provide your computer's administrator password in order to install Flash Player.

  • Bookmarks only scrolls down to a certain point and can't add any?

    Had a multiple virus attack and have most everything fairly well back to function and restoration. But in the process Bookmarks stopped functioning properly. I'm unable to add, only scrolls down to a certain point and I've gone through the Restore steps multiple times without success. HELP.

    What are the yellow warning signs, maybe a screenshot would help.
    * [[How to make screenshots]]
    * [[How do I create a screenshot of my problem?]]
    If you disconnect from the internet you will get warnings and they may include yellow triangles.
    Are you using the problem laptop again now or are you using something the cat has not been sleeping on ?
    From what you say it seems Firefox is working ok but some tabs still will not work

  • Flash can not parse this document. - Tried everything: Searching online, Calling Adobe, Online Help

    I have tried everything in fixing this problem. I have searched online with no help. And Google does not fix everything.
    I have tried calling the phone number on the help site numerous times only to be uselessly helped once. I was on hold for a long time with each one only to be unsuccessful in fixing my problem.
    I tried submitting the form on the page when you sign in and 3 times so far I was told to go to this extremely unhelpful devnet, which was all the phone support told me to do which was no help, and they closed all of the support requests.
    Does anyone know how to fix these errors:
    Flash can not parse this document.
    An error occurred opening file '.fla'
    Failed to open document..fla.
    I have converted it to a zip and went through all the files and did not see any error. The only one I did was MobileSettings.xml, which is blank and a new CS5 made file is blank and gives the error as well.
    Does anyone know how to fix this?

    you may have a corrupt fla.  try creating a new directory that has no subdirectories.  move that fla to the new directory.  try and open the fla from the new directory.  if it fails, you have a corrupt fla and, in that situation, i believe the best you can do is to take your last working swf and decompile it to create a working fla.

  • Ok so i'm trying to restore my iPod but every time at a certain point the iPod software update would freeze and says to make sure i'm connected to the internet and I am. Help me please

    Ok so i'm trying to restore my iPod but every time at a certain point the iPod software update would freeze and says to make sure i'm connected to the internet and I am. Help me please

    Let's try the following document with that one.
    iTunes for Windows: iTunes cannot contact the iPhone, iPad, or iPod software update server
    (If the "Automatically detect settings" checkbox is already checked, try unchecking and rechecking it and clicking OK.)

  • I am losing some of my contacts entered beyond a certain date repeatedly and automatically. I tried to disable sync with iCloud, but it didn't help. Please help me

    I am losing some of my contacts entered beyond a certain date repeatedly and automatically. I tried to disable sync with iCloud, but it didn't help. Please help me. I use an iPhone 5s with the latest software version.

    I understand now that apple forums do not work and are a waste of time

  • I can't change the color of an object past a certain point, it returns to original color

    Two problems/questions: Opening a file in photoshop cs4 today I noticed that all my folders were labeled as "pass through" (first time seeing this) and when I click the color icon box of an object in the layer pallete, it will not change the color past a certain point. To clarify, I have previously made an object or layer using the pen tool and filled it with a certain purple. Now I want to go back and make it a brighter purple. So I double click the color fill thumbnail in the layer and the color selection window pops up. I click the top right color of the area  (which happens to be the brightest color) and press ok, but my object stays as the original color I had made it before. What is the reason for this?
    Eric

    »Pass Through« indicates that Adjustment Layers will affect lower Layers outside the Group and that contained Layers with different Blend Modes will affect Blending with underlying Layers outside the Group accordingly.
    If you change it to Normal or any of the other Blend Modes everything contained within the Group will basically act as one flattened Layer and Adjustments only affect the Group’s pixel content.
    Could you post a screenshot of the document with the Solid Color Layer’s Color Picker and the Layers Panel visible?

  • Why can't I play a certain song on my iPad Mini when it was working the day before, but after syncing it to my iMac, it won't work on both my iPad and my iMac. Plz help

    Why can't I play a certain song on my iPad Mini when it was working the day before, but after syncing it to my iMac, it won't work on both my iPad and my iMac. Plz help

    Accidents happen, and apple can certainly assist you with replacement of said device.  Most manufacters would tell you to buy a brand new retail unit, apple will charge you about half price for a replacement unit.  I agree its unfortunate that it happend, but expecting a free replacement is just going to lead to disappointment

Maybe you are looking for

  • Creative T7900 Why don't 7.1 work with mplayer 10?

    Hi. I have Creative T7900 speaker system and soundblaster audigy 2 ZS platinium pro and my problem is that i can't get the 7.1 surround working with mediaplayer 10,winamp,creative media source when i try to play mp3s or music CDs it just gives me sou

  • Video output to my iMac?

    I just got my iMac a few weeks ago, and the screen is beautiful. Since I shelled out 1200 bucks, I don't really have the funds to upgrade my TV right now, which is an old tube with really funky colors(red shows up almost black). As a result, I was wo

  • Adobe Flash Player Quit Working

    I am running Windows Pro 7 (64-bit) and MSIE 9. For some unknown reason, my flash player quit working. No big deal, as I went to Adobe's download page and first obtained their uninstall executable. I used it to completely rid my machine of it's origi

  • Access 2003 vi's compatible with Access 2007?

    I will be doing some access DB work and am wondering if the vi's that worked with Access 2003 (XP) will work if the targeted computer has access 2007 installed?  The computer may have XP, Vista or 7 depending on where I run it. I have to get an answe

  • Deploying problem with remout OC4J (10.1.2)

    Hello! I have a problem with PDK-Java Portlet deployng. I'm relatively new in this field. I use Jdeveloper 10g (10.1.2). I have read in the Jdeveloper help how to deploy portlet on remout Application Server. I start the following comand in server's c