How to get the following-sibling nodes until a specific node

XSL people,
I need to get all the following-sibling nodes for every <h> node until the next <h> node.
Example:
<body>
<h>Header1</h>
<a>Line 11</a>
<b>Line 12</b>
<c>Line 13</c>
<a>Line 14</a>
<h>Header2</h>
<a>Line 21</a>
<c>Line 22</c>
<a>Line 23</a>
<b>Line 24</b>
</body>
So I need to get this strings:
from the first <h> node: Line 11Line 12Line 13Line 14
from the second <h> node: Line 21Line 22Line 23
When using following-sibling
<xsl:value-of select="following-sibling::a"/>
<xsl:value-of select="following-sibling::b"/>
<xsl:value-of select="following-sibling::c"/>
I am not getting the second <a> node (of course!), so for the first <h> node I am only getting
Line 11Line 12Line 13
and not
Line 11Line 12Line 13Line 14
and I don't know how to get it.
Thank you.
Anatoliy Smirnov

Thanks Sudipto for trying to help. I did try that, and as I mentioned in the previous posting, it doesn't work for the tree nodes (multiple RowSetIterator). the following is my code, where the treeVO is the vo instance for the firstLevel tree nodes and it has view link to its children. I am not sure how to sort all children for each level. Even for the first level where I did the explicit sorting in memory, it still not sorting at all.
treeVO.setSortBy("code");
treeVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS|ViewObject..QUERY_MODE_SCAN_DATABASE_TABLES);
treeVO.executeQuery();

Similar Messages

  • JTree: How to get the currently selected node

    How do I get the currently selected node in JTree?
    getLastSelectedPathComponent() this method always return the last selected node and not the current one.
    Thanks in advance
    Sachin

    Use
    TreePath selectedPath = tree.getSelectionPath()If your tree allows multiple selections, use
    TreePath [] selectedPaths = tree.getSelectionPaths() this will return an array of all selected tree paths.
    Once you get the tree path, call the treePath.getLastPathComponent(). this should tell you the currently selected node.
    Hope this helps
    Sai Pullabhotla

  • How to make the tree sibling nodes sorting  in memory per the VO default?

    Hi,
    I have a question on the uncommitted tree nodes sorting. The tree was built using the same VO with the view link to itself (parent/child relation). I have defined a default sorting on my VO. Now if I insert a node to the tree, the sibling nodes may not sort correctly if it is not committed. I tried to insert it to the RowsetIterator at the right position, it seems OK. but when you right click or something that make the tree to refresh, the order will mess up. If I do an auto save after each action, everything looks OK. But the fusion pattern is to do a global save, I have to manipulate the tree with the uncommitted data. I know I can set the view object's SQL mode to do the in-memory sorting. But not sure if it works on the tree structure, because it is not a single RowsetIteroator.. Can someone give an advice? Many thanks.
    Edited by: user736572 on Jan 20, 2012 2:48 PM

    Thanks Sudipto for trying to help. I did try that, and as I mentioned in the previous posting, it doesn't work for the tree nodes (multiple RowSetIterator). the following is my code, where the treeVO is the vo instance for the firstLevel tree nodes and it has view link to its children. I am not sure how to sort all children for each level. Even for the first level where I did the explicit sorting in memory, it still not sorting at all.
    treeVO.setSortBy("code");
    treeVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS|ViewObject..QUERY_MODE_SCAN_DATABASE_TABLES);
    treeVO.executeQuery();

  • How to get the profit center nodes descriptions

    Hi Experts,
                 i have value of profit center   17007236. but i need to get the hierarchy above this profit center and their descriptions. previously i have done similar kind of   problem, but i that case i have top level node from which i have extracted bottom level descriptions and profit center values. this can be referred in the below link.
    Re: Profit Center Groups
    but now i have profit center values but i need to get the above hierarchy value and descriptions. which are shown in bold letters.
    any suggestions or any function module available please kindly reply me. point will be rewarder for all answers.
       <b> 5  SOI_STREAM      Downstream PPS                                                                               
    5  SOI5000007      DOWNSTREAM NON-OPERATING BU'S                                                                               
    5  SOI6IS0001      INTEGRATED SUPPLY TRADING                                                                               
    5  SOI7IS0091      IST EAST COAST                                                                               
    5  SOI7IS0092      CHICAGO PRICING BASIS                                                                               
    5  SOI7IS0100      (CHG) CHICAGO BASIS GAS BOOK                                                                               
    5  SOI7IS0126      MARKETING CHICAGO  BASIS GAS  </b>
                                                                                    17007236   CHG 4022 GRAFTON OH (LTAZ)       
                                    17007326   CHG 4022 GRAFTON OH (LTAZ)       
    Thanks & Regards,
    Poorna.

    Hello Poorna
    The following sample report may be useful to you. The sample cost center was taken from the cost center group 'H1' on our IDES ECC 5.0.
    *& Report  ZUS_SDN_COST_CENTER_BOTTOM_UP
    REPORT  zus_sdn_cost_center_bottom_up.
    TYPE-POOLS:  abap.
    DATA:
      gd_setid                 TYPE setid,
      gt_supersets             TYPE STANDARD TABLE OF setlist,
      gs_setlist               TYPE setlist,
      gs_setinfo               TYPE setinfo,
      gt_setinfo               TYPE STANDARD TABLE OF setinfo,
      gs_costcenterdetail      TYPE bapi0012_ccoutputlist,
      gt_return                TYPE bapirettab.
    DATA:
      gs_layout                TYPE lvc_s_layo.
    PARAMETERS:
      p_kokrs      TYPE kokrs  DEFAULT '1000',
      p_kostl      TYPE kostl  DEFAULT '2-1110'.
    START-OF-SELECTION.
      CALL FUNCTION 'BAPI_COSTCENTER_GETDETAIL1'
        EXPORTING
          controllingarea            = p_kokrs
          costcenter                 = p_kostl
    *     KEYDATE                    = SY-DATLO
    *     MASTER_DATA_INACTIVE       = ' '
        IMPORTING
          costcenterdetail           = gs_costcenterdetail
        TABLES
          return                     = gt_return
    *     EXTENSIONIN                =
    *     EXTENSIONOUT               =
      CALL FUNCTION 'G_SET_ENCRYPT_SETID'
        EXPORTING
          setclass             = '0101'  " cost center group
          shortname            = gs_costcenterdetail-costctr_hier_grp
          kokrs                = p_kokrs
        IMPORTING
          setid                = gd_setid
        EXCEPTIONS
          no_co_area_specified = 1
          illegal_setclass     = 2
          OTHERS               = 3.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'G_SET_GET_ALL_SUPERSETS'
        EXPORTING
    *     CLIENT          =
          setname         = gd_setid
        TABLES
          supersets       = gt_supersets.
      CLEAR: gs_layout.
      gs_layout-cwidth_opt = abap_true.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_structure_name = 'SETLIST'
          i_grid_title     = 'Supersets'
          is_layout_lvc    = gs_layout
        TABLES
          t_outtab         = gt_supersets
        EXCEPTIONS
          program_error    = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      REFRESH: gt_setinfo.
      LOOP AT gt_supersets INTO gs_setlist.
        CLEAR: gs_setinfo.
        CALL FUNCTION 'G_SET_GET_INFO'
          EXPORTING
            class                           = '0101'  " Cost Center Group
    *       NO_SET_TITLE                    = ' '
            setname                         = gs_setlist-setname+4
    *       TABLE                           = ' '
    *       FIELDNAME                       = ' '
    *       USE_TABLE_BUFFER                = 'X'
    *       CLIENT                          =
          IMPORTING
            info                            = gs_setinfo
          EXCEPTIONS
            set_not_found                   = 1
            illegal_field_replacement       = 2
            OTHERS                          = 3.  .
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        APPEND gs_setinfo TO gt_setinfo.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
          i_structure_name = 'SETINFO'
          i_grid_title     = 'Setinfos'
          is_layout_lvc    = gs_layout
        TABLES
          t_outtab         = gt_setinfo
        EXCEPTIONS
          program_error    = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    END-OF-SELECTION.
    Regards
      Uwe

  • How to get the following field values?

    I have an invoice number. How can I find out (from which tables and fields) the ship date, vessel, port of loading, port of discharge. I think it is VTTK table and fields are datbg, text1, add01 and add02, but if so what should I give in VTTK table to get these values?
    Please give your input.
    I appreciate and points assured for helpful answers.
    Krishen

    Hi Krishen,
    For ship date you can find the data in LIKP table itself. All other details like vessel, port of laoding and port of discharge will be found at the shipping point level.
    Select the delivery number in VL03n and from the menu GOTOITEMSHIPMENT you will find the shipping point details.
    Cheers
    VJ

  • How to get the following output

    Table 1                                        Table 2    
    EmpCode    EmpName        EmpCode EmpPhone
    10001         ABC                    10001    12345
    10002         BCD                    10001    23456
    10003         CDE                    10001    34567
    10004         EFG                     10006    45678
    10005         FGH                     10007    56789
    10006         GHI                     10007    67890
    10007         HIJ                      10010    78901
    10008         IJK                      10010    89012
    10009         JKL                     10010    90123
    10010         KLM                    10011    13579
    10011         LMN                    10012    35791
    10012         MNO                   10012    57913
    10013         NOP                   10012    79135
    10014         OPQ                   10017    91357
    10015         PQR                    10017    12390
    10016         QRS                    10019    23479
    10017         RST            
    10018         STU            
    10019         TUV  
    output        
    EmpCode    EmpName    EmpPhone
    10001           ABC             12345/23456/34567
    10002           BCD    
    10003          CDE    
    10004          EFG    
    10005          FGH    
    10006         GHI            45678
    10007         HIJ           56789/67890
    10008         IJK    
    10009         JKL    
    10010         KLM       78901/89012/90123
    10011         LMN      13579
    10012         MNO       35791/57913/79135
    10013         NOP    
    10014        OPQ    
    10015        PQR    
    10016       QRS    
    10017       RST       91357/12390
    10018       STU    
    10019       TUV      23479
                              

    Srimanta,
    Check this:
    select t1.EmpCode,t1.EmpName,STUFF((select '/'+EmpPhone from Table2 where EmpCode=t1.EmpCode for xml path('')),1,1,'') as PhoneNum
    from Table1 t1
    left join Table2 t2 on t1.EmpCode=t2.EmpCode
    group by t1.EmpCode,t1.EmpName
    Edited : small change in code(highlighted - t1 instead of t2)
    Thanks,
    Jay
    <If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>

  • How to get the user exits Enhancement no.

    Hi All,
    How to get the following userexit  Enhancement no in SMOD transaction code.
    User Exit: J_1i7_userexit_exinv_addl_data
    Please help.

    Hi,
    These are the user exits not for the code implemention . These are called by the values given in the configuration. so u don't see any enhancement number for them .
    For more details refer this doc by clicking on find and give ur exit name.
    [Reference|http://allsapsdonline.blogspot.com/2008_10_01_archive.html]
    Rhea.

  • How to get the specific filename

    Hi..
    I want to get the specific file where the filename contains current date like "asd.11.20051226.03.dat". Then, i want to write the filename to a text file.
    Now, i only know how to get the list of file in a specific directory& write the whole list to a text file. How to filter the list of filename because they have "dot" in their name?

    To determine if a string contains a dot:I have a feeling that about 10 seconds after he figures out whether the filename contains a dot he's going to need to look a little deeper to determine whether he found wakka.wrongfile.txt or 11.20.1980.the.file.hes.looking.for.data. Maybe?

  • How to get the current tree element (node/childnode/childnode/...) ?

    Hello!
    I'm trying to create a kind of a navigation tree for my application.
    It should represent some elements of an XML structure and some other nodes for other options.
    The binding with the context is not a problem, I can create the tree up to all the levels I want to.
    The problem now is, that I don't know, how to get the "current tree element", when there is any action.
    For example:
    public void onActionSelect(...) {
    String test = wdContext.currentTreeNodeElement().getText();
    wdThis.wdGetContext().currentContextElement().setSelectedElement(test);
    With this method I can get the text of the "first level nodes". If I want to get the "second level node", I can do
    String test = wdContext.currentTreeNodeElement().currentChildElement.getText();
    ..and for the next levels so on.
    Isn't there any general method to get the information of the selected element without knowing before, whether it is a nodeElement or a nodeElement.currentChildElement or a nodeElement.currentChildElement.currentChildElement, ...?
    Greetings,
    Ramó

    Hi,
    if you following that pdf ,
    i think your not implemented the below code in DomodifyView method
    if (firstTime) {
          IWDTreeNodeType treeNode = (IWDTreeNodeType) view.getElement("TheNode");
          /* The following line is necessary to create parameter mapping from parameter "path" to parameter "selectedElement".
    Parameter "path" is of type string and contains the string representation of the tree element (its corresponding context element to be exact)
    that raised the onAction event. Parameter "selectedElement" is of type IWDNodeElement (or extends it) and is defined as parameter in the event handler
    that handles the onAction. The parameter mapping defined here translates the String "path" into the corresponding context element that then can
    be accessed within the event handler
          treeNode.mappingOfOnAction().addSourceMapping("path", "selectedElement");
          /* The following line is necessary to create parameter mapping from parameter "path" to parameter "element".
    Parameter "path" is of type string and contains the string representation of the tree element (its corresponding context element to be exact)
    that raised the onLoadChildren event. Parameter "element" is of type IWDNodeElement (or extends it) and is defined as parameter in the event handler
    that handles the onLoadChildren. The parameter mapping defined here translates the String "path" into the corresponding context element that then can
    be accessed within the event handler
          treeNode.mappingOfOnLoadChildren().addSourceMapping("path", "element");
    please cross check once.
    Thanks,
    Ramesh

  • IOS updates - I keep getting the following message when I try to update my iPad2 - unable to install update, an error occurred installing IOS 8.1.2.  How can I fix this?

    IOS error messagge - I keep getting the following message when I try to update my iPad2 - unable to install update, an error occurred installing IOS 8.1.2.  How can I fix this?

    Which way are you trying to update? WiFi or iTunes? In either case, I would try restarting/rebooting all devices and then try again.
    IF you are using iTunes, eject your iPad, quit iTunes, reboot your computer and reset your iPad by holding down on the sleep and home buttons until the Apple logo appears on the screen. After the iPad starts up, connect to iTunes and try again. You may also want to disable your firewall and antivirus software when you try to update using iTunes. Sometimes those will interfere with the download.
    If you are using WiFi, reset the iPad as described above and try again.
    If WiFi updating will not work, try using iTunes, if iTunes will not work, try using WiFi.

  • How to get the node value of payload

    Hi
    The null is returned when I use the following code to get the User_ID element in the payload, but there are values in the User_ID element of the payload
    Task task_test = wfSvcClient.getTaskQueryService().getTaskDetailsById(wfCtx, taskId);
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getNodeValue());
    How to get the node value of payload ? any suggestion?
    Thanks
    Jayson

    Hi Jayson,
    Try:
    System.out.println("the payload value is " + task_test.getPayloadAsElement().getElementsByTagName("User_ID").item(0).getFirstChild().getNodeValue());
    So add the getFirstChild() call in between.
    If this works, maybe consider using JAXB to marshall the payload details to POJO's. This will make reading the payload details much easier.
    Regards, Ronald

  • Hi. I get the following message when trying to update or install an application: "impossible to connect to iTunes store". Does anyone know how to fix this? Thanks!

    Hi. I get the following message when trying to update or install an application: "impossible to connect to iTunes store". Does anyone know how to fix this? Thanks!

    Try updating your iTunes using an iTunesSetup.exe (or iTunes64Setup.exe) installer file downloaded from the Apple website:
    http://www.apple.com/itunes/download/

  • How to get the values of all elements and sub elements from  following xml

    how to get the values of all elements and sub elements from following xml...
    <?xml version="1.0" encoding="UTF-8" ?>
    <List_AML_Finacle xmlns="http://3i-infotech.com/Cust_AML_Finacle.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://3i-infotech.com/Cust_AML_Finacle.xsd List_AML_Finacle.xsd">
    <TransactionID>TransactionID</TransactionID>
    <Match>
    <Src_Matched_Field>Src_Matched_Field</Src_Matched_Field>
    <List_Matched_Field>
    <FSFM_Matches>
    <NUMBER>NUMBER</NUMBER>
    <TERROR>TERROR</TERROR>
    <TU>TU</TU>
    <NAMEU>NAMEU</NAMEU>
    <DESCRIPT>DESCRIPT</DESCRIPT>
    <KODCR>KODCR</KODCR>
    <KODCN>KODCN</KODCN>
    <AMR>AMR</AMR>
    <ADDRESS>ADDRESS</ADDRESS>
    <SD>SD</SD>
    <RG>RG</RG>
    <ND>ND</ND>
    <VD>VD</VD>
    <GR>GR</GR>
    <YR>YR</YR>
    <MR>MR</MR>
    <CB_DATE>CB_DATE</CB_DATE>
    <CE_DATE>CE_DATE</CE_DATE>
    <DIRECTOR>DIRECTOR</DIRECTOR>
    <FOUNDER>FOUNDER</FOUNDER>
    <TERRTYPE>TERRTYPE</TERRTYPE>
    </FSFM_Matches>
    <OfacMatchDetails>
    <UID>UID</UID>
    <TITLE>TITLE</TITLE>
    <SDNTYPE>SDNTYPE</SDNTYPE>
    <REMARKS>REMARKS</REMARKS>
    <ID_UID>ID_UID</ID_UID>
    <IDTYPE>IDTYPE</IDTYPE>
    <IDNUMBER>IDNUMBER</IDNUMBER>
    <IDCOUNTRY>IDCOUNTRY</IDCOUNTRY>
    <ISSUEDATE>ISSUEDATE</ISSUEDATE>
    <EXPIRATIONDATE>EXPIRATIONDATE</EXPIRATIONDATE>
    <ADDRESS1>ADDRESS1</ADDRESS1>
    <ADDRESS2>ADDRESS2</ADDRESS2>
    <ADDRESS3>ADDRESS3</ADDRESS3>
    <CITY>CITY</CITY>
    <STATEORPROVINCE>STATEORPROVINCE</STATEORPROVINCE>
    <POSTALCODE>POSTALCODE</POSTALCODE>
    <COUNTRY>COUNTRY</COUNTRY>
    </OfacMatchDetails>
    </List_Matched_Field>
    </Match>
    </List_AML_Finacle>

    avoid multi post
    http://forum.java.sun.com/thread.jspa?threadID=5249519

  • How to get the data from multiple nodes to one table

    Hi All,
    How to get the data from multiple nodes to one table.examples nodes are like  A B C D E relation also maintained
    Regards,
    Indra

    HI Indra,
    From Node A, get the values of the attributes as
    lo_NodeA->GET_STATIC_ATTRIBUTES(  IMPORTING STATIC_ATTRIBUTES = ls_attributesA  ).
    Similarily get all the node values from B, C, D and E.
    Finally append all your ls records to the table.
    Hope you are clear.
    BR,
    RAM.

  • How to Find out the from which table we can get the following fields?

    The following fields are from invoice data
    How to  know or from which table we get the following fields:
    Header Details:
    Manifest:, Finance Control #:, Alternate SID:, Carrier:, Container/Trailer #:, Hazmat Code:, Harmonizing Code, Freight Forwarder, Fiscal Rep., Ship From,  Notify Party
    Item Details:
    VAT/Tax Rate %, VAT/Tax Amount, Measurements, Net Weight, Gross Weight
    thanks

    Dear Krishnama
    Place your mouse on the required fields and press F1.  A box with header Performance Assistant will appear in front of you where you select "Technical information" (icon like hammer and spanner). 
    You can now see what table it is.
    thanks
    G. Lakshmipathi

Maybe you are looking for