Looping through elements and assigning the proper attributes

So I'm trying to loop through all my xml elements. I then
want to loop through an element and an elements child and all
attributes assigned inside. Does this make sense, I hope so? This
is for an on going Cascading menu I have been building. So
basically every element inside an element would be a submenu of a
menu. Here is what I have....

Okay. Much better subject line this time. :)
You apparently know what a factorial is. You need to multiply the input by all numbers less than it (except for special case of 0! [but, then, you tell them to enter a number between 1 and 12]).
You don't want your loop to be "while (true)". You can either start at 1 and work your way up to the input number, or start at the input number and work your way down. You may want a 'for' loop instead of a 'while' loop.
In this (and most cases), think about how you would calculate factorials manually. Write it down in English. Then, translate it to code.
You've been working on factorials for a while now. You haven't found the algorithm yet?

Similar Messages

  • Loop through xml and update the value

    I have the following xml table. I need to update the Field which name="data"
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Root name="xyz">
    <Row id="1">
    <Field name="data">456</Field>
    <Field name="time">2005-02-08 10:43:51</Field>
    </Row>
    <Row id="2">
    <Field name="data">123</Field>
    <Field name="time">2005-02-08 10:43:16</Field>
    </Row>
    </Root>
    After update, the table should look like this
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Root name="xyz">
    <Row id="1">
    <Field name="data">abc</Field>
    <Field name="time">2005-02-08 10:43:51</Field>
    </Row>
    <Row id="2">
    <Field name="data">edf</Field>
    <Field name="time">2005-02-08 10:43:16</Field>
    </Row>
    </Root>
    How do I update the value through java program? I do not want to load the data to database to update the value. The constrain is that i must have the value updated in java application before I loaded it to the database.
    Please any advise?
    Thank you!

    Use a DOM parser to parse the xml document...you will get a Document object, which you can use XPath or traverse the DOM tree and perform the updating.

  • Analysing  Dimensions and assigning the char

    Hello Experts,
    I have the following requirement
    Selection:Companycode,Chart of Acconts,Fiscalyear,period
    O/P: G/L account,costcenter,amount in local currency,WBS element.
    I am using standard data source 0fi_gl_4 and stadard ODS 0figl_O02 and this does'nt have Standard cube (please tell me  if it has standard cube) as i could'nt find any.
    Could any one tell me what  dimensions i need to take  and which characteristics should be assigned under specific Dim  for the above requirement. As i don't have knowledge on FIGL i am unable to analyse the things.
    i have loaded the data till ODS and now gng for creating Z cube .please do the needful in analysing the dim and assigning the char,
    Points are assured..
    Regards
    Raju

    Suri,
    Please take a look at these (in business content) as step up example, most of your chars should be included.
    G/L (New): Balance Sheet and Profit and Loss  0FIGL_V10
    G/L (New): Balance Sheet and Profit and Loss Remote  0FIGL_V11
    General Ledger (New): Transaction Figures  0FIGL_C10
    General Ledger (New): Transaction Figures Remote  0FIGL_R10
    General Ledger: Financial Statements  0FIGL_VC1
    General Ledger: Transaction Figures  0FIGL_C01
    Regards, Patrick Rieken.

  • Looping through folders and subfolders

    Hi,
    I'm about to create a script to check some tifs and jpgs for the right height and width, resolution and so on.
    I could get it to work if I see the files in the content panel (looping through the files by app.document.getSelection ...
    The script needs to check many files in different subfolders (all in one parent folder), so I don't like to use a collection to reveal all files of all subfolders first and then start the script.
    My plan is to choose the parent folder in the folder panel and the script should  loop through each file of each subfolder ...
    So maybe there's someone who knows a solution for this problem, it would be great!
    Thanks a lot,
    Sebastian.

    Wow,
    That was fast, I'll test it tommorow in the morning, thanks a lot so far!
    Hopefully I'll be able to get our scripts together...
    Thanks
    Sebastian
    Am 05.08.2012 um 20:13 schrieb Paul Riggott <[email protected]>:
    Re: looping through folders and subfolders
    created by Paul Riggott in Bridge Scripting - View the full discussion
    This should get you started...
    #target bridge  
    var folders =[];
    folders = FindAllFolders(Folder(app.document.presentationPath), folders);
    folders.unshift(Folder(app.document.presentationPath));
    for(var a in folders){
    var fileList = folders[a].getFiles(/\.(jpg|tif)$/i);
    for(var p in fileList){
    var thumb = new Thumbnail(fileList[p]);
    var height = thumb.core.quickMetadata.height;
    var width = thumb.core.quickMetadata.width;
    var Resolution = thumb.core.quickMetadata.xResolution;
    if(Resolution ==0) Resolution =72;
    //do your processing here
    //$.writeln(decodeURI(thumb.spec) + "," + height + "," + width + "," + Resolution);
    function FindAllFolders( srcFolderStr, destArray) {
    var fileFolderArray = Folder( srcFolderStr ).getFiles();
    for ( var i = 0; i < fileFolderArray.length; i++ ) {
      var fileFoldObj = fileFolderArray[i];
      if ( fileFoldObj instanceof File ) {  
      } else {
             destArray.push( Folder(fileFoldObj) );
      FindAllFolders( fileFoldObj.toString(), destArray );
    return destArray;
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4599891#4599891
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4599891#4599891. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Bridge Scripting by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • I ordered the IX500 Scan Snap through Amazon and received the incorrect XI Standard disc in Windows format instead of for my Mac.  I contacted Amazon and they suggested I contact Scan Snap who suggests I contact Adobe for the correct disc.  Please help.

    I ordered the IX500 Scan Snap through Amazon and received the incorrect Adobe Acrobat XI Standard disc in Windows format instead of for my Mac.  I contacted Amazon and they suggested I contact Scan Snap who suggests I contact Adobe for the correct disc.  Please help.

    Fujitsu delivers only Adobe Acrobat for Windows, not Mac.
    http://www.fujitsu.com/global/services/computing/peripheral/scanners/product/ix500/

  • I own both Photoshop Elements and Photoshop (the original editor).  I find the elements editor to be too cumbersome to use and would just like to edit using Photoshop.  When I try to install Photoshop as a secondary editor in elements I get an error messa

    I own both Photoshop Elements and Photoshop (the original editor).  I find the elements editor to be too cumbersome to use and would just like to edit using Photoshop.  When I try to install Photoshop as a secondary editor in elements I get an error message that I don't need to this because it is already supported on the edit menu and task bar.  I can not find any way to send images to Photoshop for editing - all I can do is send them to elements editor or the premier editor.  Can someone tell me how to send them to Photoshop?  Thanks!

    Hi,
    The D810 requires Camera Raw 8.6 or later - the latest version that is compatible with Photoshop Elements 12 is Camera Raw 8.5 as far as I can see.
    You need to either buy a new version of Photoshop Elements or use the free Adobe DNG converter.
    DNG  Converter 8.8
    Win – http://www.adobe.com/support/downloads/detail.jsp?ftpID=5888
    Mac – http://www.adobe.com/support/downloads/detail.jsp?ftpID=5887
    Useful Tutorial
    http://www.youtube.com/watch?v=0bqGovpuihw
    Brian

  • How do I copy and paste to my mac and undo the change attributes like I do withmy iPad. I cannot shake my mac?

    How do I copy and paste to my mac and undo the change attributes. On my ipad I can shake it and undo the change attributes but not sure how to do this on the imac? Example Excel to email and undo changes?

    Thanks for the information....It did not work,....
    I am copying information from Excel and posting it into Lotus
    It works fine in word and other application, just not in Lotus notes...
    Any other ideas?

  • How can I install a recent version of Photoshop Elements and keep the albums set up in the older ver

    How can I install a recent version of Photoshop Elements and keep the albums set up in the older version?

    http://tv.adobe.com/watch/learn-photoshop-elements-11/converting-a-catalog-from-previous-v ersions/

  • Read and assign the highest value

    Hi experts
           I want to read the highest value of the records in a condition basis for example matnr wise then assign that value to some records.
         how to read and assign the value, pls help me out.
    Thanks in advance.
    regards
    Rajaram

    hi
    sort itab by <fildname> descending.
    read table itab  into wa index 1.
    assign wa-fildname to the required records or variables
    regards
    vijay
    reward points if helpful

  • I purchased Photoshop elements and downloaded the 32 bit version, but I received an error saying I need to download the 64 bit version.  How do I do that?

    I purchased Photoshop elements and downloaded the 32 bit version, but I received an error saying I need to download the 64 bit version.  How do I do that?

    You can get it from here:
    Download Photoshop Elements products | 13, 12, 11, 10

  • How to execute a string formula and assign the result to a number field

    How to execute a string formula and assign the result to a number field
    Hi,
    we have a function that returns a string like this:
    '(45+22)*78/23'
    After we should calculate this string and assign the value to a numeric block field
    Example:
    k number(16,3);
    k:=fun1('(45+22)*78/23'); where fun1 execute and translate to number the string.
    Does exist a function like fun1 ??
    How can we do ?
    Regards

    Hello,
    this is the code that does the job:
    SQL> set serveroutput on
    SQL> DECLARE
    2 ch VARCHAR2(20) :='22+10' ;
    3 i NUMBER ;
    4 BEGIN
    5 EXECUTE IMMEDIATE 'select ' || ch || ' from dual' INTO i;
    6 dbms_output.put_line ('i = ' || TO_CHAR(i));
    7 END ;
    8 /
    i = 32
    Procédure PL/SQL terminée avec succès.
    SQL>
    just you have to do is to create a small stored function that take the string to calculate and return the number result
    Francois

  • Transform implementation goes wrong when I try transforming a image through script and save the new image using a HTML to canvas plugin.

    Transform implementation goes wrong when I try transforming a image through script and save the new image using a HTML to canvas plugin. The rotation comes up fine, but the origin of the transformation is faulty (compared to other browsers like Chrome & IE)

    A good place to ask advice about web development is at the mozillaZine "Web Development/Standards Evangelism" forum.
    *http://forums.mozillazine.org/viewforum.php?f=25
    The helpers at that forum are more knowledgeable about web development issues.
    You need to register at the mozillaZine forum site in order to post at that forum.

  • HT201210 I tried to update my ipad through wifi and followed the steps. It says that update is complete however i must connect to itunes and restore the updates but itines says i dont have permission to do so. KIndly assist on the stages to follow. Screen

    I tried to update my ipad through wifi and followed the steps. It says that update is complete however i must connect to itunes and restore the updates but itines says i dont have permission to do so. KIndly assist on the stages to follow. Screen is black ad i unable to work on it.
    Kindly give some suggestions
    Regards
    Banzi

    Hello Mayanii,
    This display and behavior indicates that the iPad is in recovery mode and must be restored.
    If you can't update or restore your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/HT1808
    Cheers,
    Allen

  • Mail doesn't attach files through dragging and dropping the files!

    Help please,
    Mail doesn't attach files through dragging and dropping the files on OS X ML, it crashes for a while !!

    Open Disk Utility and Repair disk permissions on the First Aid tab.
    Then, Restart and boot into Recovery Mode by holding down cmd-r on restart until you see a gray screen. When the Mac boots, you will be presented with some options. Choose Disk Utility and select your Hard drive volume (Macintosh HD is the default name). Then, on the First Aid tab, click Repair Disk (not permissions).
    If that doesn't help, you could try installing the 10.8.2 combo updater from the Apple Downloads site:
    http://support.apple.com/kb/DL1581

  • I set up my iPhone through iCloud but assigned the wrong cell number to it so I am getting messages that don't belong to me but rather to my husband as I entered his cell number in there - how do I change that number to stop this from happening??

    I set up my iPhone through iCloud but assigned the wrong cell number to it so I am getting messages that don't belong to me but rather to my husband as I entered his cell number in there - how do I change that number to stop this from happening??

    Also, if you are sharing an Apple ID, you will get his iMessages.

Maybe you are looking for

  • Sales order schedule confirmed date will consider Production capacity load

    As we know about schedule confirm delivery dates of sales order will consider based on material master lead time ,shiping point etc How to consider production capacity plan on sales order's delivery date. Say for example : Production workcenter capac

  • Can I use my time capsule to back up or save files from my pc?

    My time capsule works great with my 2 Macs.   I just got a PC and would like to know if I can use the time capsule to back up or save files from my PC?

  • Forte deployment destroys ias.  Help!

    I am running ias 6.0 sp1 on aix unix. I am using my pc with forte installed to deploy. I find if my app does not have web module then it's OK but if it does, then the deployment will fail saying something like "where is the GDS context param?" and so

  • Form develper 9i. (form are not displaying on the browser after compiling)

    I run oracle 9i version 2, and internet developer suit on my system. Idesigning my forms and the codes to run behind them with the form developer. If I click the "run form" button during testing, the form will compile successfully, but will never dis

  • How to add data in IT 184 through portal.

    Hi Experts, I want to add data in IT 184 . I am adding the project description of an employee in this IT type. I will provide the link on portal to add the data in this infotype by it is not possible for me to update the data. Please guide me. Thanks