How to get multiple elements into one element as multiple occurences

I can't figure out how to do this. I have an input message that has multiple elements and I need to take those elements and copy them into one element with each new element going in as a new occurence or instance. For example
I have this input under one parent node.
element1
element2
element3
element4
and this is the output I need
Node
Element1[0]
Element2[1]
Element3[2]
Element4[3]
The input XML looks like this
Payload
Element1
Element2
Element3
and the output XML needs to look like this
Payload
Element.
Thanks in advance

How about this.
Input XML:
<Row>
          <Column1>TOTAL</Column1>
          <Column_9_2_2008>900</Column_9_2_2008>
          <Column_9_2_20082>890</Column_9_2_20082>
          <Column_9_3_2008>52</Column_9_3_2008>
          <Column_9_4_2008>0</Column_9_4_2008>
          <Column_9_4_20082>0</Column_9_4_20082>
          <Column_9_5_2008>0</Column_9_5_2008>
          <Column_9_5_20082>0</Column_9_5_20082>
          <Column_9_8_2008>0</Column_9_8_2008>
          <Column_9_8_20082>0</Column_9_8_20082>
          <Column_9_9_2008>0</Column_9_9_2008>
          <Column_9_9_20082>0</Column_9_9_20082>
          <Column_9_10_2008>0</Column_9_10_2008>
          <Column_9_10_20082>0</Column_9_10_20082>
          <Column_9_11_2008>0</Column_9_11_2008>
          <Column_9_11_20082>0</Column_9_11_20082>
          <Column_9_12_2008>0</Column_9_12_2008>
          <Column_9_12_20082>0</Column_9_12_20082>
          <Column_9_15_2008>0</Column_9_15_2008>
          <Column_9_15_20082>0</Column_9_15_20082>
          <Column_9_16_2008>0</Column_9_16_2008>
          <Column_9_16_20082>0</Column_9_16_20082>
          <Column_9_17_2008>0</Column_9_17_2008>
          <Column_9_17_20082>0</Column_9_17_20082>
          <Column_9_18_2008>0</Column_9_18_2008>
          <Column_9_18_20082>0</Column_9_18_20082>
          <Column_9_19_2008>0</Column_9_19_2008>
          <Column_9_19_20082>0</Column_9_19_20082>
          <Column_9_22_2008>0</Column_9_22_2008>
          <Column_9_22_20082>0</Column_9_22_20082>
          <Column_9_23_2008>0</Column_9_23_2008>
          <Column_9_23_20082>0</Column_9_23_20082>
          <Column_9_24_2008>0</Column_9_24_2008>
          <Column_9_24_20082>0</Column_9_24_20082>
          <Column_9_25_2008>0</Column_9_25_2008>
          <Column_9_25_20082>0</Column_9_25_20082>
          <Column_9_26_2008>0</Column_9_26_2008>
          <Column_9_26_20082>0</Column_9_26_20082>
          <Column_9_29_2008>0</Column_9_29_2008>
          <Column_9_29_20082>0</Column_9_29_20082>
          <Column_9_30_2008>0</Column_9_30_2008>
     </Row>
Output XML:
<Total>
          <Payload>900</Payload>
     </Total>
     <Total>
               <Payload>890</Payload>
     </Total>
     <Total>
               <Payload>52</Payload>
     </Total>

Similar Messages

  • Need to concat multiple elements into one element

    Hello, here is my challenge:
    Query:
    SELECT  XMLROOT (
            XMLELEMENT ("Inv",
                             XMLAGG (
                                        XMLELEMENT ("Invline",
                                                     XMLELEMENT ( "Category", i.category ),
                                                    XMLELEMENT ( "Amount", i.amount ),
                                         ), VERSION '1.0', STANDALONE YES).EXTRACT ('/*')
      FROM (
            SELECT 1 AS inv_no, 'Labor' AS category, 5 AS amount FROM DUAL
                UNION ALL
            SELECT 1, 'Out-of-Pocket', 10 FROM DUAL
                UNION ALL
            SELECT 1, 'Travel', 20 FROM DUAL
                UNION ALL
            SELECT 1, 'Travel', 2.5 FROM DUAL) i;
    Returns:
    <?xml version="1.0" standalone="yes"?>
    <Inv>
      <Invline>
        <Category>Labor</Category>
        <Amount>5</Amount>
      </Invline>
      <Invline>
        <Category>Out-of-Pocket</Category>
        <Amount>10</Amount>
      </Invline>
      <Invline>
        <Category>Travel</Category>
        <Amount>20</Amount>
      </Invline>
      <Invline>
        <Category>Travel</Category>
        <Amount>2.5</Amount>
      </Invline>
    </Inv>
    Required:
    <?xml version="1.0" standalone="yes"?>
    <Inv>
      <Inv_No>1
        <Details>Labor 5
      Out-of-Pocket 10
      Travel 22.5
      </Details>
      </Inv_no>
    </Inv>
    So I would like help combining the details into one field for transmission to the Mexican Tax Authorities( their spec calls for all  invoice lines to be concated together).
    Note that there are two travel details that need to be summed as well.
    I would prefer to cannot change the query if possible, just using the XML functions.
    Thanks!

    And your db version is?
    From 11.2 and onwards, you can use LISTAGG aggregate function to concatenate character data across rows :
    SELECT XMLElement("Inv"
           , XMLAgg(
               XMLElement("Inv_No"
               , v.inv_no
               , XMLElement("Details"
                 , listagg(v.category || ' ' || to_char(v.amount), chr(10))
                     within group (order by v.category)
    FROM(
        SELECT t.inv_no
             , t.category
             , sum(t.amount) as amount
        FROM (
          SELECT 1 AS inv_no, 'Labor' AS category, 5 AS amount FROM DUAL UNION ALL
          SELECT 1, 'Out-of-Pocket', 10 FROM DUAL           UNION ALL
          SELECT 1, 'Travel', 20 FROM DUAL            UNION ALL
          SELECT 1, 'Travel', 2.5 FROM DUAL
        ) t
        GROUP BY t.inv_no, t.category
    ) v
    GROUP BY v.inv_no ;

  • If I have two separate pages documents, how do I compile them into one document with multiple pages?

    I have two separate documents, but I need them to be in one document in a sort of magazine form. How do I get the documents saved together so there are multiple pages in one document?

    Menu > View > Page Thumbnails > click on the thumbnails > Copy > Paste into second document thumbnails
    Peter

  • How to turn multiple tracks into one element for changing scale

    I've created an image out of a number of video tracks in my motion timeline. When I try to change the scale of all the parts, they change but remain the same distance apart so the pieces break apart in my viewer. I've tried making a clone and this solved this aspect of the problem but now my write on behavior that draws the image on does not occur. Is there a way to get around these two issues and create a scalable image that can perform write on behaviors? Thanks in advance and happy new year!
    This is Motion 4

    Ah, nevermind! I think I may have solved the issue myself. It seems if you click on the Group tab to the left of the main timeline as opposed to the clip within the timeline, it allows you to change the group and scale it while also keeping different elements together. Could be helpful for anyone with a similar question.

  • Can we merge content of two elements into one element?

    Hi ,
    I've the following EDD -
    Element (Container): P
    General Rule: (Para | Content | Frame)+
    Attribute list ....
    Element (Container): Content
    General Rule: <TEXT>
    Attribute list:  .....
    Now My XML looks like :
    <P .... <Content ... > Hello </Content><Content...> Forum Users </Content...><Content...> I need your help </Content> </P>
    Now,
    When I open the XML in Framemaker, it writes all the content of "Content" tags on separate lines -
    Hello
    Forum Users
    I need your help
    Instead, I want to write that content on a single line  as -
    Hello Forum Users I need your help..!
    I can use a programming langauge (like C or Java) to read this XML and merge the content of multiple "Content" tags into single "Content" tag.
    My question is:  Is it possible to do the above process using Read/Write rules capabilities of FM or by doing anything extra in my EDD..!
    Please help..!
    Thanks
    Basav

    Van,
    thanks a ton, "Text Range" worked..!
    -Basav

  • HT1660 i have two independent itunes libraries on my computer right now. how do i consolidate them into one library? how do i get rid of duplicate files?

    i have two independent itunes libraries on my computer right now. how do i consolidate them into one library? how do i get rid of duplicate files?

    Hello rmunsey,
    Thank you for the question.  It sounds like you have two separate iTunes Libraries but would like to add the music from one to the other to have one consolidated library.
    If you know where the files are for each library, I recommend opening one iTunes Library in iTunes and importing the files from the other library using the following steps:
    Open iTunes
    From the File menu, choose one of the following choices:
    MacAdd to Library
    Windows
    Add File to Library
    Add Folder to Library
    Navigate to and select the file or folder that you want to add
    Adding music and other content to iTunes
    http://support.apple.com/kb/ht1473
    Next, you can search for duplicates:
    Choose View > Show Duplicate Items to show duplicate items (matches are based on the song name and artist). If you have multiple versions of the same song (for example, live and studio versions, or versions from different albums) you can hold the Alt or Option key (for Mac OS X) or the Shift key (for Windows) and choose View > Show Exact Duplicate Items. This will show only duplicate songs having the same name, artist, and album.
    How to find and remove duplicate items in your iTunes library
    http://support.apple.com/kb/ht2905
    This should help you identify the duplicates all at one time so that you can delete the extra versions of songs.
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How do i put multiple albums into one huge album collection?

    How do i put multiple albums into one huge album collection?
    Some examples include: Linkin Park - Studio Collection, Michael Jackson - The Indisposable Collection

    Hi skullkrunch3r,
    Thanks for visiting Apple Support Communities.
    If you "Get Info" on the tracks that are part of your collection, you can use the Compilation option in iTunes.
    In iTunes 8 and later, you find the option to mark multiple items as "Part of a compilation" in the Options tab of the Multiple Item Information window.
    See this article for more information on marking your albums as part of a compilation:
    Why aren't songs with the same album art grouped together?
    http://support.apple.com/kb/TS1468
    Best Regards,
    Jeremy

  • How do I scan multiple pages into one document using the CanoScan LiDE 200?

    How do I scan multiple pages into one document using the CanoScan LiDE 200?
    I can't seem to find a way to get them to scan continuously, or a way to stitch them together afterwards.

    Hi dagda24,
    You can scan multiple pages into a single document with the scan to PDF option.  Use the following steps to do so:
    1.  Open MP Navigator.
    2.  Click One Clcik.
    3.  Click Save to PC.
    4.  Change the File Type from PDF to PDF (multiple pages).
    5.  Make any other changes as needed, then click scan.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • How to get the count of repeating elements in a xml doc.

    In many xml documents, in is common to have repeating child elements and what I would like to know is how do I determine exactly how many of these child elements exist in a particular document. There is probably a correct XPath string to determine this, but I cannot figure out what it is. Here is an example
    <a>
    <b>
    <c>1</c>
    <c>5</c>
    <c>22</c>
    </b>
    </a>
    The above 'c' element is what varies in number from document to document and I need to know how to get the number of 'c' elements for the document, which would be 3 in the above case.

    create table test_xml(data xmltype)
    insert into test_xml values(
    xmltype('<a>
    <b>
    <c>1</c>
    <c>5</c>
    <c>22</c>
    </b>
    </a>')
    select extract(data, '/a/b/c').getclobval() from test_xml
    select count(*) from test_xml
    where existsnode(data, '/a/b/c')=1
    good luck.

  • How to get Dealership of Adobe Photoshop Elements for Mumbai, Maharastra, India

    Hello,
    i am doing wedding Album designing in india Using Adobe Photoshop Elements8 Licence Version.
    Also Developing Plugin for Adobe Premiere in Flex.
    How to get Dealership of Adobe Photoshop Elements for Mumbai, Maharastra, India
    any one have idea please help.
    thanks
    Dhiraj

    Hi,
    Thanks Barbara B. sure i will try.
    Thanks
    Dhiraj

  • How canI get my serial number for Elements 11?

    How canI get my serial number for Elements 11?  Does anyone know how to help me.  I did puchase it sometime ago but lost all computer data and had to replace computer.  Hope someone can help.
    Thanks
    Steve

    If you have no record of it at your end, the only place you might find it is at Adobe's end via logging into your Adobe account and seeing if it is listed there.  If you registered the software it should be.
    Beyond that your only hope might be to have Adobe support check your information to see if the software/serial number is available and if it can be given to you.  Try contacting them by chat or telephone.
    Here is a link to a page with options to help make contact:
    http://www.adobe.com/support/download-install/supportinfo/

  • I have multiple documents how can I combine them into one document?

    I have multiple document files in Pages. How can I combine them into one document?

    Menu > View > Page Thumbnails > click on the thumbnails > Copy/Paste into thumbnails of other document
    Peter

  • How do I scan multiple pages into one pdf document on a HP Envy 4501 Printer

    My HP Envy 4501 Printer won't let me scan multiple pages into one pdf document.
    I went to "Advanced Settings", clicked on "file" and made sure that the check box next to "Create a separate file for each scanner page" was unchecked.
    When I clicked the Save button it showed the page that I scanned and showed 1/1.  On the right side it had options for changing the brightness and Contrast, Rotate and Crop and "Back", "Save" and "Done" buttons, but nothing about scanning another page.
    Not to mention HP's Customer Support is useless!
    I'd appreciate any help I can get with this problem.
    Thanks,
    Mark

    Hi BH,
    I see your diagram.  I just scanned something.  The screen that I'm looking at right now shows the preview page and the scroll box to the left of that just like in your diagram.  The screen does not show the + button nor does it show the red x button under the scroll box as in your diagram.  I can't see the plus sign because it is not there.
    I tried re-installing the software and drivers as you suggested but that did not have any affect.
    Thank you for trying to help me with this problem but it hasn't worked, therefore I can't mark the reply "Accept as Solution".
    I've noticed that on HP's support forum web page there is only 1 solved request for assistance.  That doesn't give me much confidence in HP.
    Please reply back to this post to let me know if there is anything else that I can try or if you know someone else at HP that can help.
    If I don't here back from you, I'm returning this HP Envy 4501 Printer to get my money back to use it to buy a printer from one of HP's competitors.
    Thanks,
    Mark  

  • 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 concatenate multiple records into one

    Hi everybody:
    I want to know if exist some way to concat multiple records into one without using cursors. For example, I have a table named "Authors" like this:
    Lan|Author
    English|Ernest Hemingway
    Spanish|Octavio Paz
    Spanish|Mario Vargas Llosa
    English|Sinclair Lewis
    Spanish|Gabriel García Márquez
    And I want to get this:
    Author
    Octavio Paz, Mario Vargas Llosa, Gabriel García Márquez
    I have worked with SQL Server and I can do something like this:
    CREATE FUNCTION dbo.MyConcat (@lan varchar(10))
    RETURNS varchar(5000) AS
    BEGIN
    declare @retvalue varchar(5000)
    set @retvalue=''
    select @retvalue = @retvalue + Author +',' from Authors where lan = @lan
    return substring(@retvalue,1,len(@retvalue)-1)
    END
    ie, do not use cursors to concatenate records. However, with ORACLE, I have to do someting like this.
    FUNCTION MyConcat(P_Lan IN VARCHAR2) RETURN VARCHAR2 IS
    v_ret VARCHAR2(4000);
    v_element VARCHAR2(4000);
    v_cursor sys_refcursor;
    BEGIN
    OPEN v_cursor FOR SELECT Author FROM Authors where Lan = P_Lan
    LOOP
    FETCH v_cursor INTO v_elemento;
    EXIT WHEN v_cursor%NOTFOUND;
    IF v_ret IS NULL THEN
    v_ret := v_element;
    ELSE
    v_ret := v_ret || ', ' || v_element;
    END IF;
    END LOOP;
    RETURN v_ret;
    END;
    Exist some other way to do this?
    Best Regards
    Jack

    Tks both for answer... I forgot to mention that I am using Oracle 10g. I read about LISTAGG() but this function is available for Oracle 11g release 2.
    I wil read about the other techniques than Hoek mention
    Best Regards.
    Jack

Maybe you are looking for

  • Equal weighting  AND   Unequal weighting  in Vendor Evaluation ?

    Hi Experts, Can u pls explain me this small issue with Vendor Evaluation weighting SPRO -  IMG - MM  -  PURCHASING -  VENDOR EVALUATION  -  Maintain Purchasing Organization Data - SELECT PURCH .ORG - DOUBLE CLICK ON Weighting -  THERE IS I AM SEEING

  • Hot to show documents for values of infoobjects (master data)?

    helly everybody, i try again to explain what i wanna do. maybe anybody can help me? thx anyway for all other replies before! by SEM-BPS planning functions our users can create documents for values saved in cube and infoobjects masta data. in another

  • Report Script Performance Issues

    Essbase Nation, We have a report script that extracts a full 12 months worth of history in 7 minutes. The script that is used to extract the period dimension is as follows: <Link (<Descendants("Dec YTD") And <Lev("Period",0)) The line above is then c

  • Creating UserID with special character "/"

    Hi I would like to create users with userid as "ID/1234". But OIM is not allowing this "/" special character. I have checked the link Special Characters in password global.security.filter and set the <SecurityLevel> to 0 and restarted OIM server. But

  • Color efex pro won't allow me to choose Photoshop

    I'm trying to download Nik Color Efex Pro 3 and the installation will only allow me to choose Photoshop Elements and not the full Photoshop.  Any ideas?