SAX DefaultHandler: calls characters() twice for each (atom) element?

I use sax to parse an xml file. i subclassed org.xml.sax.helpers.DefaultHandler and overwrote the corresponding methods like characters(). the problem is, that this method is called twice for each element value if this element has no subelements. example:
<collection>
<one>1</one>
<two>2</two>
<three>3</three>
</collection>
with this xml, characters is called once for <collection> but twice for each <one>, <two>, <three> element. why? is this a bug or is this customizable?

Look at what data is being passed to the method. The SAX specification allows the parser to pass the text node to characters() in pieces, it doesn't require it to pass the entire text in one call. And parsers do take advantage of that, in various ways. You'll have to assemble the data in the characters() method, but you can't assume you have all the data until endElement() is called.
I wouldn't expect your example to be a problem, but I suppose it's just an example and not the actual data you were processing.
Or possibly you are getting calls for the whitespace? In your example, your collection element has seven children: a text node containing a newline character, a one element, another newline text node, a two element, another newline text node, and so on.

Similar Messages

  • For each atom

    Hi experts,
    I would like to do a SQL querry in an atom SQL call inside a for each atom like that :
    My for each atom get back each result of my first sqlCall and my query in my second sqlCall compare an element with the current element of the for each atom like that : Select element from table where element1=current element of for each atom (which is one of results of first sql call)
    I don't know how to get back the current element in my query
    Does anyone know?
    Thank you
    Regards
    Sarah

    Hi
    Did you replace atom1 by atom4 here?
    Then in the  expression in the foreach atom use the Xpat like this:
    /vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;X&apos; and ./@id=&apos;atom1&apos;]/Items/Item
    If true then try this:
    /vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;X&apos; and ./@id=&apos;atom4&apos;]/*[local-name()=&apos;Items&apos;]/Item
    Regards

  • HT3702 i was told that the purchuse failed so why was i charge twice for the one transaction and there are more then one of them i have been charge twice for each of them i would my money back for each of the double tranactions thank you

    i have been charge twice for each of the tranactions i made and i would like them back thank you

    Simple process. If an iPhone go to the Apple Store and not Verizon
    the phone from Verizon will be a refurbished device and not new unless under the 14 day worry free guarantee
    good luck

  • While I'm addressing an email to several of my contacts, is it possible to keep the contacts folder up on the screen instead of calling it up for each individual person I wish to send the email to?

    While I'm addressing an email to several of my contacts, is it possible to keep the contacts folder up on the screen instead of calling it up for each individual person I wish to send the email to?

    Thanks for your help. On my own, I also discovered that in "mail" I could go to the menu bar and "window" and down to "address panel" which brought on screen and from there able to drag and drop addresses. As stated, I am a Mac "Newbie" and appreciate your help.

  • Vendor wise/Invoice wise consumption for each WBS element

    Any standard report from SAP, which provide details of Vendor Purchase order / Contract, details of SES with WBS no. and details of Vendor invoice in columnar form.
    SAP system can not generate standard reports giving vendor wise/Invoice wise consumption for each WBS element of particular asset.
    Please help me to get this report.
    Thanks in Advance.

    Hi
    Your starting point should be CJI3 report or any PS report... Here you get the FI Doc no
    If this FI Doc No is generated from MM, check the Header segment of the document.. It would have MM Doc NO + Fisc Yr populated in the ref key... This gives you the link between FI & MM
    From here on, you can take it forward... You can look up this doc no in MSEG Table and find the PO no... Then go to EKBE table for other PO details....
    br, Ajay M

  • Different call forwarding setting for each Skype n...

    I just bought a second Skype number and by the looks of it the only option is to forward them both to the same number. No way to set a different number for each?
    No obvious way to contact Skype.
    I'm pretty much done with this (offensive text removed) company.

    Hi, Dr. Design, and welcome to the Community,
    Interesting; I just answered the same question for another community member yesterday ... anyway, yes; you are correct.  As both Skype Numbers are affiliated with the same account, call forwarding is for the incoming calls to the account.  Another way to look at it is a Skype Number, or however many numbers someone purchases to add to their Skype account up to the maximum of ten (10) Skype Number subscriptions, provides more ways to access that particular Skype account.
    The work-around is to create additional Skype accounts when you are in a situation as you describe where you need multiple Skype Numbers, but each needs to be forwarded to a different "other" number.
    Good observation which I will forward to those to whom I report.  More information needs to be published on this.
    Here is a link to the instruction on how to contact Skype Customer Service via their secure portal: Contact Customer Service
    Regards,
    Elaine
    Was your question answered? Please click on the Accept as a Solution link so everyone can quickly find what works! Like a post or want to say, "Thank You" - ?? Click on the Kudos button!
    Trustworthy information: Brian Krebs: 3 Basic Rules for Online Safety and Consumer Reports: Guide to Internet Security Online Safety Tip: Change your passwords often!

  • For Each atoms

    Hello Experts:
      Is there a way to update local variable within the for each loop. I would like to update failure / success on DI object within the loop activity. Thank You!

    Hello Experts:
      Is there a way to update local variable within the for each loop. I would like to update failure / success on DI object within the loop activity. Thank You!

  • Type defined array of clusters for holding configuration data - setting default values for each array element

    Hi,
    I was wondering if I could get some information and opinions about using a type defined array of clusters to hold configuration data.  I am creating a program to test multiple DUTs and wanted to have a type defined control for each DUT containing the information needed to create the DAQmx tasks for all of the signals for that DUT.  I am wanting to do this so that the data is hard-coded and not in a file that the user could mess up.
    The type def controls are then put in a subVI that chooses the appropriate one based on the DUT Type enumeration wired to a case structure.  
    I am having problems with the type defined control.  I am seeing issues when attempting to save a unique configuration to each array element in the array of clusters.  Somehow it worked to begin with, but now clicking "Data Operations --> Make Current value default" on individual elements of the cluster or the entire cluster (array element) is not saving the data when I re-open the type def control.  What am I doing wrong?  Am I trying to do something with arrays of clusters that I should not be doing?
    I have attached one of the type defined controls for reference.  I tried changing it to Strict to see if that helped, but no luck.
    To reproduce, change the resource string for array element 0 and make the new value the default value.  Then close the type def, and re-open it.  The old value is still present in that element.  The VI is saved in LabVIEW 2012.
    Solved!
    Go to Solution.
    Attachments:
    CM_AnalogInputs.ctl ‏11 KB

    Values of a typedef are not proprigated to instances of the control. THey will pick it up if created AFTER the data values have been changed. THey will not get updated with future changes. You should either create a VI specifically for hardcoding your values or implement a file based initialization. The file based would be much better and more flexible. If you don't want users to modify the data simply encrypt it. There is a noce blowfish library you can download.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Connected to backup hard drive and library copied names twice for each song

    I use my externaly hard drive to keep a backup copy of my music library and when I was last reformating my laptop the itunes library added a second copy of every song which was located on my hard drive to my itunes library. My hard drive is not often plugged in to my PC so my itunes library shows that I have doubles of every song, even though it can't find the location of half those songs. Is there anyway to remove all the second copies of each song without losing the contents of my library file? If anyone can help it would be greatly appreciated. Thanks.

    kosty wrote:
    For the past year I've been using an external hard drive (HD1) connected to my airport extreme as the back-up location for time machine.  This has worked fine without any issues. 
    That may be true, but you need to know that backing-up that way is unreliable and not supported by Apple.   See:  Using Time Machine with an Airport Extreme Air Disk.  Do not be surprised if those backups suddenly turn up corrupted.
    What I am wondering is if I direct my time machine back-ups to HD1 will it back-up both my mac HD as well as HD2?
    No.  Time Machine cannot back up from any network location.  The 3rd-party utilities CarbonCopyCloner and ChronoSync may be workable alternatives.

  • Calling DB function for each row in a report

    I'd like to call a function inside a database package from my Oracle Report. My report is a very simple tabular listing and I'd like to pass one the row's column value as a parameter to my function call.
    Where would i have to write this block of code? How do I get the value of a particular column in the report? I need to pass the value to the function call.
    Thanks

    Depends what you want to do in this function. There are several possibilites:
    - Add a formula column to your data model.
    - Directly call the function in your query:
    select col1, col2, my_package.my_function(col1) return_value
    from my_table
    where ...The 2nd option would be my preferred one.

  • Page flow actions are called twice from each UI's action=...

    Odd observation: my nothing fancy login / pw change / logged in / jsps and pageflow are having the actions in the .jpf called twice for each jsp form action=.
    What can cause this?
    For example: the login jsp form action=loginAction, the corresponding method in the .jpf is called twice when the user clicks the login button on the login UI. The same behavior is observed for all the other actions in this page flow too.
    This has been a real problem for the pw change UI. Until I figured this out, pw change always returned invalid pw due to the second call to the action. :))
    tnx curt

    I have narrowed it down even more. What is happening is that you select the first item in the list it throws a validation error. I found this by adding and inline message. The weird thing is that if you select any other item in the list but the first everything flows as normal.
    This is a list of dates bound to a date type column in a database.
    Any Idea's why selecting the first item in a list would throw the validation message?

  • B1if - #sender system in for each processing loop

    Hi all,
    I am creating a scenario where I use the for each processing loop.
    Everything works fine but when I want to use the #Sender system in various steps (call B1 atom eg), I get an error saying the #Sender system is empty.
    Do I need to do something to get it populated inside the for each loop?
    Kind regards,
    Joeri

    Hi Joeri,
    I have done a test and I have the same problem you are having the system is empty when I use the #Sender System in a B1 call inside a for each. If I use a fix system id then it works fine.
    <?xml version="1.0" encoding="utf-8" ?>
    <Msg xmlns="urn:com.sap.b1i.vplatform:entity">
      <Body>
        <Payload Role="C" id="atom3" system="empty">
          <B1CallResult status="failure" b1login="Technical User" method="Synchronous Retrieval" objectid="4" payload="" keyname="ItemCode" keyvalue="A00001" />
        </Payload>
      </Body>
    </Msg>
    Please open a message for support asking for it and share the information with us.
    Hope it helps
    Trinidad.
    Edited by: Maria Trinidad MARTINEZ GEA on Jan 6, 2012 11:00 AM
    My previous answer was not related to your question...

  • Need new spool for each Start_form

    Hi all
    I have a print program for RFFOAVIS. i have different orders spools shoould be like one spool for each order. but now i am seeing only one spool for all orders.
    First Open_form, then I am calling the same for each order using start_form and end_form. then i am calling Close_form.
    Though in Open_form i pass options tdnewid as 'x' or space i am seeing only one spool for all the orders.
    but i need New spool for each order.
    Regards
    helpful answeres are surely rewarded

    Hi Priyanka,
    you have to 'X' the field TDFINAL in OPTIONS too.
    Try this.
    Cheers,
    Joost

  • AB: Everything appears twice in each entry

    After a nightmare of sync failures with my mobile phone I have an Address Book where everything appears twice for each entry: for a person X the phone numbers, e-mail addresses etc appear twice. I can remove the entries for some persons, but for some other persons removing the private address removes all private addresses for this entry.
    Any hints how I can solve this problem?
    Thanks in advance,
    Boris

    Not sure what phone you're using, but after similar nightmares (it's always a good idea to create a back up before synchronizing, so you can delete the messed up address book and import the back up in case of a problem).
    I got Mark Space's Missing Sync and it synchronized properly...so my advice is to start fresh from a backup (if you have one) and use MS.

  • Do I have to purchase OSX Mountain Lion for each computer

    I have Apple desktop and laptop that I want to upgrade to OS X Mountain Lion.  Do I have to purchase the software twice and download it twice for each computer?

    No. One purchase multiple installs. Just have 10.6.8 or Lion installed on each computer. Once you purchase and download you can redownload with the other computer by logging it into the App Store with the same Apple ID. Or you can do this to save the download time:
    Make Your Own Mountain/Lion Installer
    1. After downloading Mountain/Lion you must first save the Install Mac OS X Mountain/
        Lion application. After Mountain/Lion downloads DO NOT click on the Install button.
        Go to your Applications folder and make a copy of the Mountain/Lion installer. Move
        the copy into your Downloads folder. Now you can click on the Install button. You
        must do this because the installer deletes itself automatically when it finishes
        installing.
    2. Get a USB flash drive that is at least 8 GBs. Prep this flash drive as follows:
      a. Open Disk Utility in your Utilities folder.
      b. After DU loads select your flash drive (this is the entry with the mfgr.'s ID and size) from the left
          side list. Click on the Partition tab in the DU main window.
      c. Under the Volume Scheme heading set the number of partitions from the drop down menu to one.     
          Set the format type to Mac OS Extended (Journaled.) Click on the Options button, set the
          partition scheme to GUID then click on the OK button. Click on the Partition button and wait until
          the process has completed.
      d. Select the volume you just created (this is the sub-entry under the drive entry) from the left side
          list. Click on the Erase tab in the DU main window.
      e. Set the format type to Mac OS Extended (Journaled.) Click on the Options button, check the
          button for Zero Data and click on OK to return to the Erase window.
      f. Click on the Erase button. The format process can take up to an hour depending upon the flash
         drive size.
    3. Locate the saved Mountain/Lion installer in your Downloads folder. CTRL- or RIGHT-click on the installer and select Show Package Contents from the contextual menu. Double-click on the Contents folder to open it. Double-click on the SharedSupport folder. In this folder you will see a disc image named InstallESD.dmg.
    4. Plug in your freshly prepared USB flash drive. You are going to clone the content of the InstallESD.dmg disc image to the flash drive as follows:
      a. Double-click on the InstallESD.dmg file to mount it on your Desktop.
      b. Open Disk Utility.
      c. Select the USB flash drive from the left side list.
      d. Click on the Restore tab in the DU main window.
      e. Select the USB flash drive volume from the left side list and drag it to the Destination entry field.
      f. Drag the mounted disc icon from the Desktop into the Source entry field.
      g. Double-check you got it right, then click on the Restore button.
    When the clone is completed you have a fully bootable installer that you can use without having to re-download Mountain/Lion.
    Note: The term Mountain/Lion used above means Lion or Mountain Lion.
    As an alternative to the above (you still have to do your own download of Lion/Mountain Lion) you can try using Lion DiskMaker 2.0 that automates the process of Steps 2 through 4.

Maybe you are looking for

  • My email folders on iCloud mail are missing

    I have a new IPad Mini. All of my email folders are now missing after restoring from ICloud backup. Any help is appreciated. Thank you!

  • Searching for information flow tracking tool

    Dear All, I am new in the field of data/control flow analysis, and my current project requires me to find out the set of variables that can affect the value of another variable. For instance, public void m(int x)      int y = 0;      if (x == 1)     

  • TestPool method of data source is returning some strange value!!

    Hi All I am trying test a data source connection using the mbean api: testPool. It is giving me some weird output like: <method $Proxy18.testPool of $Proxy18 instance 5> My code:      connect('weblogic', 'weblogic1', 't3://localhost:7101')      serve

  • How to design 8x2 Table in webdynpro ?

    Hi, I have given a task of creating 8x2 (8 rows x 2 columns) table where top row should be filled with green/blue color for titlw purposes. I tried doing it without any luck. Please help me to design this table. Table can be any rows or any columns b

  • Guide to CRM billing

    Hello, I'm looking for a guide with the basic steps to setup CRM billing like a best practice guide. Does someone of you have such a guide and can provide this to me? Thanks a lot in advance! Cheers Thorsten