How to get only the latest record in a folder

Hi all,
We have an OA SIT that is not a "standard" SIT in that it does not have the traditional Begin and End date. It only has an Effective date. Is there some way I can filter this table to only give me the latest record in the series? I know how to do this in SQL, but don't see how it would be possible in the EUL.
We're trying to avoid creating database views, but at this point, I'm thinking it may be the easiest way to address this. Any other suggestions?
Thanks in advance,
Jewell

Jewell.
Of course I'm not going to mention that I have no idea what a 'standard' SIT is compared to your basic 'non-standard' SIT ... and I have to watch my spelling of such ... but however ...
As you're most likely aware, in SQL you would get all the 'standard' SIT records first by going through the table. Then you'd go back through them all and find the most recent one.
Because of this 2 table pass, I agree that just putting the SQL code in a custom folder (as you're not using views) would make the most sense.
Russ

Similar Messages

  • How to find out the latest Record in per_all_people_f and per_all_assignme

    Hi ,
    How to find out the latest Record in per_all_people_f and per_all_assignments_f
    Requirement : Need to find out the latest record in per_all_people_f and per_all_assignments_f to update the attribute column with pre defined value . Its not possible to track only with person_id / assignment_id and effective end date
    SELECT pp_id
    FROM (SELECT app.person_id pp_id,
    asf.*
    FROM apps.per_all_people_f app,
    apps.per_all_assignments_f asf
    WHERE --app.person_id=123568 and
    asf.person_id = app.person_id AND
    app.effective_end_date = to_date('31-dec-4712') AND
    asf.effective_end_date = to_date('31-dec-4712')
    GROUP BY app.person_id)
    HAVING COUNT(pp_id) > 1
    GROUP BY pp_id
    This query also returns more than 1 value for person_id .
    It would be great if you put comment on this .. Thanks in advance ,
    Arya

    I am getting more records with asf.primary_flag='Y' . If you give ur mail id , i will send the sample data
    ASSIGNMENT_ID     EFFECTIVE_START_DATE     EFFECTIVE_END_DATE     BUSINESS_GROUP_ID     RECRUITER_ID     GRADE_ID     POSITION_ID     JOB_ID     ASSIGNMENT_STATUS_TYPE_ID     PAYROLL_ID     LOCATION_ID     PERSON_REFERRED_BY_ID     SUPERVISOR_ID     SPECIAL_CEILING_STEP_ID     PERSON_ID     RECRUITMENT_ACTIVITY_ID     SOURCE_ORGANIZATION_ID     ORGANIZATION_ID     PEOPLE_GROUP_ID     SOFT_CODING_KEYFLEX_ID     VACANCY_ID     PAY_BASIS_ID     ASSIGNMENT_SEQUENCE     ASSIGNMENT_TYPE     PRIMARY_FLAG     APPLICATION_ID     ASSIGNMENT_NUMBER     CHANGE_REASON     COMMENT_ID     DATE_PROBATION_END     DEFAULT_CODE_COMB_ID     EMPLOYMENT_CATEGORY     FREQUENCY     INTERNAL_ADDRESS_LINE     MANAGER_FLAG     NORMAL_HOURS     PERF_REVIEW_PERIOD     PERF_REVIEW_PERIOD_FREQUENCY     PERIOD_OF_SERVICE_ID     PROBATION_PERIOD     PROBATION_UNIT     SAL_REVIEW_PERIOD     SAL_REVIEW_PERIOD_FREQUENCY     SET_OF_BOOKS_ID     SOURCE_TYPE     TIME_NORMAL_FINISH     TIME_NORMAL_START     BARGAINING_UNIT_CODE     LABOUR_UNION_MEMBER_FLAG     HOURLY_SALARIED_CODE     REQUEST_ID     PROGRAM_APPLICATION_ID     PROGRAM_ID     PROGRAM_UPDATE_DATE     ASS_ATTRIBUTE_CATEGORY     ASS_ATTRIBUTE1     ASS_ATTRIBUTE2     ASS_ATTRIBUTE3     ASS_ATTRIBUTE4     ASS_ATTRIBUTE5     ASS_ATTRIBUTE6     ASS_ATTRIBUTE7     ASS_ATTRIBUTE8     ASS_ATTRIBUTE9     ASS_ATTRIBUTE10     ASS_ATTRIBUTE11     ASS_ATTRIBUTE12     ASS_ATTRIBUTE13     ASS_ATTRIBUTE14     ASS_ATTRIBUTE15     ASS_ATTRIBUTE16     ASS_ATTRIBUTE17     ASS_ATTRIBUTE18     ASS_ATTRIBUTE19     ASS_ATTRIBUTE20     ASS_ATTRIBUTE21     ASS_ATTRIBUTE22     ASS_ATTRIBUTE23     ASS_ATTRIBUTE24     ASS_ATTRIBUTE25     ASS_ATTRIBUTE26     ASS_ATTRIBUTE27     ASS_ATTRIBUTE28     ASS_ATTRIBUTE29     ASS_ATTRIBUTE30     LAST_UPDATE_DATE     LAST_UPDATED_BY     LAST_UPDATE_LOGIN     CREATED_BY     CREATION_DATE     TITLE     OBJECT_VERSION_NUMBER
    931510     7-Nov-08     31-Dec-12     122     (null)     (null)     (null)     3978     1     (null)     14402     (null)     220150     (null)     734956     (null)     (null)     476     (null)     (null)     (null)     (null)     2     E     Y     (null)     100035417-2     (null)     (null)     (null)     45948739     (null)     (null)     (null)     (null)     (null)     (null)     (null)     868007     (null)     (null)     (null)     (null)     449     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)                                        
    797386     26-Aug-08     26-Aug-08     122     (null)     (null)     (null)     3980     3     (null)     14402     (null)     218925     (null)     734956     (null)     (null)     476     (null)     (null)     (null)     (null)     1     E     Y     (null)     100035417     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     740071     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)                                        
    916076     26-Aug-08     31-Dec-12     122     (null)     (null)     (null)     3980     1     4     14402     (null)     218925     (null)     734956     (null)     (null)     476     (null)     (null)     (null)     (null)     1     B     Y     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)                                        
    797386     25-Feb-08     25-Aug-08     122     (null)     (null)     (null)     3980     1     (null)     14402     (null)     218925     (null)     734956     (null)     (null)     476     (null)     (null)     (null)     (null)     1     E     Y     (null)     100035417     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     740071     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)     (null)

  • How to get only the first result in extract function

    do you know how to get only the first element of the function extract.
    v_result := p_response.doc.extract('//'||p_name||'/child::text()').getstringval();
    if i have 5 responses like '100','100',100','200','200' e get '100100100200200' and i want only '100'.
    thanks in advance

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

  • How to get only the first level of nodes for a subform?

    How can we get only the first level of nodes of a subform?
    For ex:
    Form1
         SubForm1
              Text1
              Text2
              RadioButton1
         SubForm2
              Text1
              Text2
              RadioButton1
         SubForm3
              Text1
              Text2
                   SubForm31
                        RadioButton1
    In this heirarchy if we give Form1.nodes will refer to all nodes under the Form1 (SubForm1,Test1,Text2,RadioButton1,SubForm2,...SubForm31, RadioButton1 etc..)
    But is there any way that we can access only the first level of nodes of Form1 ie can we get only (SubForm1,SubForm2,SubForm3) for Form1 in any Way..?
    Thanks.

    Two ways .....
    1. Use Javascript E4X instead ...there are nice functions for getting children of parents.
    2. Cycle through all of the form1.nodes and look for objects that have a className of "subform". For loops are useful for this task.
    Make sense?
    Paul

  • How to get only the selected layer data?

    Hi All,
              I'm using dissolve sample plugin. I added two layers in photoshop both of different dimensions, say 1000 * 1000 & 2000 * 2000. Now I select the layer with 1000 * 1000 dimension and click on Dissolve plugin. The preview image what is shown in dissolve plugin dialog is not just the selected layer, but also some extra pixels around the selected layer.
    Do I need to set any flag for getting only selected layer data to display in preview?
    Also I need to get only the selected area in a particular layer. When I checked FilterRecordPtr, haveMask flag is TRUE if the part of the layer is selected. But how do I get only the part of the layer that is selected for displaying preview image?
    Please let me know if the description is not clear.
    Thanks,
    Dheeraj

    Thanks Tom Ruark for the response.
    That is exactly the same thing what I'm seeing.
    1.Is there a direct way to know the bounds of the layer without the transparency grid so that I can show only the layer?
    2. If I select an area of 50*50 within a layer(1000*1000) using Rectangular Marquee tool, then I want only that selected area to be shown in preview. For this there is a haveMask flag which indicates whether or not there is selection, but the selected bounds are not available. I'm currently calculating the bounds. I just wanted to know if Photoshop SDK has any field for getting the bounds?

  • How to get only the graphics path without graphics names?

    Hi All,
    I need to get only the graphics path without graphics names like 'd:\Images\' instead of 'd:\Images\abc.jpg' in JS.
    Thanks,
    Praveen

    Something like this should get you close…
    #target indesign
    function main() {
         if (app.documents.length == 0) {
              alert('Please have an "Indesign" document before running this script.');
         return;
         docRef = app.activeDocument;
         with(docRef) {
              var x = rectangles[0].allGraphics[0].itemLink.filePath;
              var y = new File(x).parent.fsName;
              $.writeln(y);
    main();

  • How to get only the date without the time in the footer of a printout?

    Is there a way to get only the date without the time in the footer of a printout?

    As far as I can tell, there's no built-in option to get the date printed without the time. It's hardcoded in a C++ file.
    As a workaround, you can enter custom text for the footer, but it would need to be updated every time the date changed. I can think of a couple ways to automate that:
    * An add-on (but I'm not aware of any add-on for this)
    * External process to push a new date into prefs.js, a settings file that stores your header/footer preferences, among others (but Firefox should be closed when you update this file, and it will be read when you restart)
    Not easy enough, I know.

  • How to get only the whole number omitting the decimals

    Hi Experts,
    I want to get only the whole number of a output field. For example  i am getting an output as 8.766 , i need only the value 8 .
    I checked by moving the values to integer field but i am getting the rounding value 9 .
    I want only the whole value 8.
    Please help me out..
    thanks & Regards.
    Reena..

    Hi Reena,
    Unfortunately when you assign a packed number to a character, numeric or even a packed no without a decimal value SAP does a internal conversion of rounding these value. So direct assignment would won't work for your case.
    You can use the following logic instead for getting the whole number.
    DATA : LV_VAR1 TYPE STRING,
                LV_VAR2 type p DECIMALS 3 value '8.766'.
    LV_VAR1 = lV_VAR2.   " LV_VAR1 would contain 8.766 without rounding.
    write  : LV_VAR1(1).   " LV_VAR1(1) contains 8 which you can assign to any target variable.
    I think there is no addition so as to avoid this internal rounding.
    Try and let me know if it works for you..
    Cheers
    Ajay

  • How to get only the record which is different by outer join

    Hi,
    how to get the values Existing in table A which are not existing in table B by using left outer join, In this example only the record '3' should display. thanks
    the requirementment is like
    Table A.Number Table B.Number
    1 1
    2 2
    3 4
    4 5
    output
    3

    SQL>  with a as (
    select 1 a from dual union all
    select 2 a from dual union all
    select 3 a from dual union all
    select 4 a from dual
    b as (
    select 1 a from dual union all
    select 2 a from dual union all
    select 4 a from dual union all
    select 5 a from dual
    select a.*
      from a left outer join b on (a.a = b.a)
    where b.a is null
             A
             3

  • Getting only the newest records in a Grandchild table

    Hi
    I have created a new table in the Siebel schema on an Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
    This table is called CX_ASSET_XM and is a Grandchild table of S_ASSET
    CX_ASSET_XM has a parent table S_ASSET_X
    So the structure is like so
    S_ASSET  x 1 record
    S_ASSET_X x 2 child records
    CX_ASSET_XM x 1 grand child records
    Therefore the cardinality is one Grandparent can have 2 Grandchild records
    This CX_ASSET_XM table will hold information about TCP/IP calls of a Grandchild asset. These calls are not synchronized. therefore one Grandchild asset may make a call today but the other one has not made a call since yesterday.
    In my query I find all the grand children records that have been created today (sysdate) and then traverse up the relationship to find the Grandparent, then I traverse back down to find the other twin in the Grandchildren tuple.
    The problem with my query is that it returns every single TCP/IP call a pair has made but I only want the most recent callback of each grandchild to analyse
    SELECT (cb.SSID), cb.created_by, cb.callback_date, cb.callback_num, asset.desc_text, asset.prom_integ_id, asset.integration_id
    --Traversing Up to find the Grandparent record of the
    FROM SIEBEL.CX_ASSET_XM cb
        JOIN SIEBEL.S_ASSET_X assetx
          ON cb.SSID = assetx.attrib_37
        JOIN SIEBEL.S_ASSET asset
          ON assetx.par_row_id = asset.row_id
    WHERE asset.prom_integ_id IN
    --Traversing Down to find the other twin in the pair
    (   SELECT asset.prom_integ_id
        FROM SIEBEL.CX_ASSET_XM cb
        JOIN SIEBEL.S_ASSET_X assetx
          ON cb.ssid = assetx.attrib_37
        JOIN SIEBEL.S_ASSET asset
          ON assetx.par_row_id = asset.row_id
    ORDER BY cb.callback_date DESC;
    e.g. if there are 80 grandchildren which have made two TCP/IP calls that would make a total of 160 records, which is what the query above returns.
    However I want 80 records to be returned
    e
    Grandchildren
    Callback Date
    1111AAAA (Pair 1)
    10-OCT-13
    1111AAAB (Pair 1)
    09-OCT-13
    2222AAAA (Pair 2)
    10-OCT-13
    2222AAAB (Pair 2)
    07-OCT-13
    As you can see from the table, atleast one of the pair will have a Callback_Date = Sysdate (Today) which is how I will need to find them in the table before traversing up.
    How do I achieve these results. I have tried GROUP BY, DISTINCT, ROWNUM = 1

    Hi,
    968432 wrote:
    Sorry for my ignorance but how do I incorporate the ROW_NUM function into my query, or will it be a new query from scratch.
    When you say partition, does that mean the partition would be between my traversal up the tables to the grand parent and then back down again?
    You can use ROW_NUMBER with something very much like your existing query; there's no need to start from scratch; you just won't repeat the joins in the WHERE clause.  You'll just be joining the tables once.  If it really helps you to think of traversing either up or down, then go ahead, but you mind find it simpler just to think of joining.  Every row of the join will include some expression(s) that uniquely identifies the grandparent; that's what you'll PARTITION BY.
    It would be a lot easier to explain and to understand if we had some sample data and desired results.  Either post CREATE TABLE and INSERT statements for a little sample data, or phrase the question in terms of tables that anybody with Oracle probably has, such as those in the hr schema.  (People in hr.employees are related to deparatments in hr_departments, and departments are related to places in hr.locations, so location is the grandparent of employee.  If you knew how to find the most recently hired employee from each location in the hr schema, then you'd know how to solve your problem in your schema.  For example, if you wanted these results:
    CITY                 DEPARTMENT_ID EMPLOYEE_ID LAST_NAME  HIRE_DATE
    London                          40         203 Mavris     07-Jun-2002
    Munich                          70         204 Baer       07-Jun-2002
    Oxford                          80         167 Banda      21-Apr-2008
    Seattle                        100         113 Popp       07-Dec-2007
    South San Francisco             50         128 Markle     08-Mar-2008
    Southlake                       60         104 Ernst      21-May-2007
    Toronto                         20         202 Fay        17-Aug-2005
    you could get them like this:
    WITH  got_r_num  AS
        SELECT  l.city
        ,       d.department_id
        ,       e.employee_id, e.last_name, e.hire_date
        ,       ROW_NUMBER () OVER ( PARTITION BY  l.city
                                     ORDER BY      e.hire_date  DESC
                                   )   AS r_num
        FROM    hr.employees    e
        JOIN    hr.departments  d  ON   d.department_id  = e.department_id
        JOIN    hr.locations    l  ON   l.location_id    = d.location_id
    SELECT  city
    ,       department_id
    ,       employee_id, last_name, hire_date
    FROM    got_r_num
    WHERE   r_num = 1

  • How to edit only the selected record in Oracle forms 6i

    Hi,
    I have a form which has three control blocks.
    First block is for search criteria, The results in the second block are displayed based on the values entered in the first block. Second block is a multi record block.
    Below is my requirement:
    I want to edit the record in the second block, based on the cursor position.
    For EX: If the cursor is placed on the first record, all the fields in the first record should be in the editable mode.
                  If I move the cursor down, the next record should be editable and the previous record should again go back to non editable mode.
    I have tried using :system.cursor_record, but it's applying the editable property to all fields, irrespective of the cursor position.
    Any suggestions would be of great help.
    Thanks
    Deepthi

    Deepthi,
    Why would you need to do this...it seems unnecessary to me because your user can only edit the record they are physically at.  So, if your user is in record 3 he/she can't edit record 5.
    Now, to the specific issue you are having - if you are using the SET_ITEM_PROPERTY() built-in to make a record "Editable" then what you are seeing is expected results.  The SET_ITEM_PROPERTY() built-in affects ALL instances of a specific item.  If you need to set item instance specific properties then you need to use the SET_ITEM_INSTANCE_PROPERTY() built-in.  However, this built-in does not have the same set of properties that it can set.  Take a look at the Forms Help to compare these built-ins.
    If you must make each record editiable as your user navigates through them here is how I would attempt this.  I must reiterate however, I really don't think this is necessary...but I don't know your requirements .
    1.  Create a Forms parameter to caputure the CURRENT and PREVIOUS Record number.
    I prefer a parameter object over a Global because you can't choose the data type of a Global so you have to cast the value to accurately perform any numeric calculations on a Global.
    2.  Create/update When-New-Record-Instance trigger...
    /* Sample When-New-Record-Instance... */
    BEGIN
       :PARAMETER.Prev_Record := :PARAMETER.Curr_Record;
       :PARAMETER.Curr_Record := :SYSTEM.Trigger_Record;
       IF ( :PARAMETER.Prev_Record != :PARAMETER.Curr_Record) THEN
         -- Make the previous record the user was at Non-Editable...
         Set_Item_Instance_Property('YOUR_BLOCK.YOUR_1st_BLOCK_ITEM', INSERT_ALLOWED, PROPERTY_FALSE);
         Set_Item_Instance_Property('YOUR_BLOCK.YOUR_1st_BLOCK_ITEM', UPDATE_ALLOWED, PROPERTY_FALSE);
         -- You MUST do this for each of the items in the row of your multirecord block.  There is no built-in to set the properties
         -- all of the items in a row...
       END IF;
       -- Now make the current record editable...
         Set_Item_Instance_Property('YOUR_BLOCK.YOUR_1st_BLOCK_ITEM', INSERT_ALLOWED, PROPERTY_TRUE);
         Set_Item_Instance_Property('YOUR_BLOCK.YOUR_1st_BLOCK_ITEM', UPDATE_ALLOWED, PROPERTY_TRUE);
         -- You MUST do this for each of the items in the row of your multirecord block.  There is no built-in to set the properties
         -- all of the items in a row...
    END;
    This sample code is untested and it meant to show you the logic, not the actual functioning code.
    Hope this helps.
    Craig...

  • How to get  "all the required records" displayed from my DB

    Hi,
    In a block i have some fields say MONTH, YEAR, STAFF..... and a button SEARCH.
    i want, my app user enter data in one or many fields and after clicking SEARCH button he gets all his relevant data from DB (in next window/canvas).
    i am using 10g.
    help...plz !!!

    ManiKanchan wrote:
    sorry to bother..
    (-----version 10g-----)
    i have 3 blocks B1, B2, B3.... let the name of my table in DB is TB
    in B1, i have a button UPDATE and a trigger, WHEN-BUTTON-PRESSED, attached to it. the pl/sql code here is "go_block('B2'); enter_query;"
    when i come to B2 after pressing UPDATE, i am in query mode as i can say...
    here in B2, i have 3 fields UNIT, MONTH, YEAR and a button SEARCH. I let user enter 1/2/3 field as he/she wishes
    and with search button there is a trigger WHEN-BUTTON-PRESSED with the code "go_block('B3'); execute_query;"
    in B3, fields are STAFF, NAME, WAGES, UNIT, MONTH, YEAR.
    what i want is,
    according to the inputs in B2 ( one or two or all three) , all the relevant records should be displayed on canvas3 ( as B3 fields) as a table
    but i am not getting it right..What is the data type of unit,month and year in block b2 and b3 ?
    If i think these three are number data type
    try this in the search button of block b2
    declare
         con varchar2(500);
         qt varchar2(10):='''';
    begin
         if :B2.UNIT is not null then
              con:='UNIT='||:B2.UNIT;
         end if;
         if :B2.MONTH is not null then
              con:=con||' and MONTH='||:B2.MONTH;
         end if;
         if :B2.YEAR is not null then
              con:=con||' and YEAR ='||:B2.YEAR;
         end if;
    go_block('b3');
    set_block_property('b3',default_where,con);     
    execute_query;
    end;hopes this helps

  • How to get only the filename and extension for a text item?

    Suppose there is a non-database text item called :myfilename
    :myfilename := 'C:\SomeFolder\SomePath\myfile.doc';
    I would like to get the file name only without the full path,
    i.e. myfile.doc
    and the file extension, i.e. 'doc', 'bat', 'java', 'xhtml' etc., i.e. the last few chars from the right to the period.
    Any help is welcome.

    Thanks for the hints.
    I defined the non-database Text Item called FULLFILENAME and another two text items called FILE_NAME, FILE_EXTENSION. The following can extract the file extension,
    select substr(:FULLFILENAME,instr(:FULLFILENAME,'.')+1) into :FILE_EXTENSION from dual;
    e.g.
    :FULLFILENAME := 'C:\MyFolder\AnotherFolder\file.doc';
    FILE_EXTENSION becomes 'doc'
    but I would also like to extract only the filename without path into FILE_NAME,
    i.e. file.doc
    Please give more hints. Thanks.

  • XML parsing - NodeList : how to get only the desired childs

    Hi
    my question is about parsing XML files. I use "getChildNodes()" method (from org.w3c.dom.Node class) to get in a NodeList all childs of node. Is there a method to get only desired child nodes? For example I want to get only node elements wtih tag "coordinate". Or alternatively, is there a method to exclude text node to be added to the NodeList? My problem is that depending on the xml is formatted, text node could be recognized and added from parser, and this causes problems with my parsing..
    thanks to all

    If you want to select nodes based on changing criteria, you should use XPath.
    If you have relatively fixed criteria, iterate over the nodes and pick out the ones that you want. For example:
      public static List<Element> getChildren(Element parent, String tagname) {
        List<Element> result = new ArrayList<Element>();
        NodeList children = parent.getChildNodes();
        for (int ii = 0 ; ii < children.getLength() ; ii++) {
          Node child = children.item(ii);
          if ((child.getNodeType() == Node.ELEMENT_NODE) && tagname.equals(child.getNodeName()) {
            result.add((Element)child);
        return result;
      }

  • HELP: How to get only the text of an element Node

    Hello
    I am using XPath for the following XML document:
    <Start>
    <User>
    <LoginName>abc</LoginName>
    <Password>qqq</Password>
    </User>
    <User>
    <LoginName>xyz</LoginName>
    <Password>ttt</Password>
    </User>
    </Start>
    Now I want to get the password for the LoginName = 'xyz'.
    The XPath I have written is:
    //User[LoginName='xyz']/Password[text()]"
    The result I get is:
    <Password>ttt</Password>
    But what I want is ONLY the password TEXT i.e the value of the password and NOT the complete node information. What Should I do with the Xpath string so that the result only gives: ttt
    Please help me with this as this has hold me now for quite a long time.
    Thanx.
    Arshad

    Use this method to get the text in Java
    public String getTextContents ( Node node )
    NodeList childNodes;
    StringBuffer contents = new StringBuffer();
    childNodes = node.getChildNodes();
    for(int i=0; i < childNodes.getLength(); i++ )
    if( childNodes.item(i).getNodeType() == Node.TEXT_NODE )
         contents.append(childNodes.item(i).getNodeValue());
    return contents.toString();
    }

Maybe you are looking for

  • In desperate need of a link for CS5

    I currently have Photoshop CS5 on my laptop, but have just purchased a desktop where i need this program as well. I recently moved and have not been able to locate the original CD since then. I have asked Adobe about this, but they say that they can'

  • AP Invoice Line Update

    Hi All, I just want to know how to update INVOICE LINE table by using any interface or by any API. Please need urgent.

  • Transferring applications from a computer to the iPod Touch

    I recently did a Restore to move my iPod Touch from one computer to a new one. I've been able to synch my music and photos successfully. On my new computer, I purchased two applications. They appear in the "applications" category in the source pane O

  • Hold flag for service po

    Hi, Please let me know for service purchase order hold button is available or not. when Iam creating a purchase order with item category D (services), then immediately disappears the hold bottom, but other item categories hold button is appearing and

  • Problems in trying to print address book as list

    Am trying to print my address book as a list. Page 1, 2 and 4 print just fine, but page 3 has data moved so that it overprints other data. Is there a fix for this or should I just reinstall the address book? Macbook intel core duo   Mac OS X (10.4.8)