Can't see this topic in the forum

Hi,
I thought I posted this ttopic yesterday - but icant see it in the forum; if it is there I apoligise in advance.
here it is:
Hi,
I got some great help before on this & am hoping for a little direction. I have a class that calculates the tax from an xml like below:
<Taxes>
     <Tax TaxCode='code1' Amount='101.00'/>
     <Tax TaxCode='code2' Amount='102.00'/>
     <Tax TaxCode='code3' Amount='103.00'/>
     <Tax TaxCode='code4' Amount='104.00'/>
     <Tax TaxCode='code5' Amount='105.00'/>
</Taxes>Now, my method below, gets the last 3 values and sums them and applies the code "XT" to it & returns a HashMap that looks like:
{code1 = 101.00, code = 102. 00, XT = 312.00}.
public static HashMap getTaxAmounts(String xml) throws Exception {
          HashMap taxes = new HashMap();
          DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
        domFactory.setNamespaceAware(true); // never forget this!
        DocumentBuilder builder = domFactory.newDocumentBuilder();
        Document doc = builder.parse(xml);
        XPathFactory factory = XPathFactory.newInstance();
        XPath xpath = factory.newXPath();
        XPathExpression expr = xpath.compile("//Tax/@TaxCode");
        Object result = expr.evaluate(doc, XPathConstants.NODESET);
        NodeList nodes = (NodeList) result;
        XPathExpression expr1 = xpath.compile("//Tax/@Amount");
        Object result1 = expr1.evaluate(doc, XPathConstants.NODESET);
        NodeList nodes1 = (NodeList) result1;
        for ( int i = 0; i < nodes1.getLength() && (i<2); i++) {
               taxes.put( nodes.item(i).getNodeValue(), nodes1.item(i).getNodeValue());
                if( nodes1.getLength() >= 3){
                    float total = 0.00f;
                    for ( int i = 2; i < nodes1.getLength(); i++) {
                            total += Float.parseFloat(nodes1.item(i).getNodeValue());
                    String xt = nodes.item(2).getNodeValue();
                    xt = "XT";
                    taxes.put( xt, total);
       return taxes;     
/code]
all that's fine - but now I have to replace the tags in the original XML file so that they look like:<Taxes>
<Tax TaxCode='code1' Amount='101.00'/>
<Tax TaxCode='code2' Amount='102.00'/>
<Tax TaxCode='XT' Amount='312.00'/>
</Taxes>
any ideas how I would this???

what am I doing wrong here? i'm just trying to delete the last 2 Tax nodes? what if I want to replace them with the hashmap values - I can't even get the remove bit working??
public static String buildDom(String xml, HashMap taxes) throws Exception
        String newDocument = xml;
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        try {
          DocumentBuilder builder = factory.newDocumentBuilder();
          Document document = builder.parse(xml);
          HashMap newMap = getTaxAmounts(dd);
          Element elem = document.getDocumentElement();
          NodeList taxList = elem.getElementsByTagName( "Tax" );
          int count1 = taxList.getLength();
          int count2 = newMap.size();       
          for ( int i = count2; i < count1; i++ ) {
              Element Tax = (Element) taxList.item( i );
              System.err.println("Tax == "+Tax);
              document.removeChild( taxList.item(i));
        } catch (ParserConfigurationException pce) {
            // Parser with specified options can't be built
            pce.printStackTrace();
        return newDocument;
    }

Similar Messages

  • In the previous version, the menu table in table options, there is an option that gives me the option: the Return key moves to next cell. I do not see this option in the new number. can you help me please?

    in the previous version  of Number, the menu table in table options, there is an option that gives me the option: the Return key moves to next cell. I do not see this option in the new number. can you help me please?

    Hi silvano,
    If you use a regular pattern when entering values, press enter (return) after entering the last value in a row. That will take you to the first Body Cell of the next row.
    Start in Cell B2
    1 Tab 2 Tab 3 Enter
    4 Tab 5 Tab 6 Enter
    7 Tab 8 Tab 9 Enter
    Now you are ready to type into B5 .
    Another way that some people find easier is to enter one column at a time
    Start at B2
    1 enter
    4 enter
    7 enter
    etc.
    Now start with C2.
    Use whatever suits your work flow.
    Regards,
    Ian.

  • How can I change (or select) what is being being used when I share, as the file cover. When I Share lets say "Master File" i want to select a frame that is used as the file cover. So when its on my desktop I see this image as the file icon.

    How can I change (or select) what is being being used when I share, as the file cover. When I Share lets say "Master File" i want to select a frame that is used as the file cover. So when its on my desktop I see this image as the file icon.

    I don't think Finder does this (I've tried).
    iTunes does though. Where you can set artwork or the "poster frame"...
    This may not be what you want but if it helps, I know 2 ways  do this is
    Open the video in QuicktimePlayer7 | View | Set Poster Frame (even then, you might need to save it as .mov (ie in a 'mov container').
    Drag the file into iTunes and set the artwork (as in http://www.dummies.com/how-to/content/adding-album-cover-art-or-images-in-itunes .html)
    From there, iTunes will use that frame as the "poster frame" ie the photo/frame that shows when you browse your videos. Which is what you want, but limited to iTunes.
    When I do either of these above, the frame I set does not show when exploring files in "Finder" (or in the other Explorer tool I use called "Pathfinder").
    So it maybe, that exactly what you want, is not possible.

  • How can I include a success message in a drag and drop interaction - I don't see this option in the Actions on success options, and cannot figure it out?

    How can I include a success message in a drag and drop interaction - I don't see this option in the Actions on success options, and cannot figure it out?

    I suspected you used the eye icon on the timeline to hide the message, but that one has no impact whatsoever on the published version. It is only meant to be used for editing reasons on the stage, to hide objects temporarily on a crowded stage. It is confusing, certainly in CP8 where for both instances the same eye icon is used. In previous versions the Properties panel had a checkbox for 'Show in Output', which was IMO much clearer than this eye icon. But of course, that is only my personal opinion.

  • HT2534 but i have problem in step 13.  i can't see  step(13) because the red box that has this message "please contact itunes support to complete this transaction" apears. plz help me how can i pass this step

    but i have problem in step 13. i can't see step 13 because the red box which has this message " please contact itunes support to complete this transaction" apears. plz help me how can i pass this step

    You will need to do what it says, contact iTunes support. Click the Support tab above, then the Get Started link in the Contact Apple Support area and you'll be guided.
    Regards.

  • I can't see any pictures that the peoples send me by messages.

    I can't see any pictures that the peoples send me by messages. I've got Iphone 5 and ios 6. I receive the pictures but i can't open them. Loading remains. Some body help me!

    You can toggle Full Screen Mode on and off by tapping the F11 key. You can also move your cursor to the top of your screen, toolbars will slide down, right-click in the blank area at the end of the Tab bar, choose "Exit Full Screen Mode".
    *See --> http://kb.mozillazine.org/Netbooks#Full_screen
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Adobe Shockwave for Director Netscape plug-in: [https://support.mozilla.com/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]

  • How to unsubscribe some topic in the forum

    Hello,everybody.
    I have subscribed the discussion topic of this forum,I am delight that the other users would response for the topic which I have posted to help me.
    But I found that the forum have send many topics to my email box everyday,and most of these topics are not relative with the questions I want to discuss with the other users,I must spend time on deleting the Email items.Therefore,How can I unsubscribe the topic which is not relative with my questions in order to tell the manager not to send those topic item to my Email box.If anybody can tell me how to solve it.
    Thanks you for help.

    Hello,everybody.
    Thanks for your reply,but I thought it is not effective,No matter I have not post topic on the forum,the forum always transmit Email to my Email Box,there have about several thousands Email in my Email box now.
    How can I unsubscribe those Email? Thank for reading.Please reply.
    Message was edited by:
    Devemor

  • Can you see a image in the Get Info Window?

    After upgrading to Mt LIon and while using CS6, I can't see image previews in the Get Info window.  Can't see images in the upper left corner of the get info window, so I can't make a selection and then do a copy- paste like I could do before I upgraded to Mt Lion with CS6.  I want to be able to paste a image of the subjects in my folders..  IE folder of Panda Bears would have a image of a Panda showing on that folder.  Folder of The Great Wall would have a image of the Great Wall on the Folder of Great Wall pictures.  This has always worked for the past many years I have used a Mac and Photoshop.  I started with Photoshop 2.  All my photo folders are represented by images so I have a good idea of what is contained in each folder.  Now after 2 weeks in China, 20 folders are represented by 10-11-12, 10-12-12, 10-13-12, 10-14-12 and so on.  Shows me nothing but dates.  I have tried saving as Jpeg, Tiff, and PAD, and still can't  do a copy-paste in the Get Info window.   Apple says it is a Adobe problem, Yesterday Adobe told me it is because I am uusing a Nikon D800 and Adobe does not have a  patcdh for the NEW Nikon camera.  I then tried using my Nikon D2Xs, Nikon D3X, Nikon 800 and even my wife's D50 and none of these camera allow me to copy paste the thumbnail image to the clipoboard like I have been able to do for YEARS...   I can see images in a folder in Bridge, but the images dont show in my desktop folders.IE, a folder on my desktop with 200 pictures only show with words/ numbers/letters NO IMAGES appear in the folders on the desktop.  On some folders the folders in a folder don't show up as Folders either.
    Can Any one help me.  Same thing happens on my MACPRO w 16 GB Ram and on my 17" MacBook Pro.

    Allan Sicks wrote:
    Thanks for your input.  Problem might be with the EASTER BUNNY..... have to have someone to blame.
    I can't blame you for saying that.
    Adobe is the clear owner of the responsibility to make functional their product that they claim is compatible with your operating system.  Adobe is the one who sold you the product.
    I just went looking for what Adobe has said about Mountain Lion compatibility, and they both list Mountain Lion as compatible and include such language as that on this page (emphasis mine):
    Adobe and Apple have worked closely together to test Adobe® Creative Suite® 5, 5.5 and CS6 editions and individual products for reliability, performance and user experience when installed on Intel® based systems running Mac OS X Mountain Lion (v10.8). Earlier versions of Adobe Photoshop® (CS3 and CS4) software were also tested with Mountain Lion and there are currently no known issues.
    I suggest that Adobe needs to get on the ball and get this fixed.  The time for user patience is over.
    If someone from Adobe is saying "Adobe can't fix it" then that someone is at the wrong authority level and/or is thinking on the wrong level.
    This is business and the business is making products that have value and are sold to people who perceive that value.  Adobe doesn't get to keep selling products that don't work while standing on principles that "it's someone else's problem".   Customers don't care why it doesn't work. 
    It's obvious to a child that if Photoshop CS5 can write the proper things to the Apple OS so that the thumbnails are visible, that there's something Adobe could do to fix it.
    But EVEN IF this were something only Apple could fix, that Apple hasn't fixed it yet says pretty loudly that Adobe isn't making the right overtures to Apple for their mutual benefit.  Adobe, are your executives so greedy that they can't grease a few palms of their friends over at Apple to put some priority on this?  What's the problem here?  Has Adobe actually forgotten how to do business?
    -Noel
    P.S., You should know that I don't use a Mac and am personally having no issues with seeing proper thumbnails and previews on my Windows 7 and 8 systems, since the software that does that isn't from Adobe.

  • I've just signed up to iTunes Match as I have songs on my iPhone 4 which wont sync with iTunes as they are from CDs but I can't see my music in the cloud now. Anyone had the same problem and have an easy fix?

    I've just signed up to iTunes Match as I have songs on my iPhone 4 which wont sync with iTunes as they are from CDs but I can't see my music in the cloud now. Anyone had the same problem and have an easy fix?

    What fixed it for me:
    On your computer, open iTunes > My iPhone (or whatever name you gave your iPhone) > "Music" page
    Uncheck "Sync Music"
    Click "Sync" button (bottom right)
    Let it run and finish
    Uncheck the box for every song, playlist, etc.
    Click "Sync" button (bottom right) (This step may be unnecessary, but I did it and got the result I wanted.)
    Let it run and finish
    Check the boxes for the music you want on your iPhone
    Click "Sync" button (bottom right)
    Let it run and finish
    See if that doesn't work for you.  I tried a lot of things that did nothing, but this seems to have fixed it, and quickly.

  • HT1386 When I connect my iPod Touch to a new laptop (Macbook Air) the "Info" tab won't appear and therefore I cannot sync it with my new iTunes. How can I sync this iPod with the iTunes on my new laptop?

    When I connect my iPod Touch to a new laptop (Macbook Air) the "Info" tab won't appear and therefore I cannot sync it with my new iTunes. How can I sync this iPod with the iTunes on my new laptop?

    There is no Info tab in Mavericks
    if you use OS X v.10.8.5 or earlier. If you use OS X Mavericks v.10.9 or later, your contacts, calendars, and other info are updated on your computers and iOS devices via iCloud. For more information, see iCloud Help at icloud.com.
    iTunes 11 for Mac: Sync contacts, calendars, and other info with iPod, iPhone, or iPad

  • When downloading is complete, I can not see, run, nor access the file; it only appears in the "Downloads" window (and not the specified folder) and the only options permitted are to delete it, or to go to the download web site; what's blocking it?

    My PC's OS is 'MS Windows Vista Home Premium'. As my initil question states: When downloading, after the download completes, I can not see, run, nor access the file in it's designated folder. The download only appears in the "Downloads" window and the only "Right Click" options permitted are to "Remove From List", "Select All", & "Copy Download Link" I also can not double click to run it. What's blocking it?
    I have a similar problem when accessing .zip files that are attachments to my emails. Here, however, I can place the file in a designated folder, however, the .zip file and it's compressed content files are file-typed as "FireFox Document" and I get permissions errors when running an unzip tool.
    Why are my download files being quarantined ??? Is there a security setting option I need to change???
    To get around this, I'm using IE to download and install these files, but switching back & forth between FireFox & IE is a real pain.

    It's your anti-virus not working correctly while scanning. You can turn off the option to scan in Firefox's '''about:config''' by filtering for '''browser.download.manager.scanWhenDone''' and double-clicking that line to change the value to '''false'''

  • In Windows 8, how can I see an image of the psd file instead of the Photoshop icon?

    In Windows 8, how can I see an image of the psd file instead of the Photoshop icon?

    There are a number of third party solutions for this.  I just use Bridge, so can't recommend one in particular.

  • I ordered Illustrator for another user.  I received an invitation that was accepted, logged in and tried to change the account to the name and email of the person it was ordered for.  How can I get this changed and the invitation sent to the right person?

    I ordered Illustrator via creative cloud for another user.  I received an invitation that was accepted  and tried to change the account to the name and email of the person it was ordered for.  How can I get this changed and the invitation sent to the right person? 

    Cloud as a Gift https://forums.adobe.com/thread/1665610

  • I have CD version of Adobe Photoshop Element 9. I have CD version of Adobe Photoshop Element 9. I have purchased the new Macbook which does not have DVD drive. Can I download this software over the web and install using the Serial Number I have. Thanks,

    I have CD version of Adobe Photoshop Element 9. I have CD version of Adobe Photoshop Element 9. I have purchased the new Macbook which does not have DVD drive. Can I download this software over the web and install using the Serial Number I have. Thanks,@

    yes,
    Downloads available:
    Suites and Programs:  CC | CS6 | CS5.5 | CS5 | CS4 | CS3
    Acrobat:  XI, X | 9,8 | 9 standard
    Premiere Elements:  12 | 11, 10 | 9, 8, 7
    Photoshop Elements:  12 | 11, 10 | 9,8,7
    Lightroom:  5 | 4 | 3
    Captivate:  8 | 7 | 6 | 5
    Contribute:  CS5 | CS4, CS3
    Download and installation help for Adobe links
    Download and installation help for Prodesigntools links are listed on most linked pages.  They are critical; especially steps 1, 2 and 3.  If you click a link that does not have those steps listed, open a second window using the Lightroom 3 link to see those 'Important Instructions'.

  • II  downloaded the OS X version 10.9 and my iPhoto version 9.2.3 will n.ot open.  I get a message that I can't use this version of the application I photo with this version of OSX.  What do I do now and how do I get the photos out of the old version?

    I downloaded the OS X version 10.9 and my Iphoto version 9.2.3 will not open.  I get a message that I can't use this version of the application I photo with this version of OS X.  How do I upgrade to a i photo that will run on 10.9.  Do I purchase a new program or can I do just an download?

    Check the "Purchases" page in the Mac App Store and see if there is a more recent version there already waiting for you.

Maybe you are looking for