Element.getAttributes() not working as it should

Hi people,
I am using xerces to parse an XML file and reformat it into a newer XML file. Along the way i have to read all the attributes of a tag and update a new node with those tags. Here's the code for that method:
private void addAllAttributes(Element originalElement, Element destinationE)
        NamedNodeMap attributes = originalElement.getAttributes();
        //System.out.println("stoi="+originalElement.getAttribute("stoichiometry"));
        //System.out.println("length="+attributes.getLength());
        for(int i = 0; i < attributes.getLength(); i++)
            Node child = attributes.item(i);
            String nName = child.getNodeName().trim();
            String nValue = child.getNodeValue().trim();
            //System.out.println(nName);
            //System.out.println(nValue);
            if(nName.equals("specieReference")) nName = "speciesReference";
            if(nName.equals("specie")) nName = "species";
            destinationE.setAttribute(nName,nValue);
            //System.out.println("here "+i);
    }The problem is that the method only seems to be working on the first attribute - in fact i'm only getting an attribute list of size 1 when the actual file has more attributes. Here's a snippet of XML on which the method doesn't work on:
<listOfProducts>
  <specieReference specie="HOBr" stoichiometry="2" />
</listOfProducts>The aforementioned method successfully converts the "specieReference" tag to "speciesReference" and the "specie" attribute to "species". But the code acts as if the stoichiometry attribute does not even exist.
Does anybody know what is going wrong here please?
Thanks!
JJ.

The original element can be ANY element in an existing XML file. I then create a Document in my class by calling
DocumentBuilder... etc.
Element newElement = doc.createElementthen i call the method as above, with the new element and original element as arguments.

Similar Messages

  • Webi report on OLAP Bex query -  Cost element Hierarchy not working Drill down

    Hello,
    We have a BO report on Bex query, Not on universe, we have a Hierarchy for Cost Element Group, and we are expecting the Drill down functionality for that in BO report, but it does not.
    Webi report on OLAP Bex query -  Cost element Hierarchy not working Drill down
    Any pointers how to do it please
    Thanks
    Krishna

    Hi,
    WebI reports on BEx source don't use same Drill feature as other sources, it's replaced by expland/collapse of hierarchy nodes (documented in WebI user guide in § "24.1 Drill defined"). This means you have to create query which selects all hierarchy sub-tree you plan on exploring later in report, otherwise if no data is available under a node there will be no '+/-' sign to visit this part of tree.
    You could try first to select "All members" from hierarchy in QueryPanel and see if behavior in report suits your needs. Then you should restrict hierarchy member selection to what's really needed to avoid performance issues.
    Regards,
    Loic

  • Why is my adobe photoshop elements 12 not working. it says initializing and then it says there is an error and closes itself

    why is my adobe photoshop elements 12 not working. it says initializing then error and shuts itself down.

    Three things you can try:
    1. Clean the superdrive with a proprietory CD/DVD lens cleaner that uses tiny brushes.
    2. Perform an SMC reset:
    Resetting the SMC (System Management Controller) on Intel-based Macs:
    http://support.apple.com/kb/ht3964  and
    http://support.apple.com/kb/HT1237?viewlocale=en_US
    Resetting your Mac's PRAM and NVRAM:
    http://support.apple.com/kb/ht1379
    If you are using a Wireless Keyboard:
    http://support.apple.com/kb/TS3273
    3. Try the free DVD player VLC:
    http://www.videolan.org/vlc/
    which performs better than the built-in DVD Player.

  • HT5654 Just tried 3 times to update iTunes on my PC running Vista.  There was an error.  It stopped the installation.  Now iTunes will not start at all.  The error message tells me to reinstall which I tried but did not work.  What should I do?

    Just tried 3 times to update iTunes on my PC running Vista.  There was an error.  It stopped the installation.  Now iTunes will not start at all.  The error message tells me to reinstall which I tried but did not work.  What should I do?

    Hello, Jdragone. 
    Thanks for the question.  Start with completely uninstalling iTunes and all of it's components in the order specified in the article below.  Once this is done, download and install iTunes.
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    If you receive any errors when uninstalling any components of iTunes, try the steps in the article below for each component that gives you an error.
    "The feature you are trying to use is on a network resource that is unavailable" alert appears when removing Apple software in Windows
    http://support.apple.com/kb/TS3704
    Cheers,
    Jason H.

  • Why inspect element is not working in firebug after updating firefox to 14 version?

    firefox upgraded to 14.0.1. After this, I am not able to see element html code in firebug.
    i.e inspect element is not working as expected.

    If you still experience this problem, please post it to the [https://groups.google.com/forum/#!forum/firebug Firebug discussion group].
    Sebastian

  • Creative cloud photoshop blur tool not work as it should be

    creative cloud photoshop blur tool not work as it should be !
    I go to blur a painting i am doing and it does not blur enough and I am using wacom Intuos 5 med pen tablet.
    and I even set the tablets sensitivty for pressure lower then default and still not getting the blur tool to do its job.
    I even adjusted the brush settings too to be able to blur even more on hard settings, still nothing.
    at least it not bluring enough to see any major changes.
    the only way i can blur anything is by using the fliters blur or the brushes ( mixer brush ) settings to mix colors and do it that way.
    (note) I will not post my systems specs sorry I don't do that and even the tech from adobe said I do not have to. and so I wont !
    just need advise not to share system specs.
    and thats what this forums board is for getting advice and read what others say about the issue at hand.
    it's not to post or share system specs  !!!
    so with that out of the way I need advice only please ?

    Hi,
    It might be your image is too big in terms of pixel dimensions for the blur tool to work well.
    If you zoom to 100% do you see any change when using the blur tool?
    What are the pixel dimensions of the image?
    (Image>Image Size)
    If you try a small image, does the blur tool work?
    What about when you use the mouse instead of your tablet?
    Can you at least tell us what operating system and version of photoshop your using?

  • My passbook on my iphone 5 works the same as it did for the iphone 4, its not working like it should. why?

    my pass book on my iphone 5 does not work like it should, it works just the same as it did on the iphone 4, i tryed the date an time trick like 5 times an still nothing. i tryed factory reset an nothing. i know it workds different on the iphone 5 then the 4. but i dont know what else to do.

    Can you be more specific about what isn't working?  Are you running iOS 6 or iOS 6.1?
    Did you read the support page on Passbook?  http://support.apple.com/kb/HT5483

  • Siri is not working like it should i ask it to play songs and it just says sorry i cant do that any ideas y

    siri is not working like it should i asked it to play songs and it just says sorry i cant do it any ideas y

    Debbie:
    deborahfromwindsor wrote:
    he advises restarting by inserting the OSX disc and pressing down the C button to reboot from there then selecting disk utility, hard disk and repair.... Does he mean me to hold down the C key on the alpha keyboard or the ctrl key?
    Should I just ask for my money back??? If it is a simple repair do I just literally push the disc in, push the power button and hold down the C button?
    That's where I would begin, too, with
    Repair Disk
    Insert Installer disk and Restart, holding down the "C" key until grey Apple appears.
    Go to Installer menu (Panther and earlier) or Utilities menu (Tiger) and launch Disk Utility.
    Select your HDD (manufacturer ID) in the left panel.
    Select First Aid in the Main panel.
    (Check S.M.A.R.TStatus of HDD at the bottom of right panel, and report if it saysanything but Verified)
    Click Repair Disk on the bottom right.
    If DU reports disk does not need repairs quit DU and restart.
    If DU reports errors Repair again and again until DU reports disk is repaired.
    If DU reports errors it cannot repair you will need touse autility like TechTool Pro,Drive Geniusor DiskWarrior
    First we need to determine if the issue you are experiencing with the computer is software or hardware based. Once we have gotten things sorted out there should be time enough to make you decision about keeping or returning it.
    cornelius

  • I have safari 5.1.7 and it's not working properly. Should I use Safari 5.1.9 or 6.0.4?

    I have safari 5.1.7 and it's not working properly. Should I use Safari 5.1.9 or 6.0.4? Mac OS X 10.6.8.  17" MacBook Pro

    Use your Software Update under the Apple menu, it SHOULD bring Safari up to 5.1.9 on OS X 10.6.8.
    Apple IS issuing security and other updates for Snow Leopard users.
    OS X 10.4/10.5 need to upgrade, 10.6.8 ok still
    Safari 6+ is only for 10.7+ users as OS X is morphing into iOS.
    10.7 and 10.8 will not run your PPC based apps of 10.5/10.6
    If Software Update is not working, then you have other issues, backup your users folders off the machine to a external storage drive (not TimeMachine!) and run through this list of fixes.
    Most commonly used backup methods
    ..Step by Step to fix your Mac

  • Acrobat Pro (V11.0.07) not working as it should

    Acrobat Pro (V11.0.07) not working as it should (various aspects) - receive an error 2503/2502 when attempting to run a repair

    Hi ferdinando,
    Was Acrobat working fine for you before?
    Which OS are you using?
    Try repairing Acrobat from the Control panel> Programs and check.
    Are you getting the error: "Error 2503 called RunScript when not marked in progress"
    This is apparently a Windows issue (see http://answers.microsoft.com/en-us/windows/forum/windows_vista-windows_programs/error-2503 -called-runscript-when-not-marked-in/76e72d98-cbef-432f-8f6f-40417d139bc1
    Regards,
    Rave

  • I have a problem with Adobe Creative Cluod. Basically after installing the application when I open it I do not charge adobe products but remains all white screen. I tried to uninstall it and install it several times but it does not work.  What should I do

    I have a problem with Adobe Creative Cluod. Basically after installing the application when I open it I do not charge adobe products but remains all white screen. I tried to uninstall it and install it several times but it does not work.
    What should I do?

    Hi Anto2211,
    Please follow the thread: Black screen CC where this issue is already discussed and resolved.
    Let me know for any further query.
    Thanks,
    Ratandeep Arora

  • Why is elements 12 not working with OS 10  yosemite  Editing tools aren't working like they used to.????

    Can someone tell my why Elements 12 photo editing tools wont work with OS 10 Yosemite?

    duplicate, see:
    why is elements 12 not working with OS 10  yosemite  Editing tools aren't working like they used to.????

  • My MacBookPro is continuously buzzing, the backlights are not working although it should be on. Tried to cover the sensor, but it's not that. Also, it's telling me that I have no batteries and the charging is not working either.... Any help? PLEASE!!!!

    My MacBookPro is continuously buzzing, the backlights are not working although it should be on. Tried to cover the sensor, but it's not that. Also, it's telling me that I have no batteries and the charging is not working either.... Any help? PLEASE!!!!

    Intel-based Macs: Resetting the System Management Controller (SMC)

  • My purchased download of Photoshop Elements did not work and I have been trying to reach a real person at Adobe.  Has anyone ever been able to do that.  If so can you tell me how to do that.

    My purchased download of Photoshop Elements did not work and I have been trying to reach a real person at Adobe.  Has anyone ever been able to do that.  If so can you tell me how to do that.

    Hi vision4success ,
    I would like to gather some information regarding your issue, So, please answer the questions below:
    What is the exact issue that you are facing?
    Do you get any error while installing Photoshop element?
    What is the Operating System that you are using?
    Since when you are facing this problem. Has it ever worked for you?
    What all steps did you try from your end?
    If you have any other details regarding the issue that might help us, please feel free to mention that as well.
    Waiting for you reply.
    Regards,
    Sarika

  • My iPhone 5 is overheaded while charging and the screen is black and is not working. What should i do?

    My iPhone 5 is overheaded while charging and the screen is black and is not working. What should i do?

    Sounds like a battery failure.  Your phone is under warranty.  Bring it back to Apple

Maybe you are looking for

  • My wireless computer unable to print to hardwired hp officejet pro 8500a plus

    My wireless computer is running window Vista home. 1. I have tried to print from several programs and have resulted in a print error in the printer que. 2. I have gone into the printer properties and verified the correct IP address and driver are ins

  • I need ready code for a simple paint program today

    hi all I need ready code for a simple paint program today for me ics projct plz give me a halp on this give me what you have with you and it is so good if it look like this : Design a GUI based drawing Java application that works like a simple paint

  • How is it possible to add title to each photo in Spry photoalbum?

    I've created an album with spry as it is shown in the tutorial, but I want every large photo to have a title below. Not the file name but title which could tell some facts about the photo. Is it possible to do using that template? Thanks.

  • Why Does Shockwave Flash Keeps Crashing In Firefox?

    I've been using adobe shockwave flash player with no problem for the last six years. Recently I brought a new computer, windows vista and downloaded the adobe reader and shockwave player. Everytime I go to watch a video on the internet flash player w

  • More 10.4.6 printing issues

    I'm setting up 10.4.6 on a new MacBook Pro. Everything works fine (including some older software) except printing. Whenever the Print dialog comes up, if the Presets are set to anything other than "Standard", clicking the "Print" button does absolute