Replacing multiple nodes with single node in OSB

Hi,
I have a case where I will get a xml like below:
<LINEITEMS>
     <LINE_ITEM>
          <LINE_ITEMNO>1</LINE_ITEMNO>
          <STATUS_CODE>0</STATUS_CODE>
          <MESSAGE>MESSAGE1</MESSAGE>
     </LINE_ITEM>
     <LINE_ITEM>
          <LINE_ITEMNO>3</LINE_ITEMNO>
          <STATUS_CODE>0</STATUS_CODE>
          <MESSAGE>MESSAGE3</MESSAGE>
     </LINE_ITEM>
     <LINE_ITEM>
          <LINE_ITEMNO>1</LINE_ITEMNO>
          <STATUS_CODE>0</STATUS_CODE>
          <MESSAGE>MESSAGE2</MESSAGE>
     </LINE_ITEM>
     <LINE_ITEM>
          <LINE_ITEMNO>3</LINE_ITEMNO>
          <STATUS_CODE>0</STATUS_CODE>
          <MESSAGE>MESSAGE4</MESSAGE>
     </LINE_ITEM>
<LINE_ITEM>
          <LINE_ITEMNO>2</LINE_ITEMNO>
          <STATUS_CODE>1</STATUS_CODE>
          <MESSAGE>MESSAGE5</MESSAGE>
     </LINE_ITEM>
</LINEITEMS>
I need to make this as below:
<LINEITEMS>
     <LINE_ITEM>
          <LINE_ITEMNO>1</LINE_ITEMNO>
          <STATUS_CODE>0</STATUS_CODE>
          <MESSAGE>MESSAGE1;MESSAGE2</MESSAGE>
     </LINE_ITEM>
     <LINE_ITEM>
          <LINE_ITEMNO>3</LINE_ITEMNO>
          <STATUS_CODE>0</STATUS_CODE>
          <MESSAGE>MESSAGE3;MESSAGE4</MESSAGE>
     </LINE_ITEM>
<LINE_ITEM>
          <LINE_ITEMNO>2</LINE_ITEMNO>
          <STATUS_CODE>1</STATUS_CODE>
          <MESSAGE>MESSAGE5</MESSAGE>
     </LINE_ITEM>
</LINEITEMS>
I need to have only one entry for each line Item.
Please let me know on the approach on how to do it in OSB.
Thanks

You can try this :-
let $out:= <LINEITEMS>{ for $x in 1 to count($input/LINE_ITEM)
                              let $LineItme := $input/LINE_ITEM[$x]/LINE_ITEMNO
                         let $match:= for $y in $x to count($input/LINE_ITEM)
                              where $input/LINE_ITEM[$y]/LINE_ITEMNO= $LineItme
                              return $input/LINE_ITEM[$y]/MESSAGE
                              return
                              <LINE_ITEM>
                                   <LINE_ITEMNO>{$LineItme/text()}</LINE_ITEMNO>
                                   <STATUS_CODE>{data($input/LINE_ITEM[$x]/STATUS_CODE)}</STATUS_CODE>
                                   <MESSAGE>{fn:data($match)}</MESSAGE>
                              </LINE_ITEM>
}</LINEITEMS>
return $out
You many then have to remove duplicates with line items. use fn:distinct() and then loop through.

Similar Messages

  • Replacing multiple spaces with another character

    i need to replace multiple spaces with another char in a string
    my code is
    Dim text as String="a bit much             a little much" Dim arr As String() = text.Split({" "c}, StringSplitOptions.RemoveEmptyEntries)Dim newtext As String = String.Join(" ", arr)            MsgBox(newtext)           
     it returns to "a bit much  a little much "
    But i want to replace only long spaces with "="  as  "a bit much =a little much"
    How can i do that?

    This version uses two spaces to split the string and then trims any additional single spaces. It returns "a bit much = a little much".
    Dim text As String = "a bit much a little much "
    Dim parts() As String = text.Split({" "}, StringSplitOptions.RemoveEmptyEntries)
    Dim newText As String
    If parts.Length = 2 Then
    newText = parts(0).Trim & " = " & parts(1).Trim
    End If

  • Can we create multiple application with single MSI(or Same MSI) in biztalk admin console ?

    Can we create multiple application with single MSI(or Same MSI) in biztalk admin console ?
    My client requirement is process 100 files  from biztalk with in 5 min ,actually it is taking 20 min .
    So I decided to created same instance of the application with multiple time in BTS admin console ,as I understand biztalk admin console never allow to install same
    schema’s with multiple  time .
    Any help can be  appreciate ..

    BizTalk will automatically process multiple messages on separate threads so you may need to tune your system. The following link should get you started:
    http://social.technet.microsoft.com/wiki/contents/articles/7801.biztalk-server-performance-tuning-optimization.aspx
    Another possibility is to set the Batch Size property on your receive location if the adapter uses batch size to determine how messages are picked up.  As an example, it you want  the MSMQ adapter to immediately pick up messages and start
    to process them, set the batch size to 1.
    You may also need to distribute the processing across multiple BizTalk servers by installing BizTalk on additional servers and joining the existing BizTalk group.
    David Downing... If this answers your question, please Mark as the Answer. If this post is helpful, please vote as helpful.

  • Firefox is replacing double quotes with single quotes.

    In WordPress and at other sites where I input and save text, Firefox is replacing double quotes with single quotes when I save. It's also showing double quotes as single quotes on websites. I tried uninstalling and reinstalling, and it's still happening.

    Do you have the needed font installed?
    *http://en.wikipedia.org/wiki/Punctuation

  • Single report with multiple queries OR multiple reports with single query

    Hello Experts,
    I have a confusion regarding Live Office connection for many days. I asked many people but did not get a concrete answer. I am re-posting this question here and expecting an answer this time.
    The product versions that I am using are as follows:
    FrontEnd:
      BOE XI 3.1 SP4 FP 4.1
      Xcelsius Enterprise 2008 SP4
    Backend:
      SAP BW 7.0 EHP1
    I have created a dashboard which is getting data from a webi report using LO connections.
    The webi report has five report parts which are populated by five different queries.
    Now my question is, when the five LO connections are refreshed, is the webi report refreshed five times or just once?
    If the report is refreshed five times, then I guess it is better to have five different webi reports containing single report part, because in that way we can prevent same query being executed multiple times.
    SO what is the best practice- to have a single report having multiple queries - OR - to create multiple webi reports with single query?
    Thanks and Regards,
    PASG

    HI
    I think Best Practice is Multiple reports with single query
    Any way If LO connections refresh 5 time the query will refresh 5 timesRegards
    Venkat

  • When iam loading multiple datatargets with single datasource request failed

    when iam loading multiple datatargets with single datasource request failed
    i want to delete the  bad request at a time in all datatargets

    Hi Neeraj,
    The only thing you can do is go in to theMonitor screen of that IP and select the datatargets from the Monitor screen.In the next screen you can see all the targets included in the IP at the top.But the only bad thing is you have to manually delete the Bad request only from each target.
    Regards
    Sandeep

  • Is it possible to integrate multiple instances with single OAM (Oracle Acce

    Hi All,
    Please could anyone clarify,is it possible to integrate multiple instance with single OAM(Oracle Access Manager).
    We have two instance in development environment, Among them one is already integrated with OAM 11g,Now we want to integrate the second one with OAM 11g. For this already configured OAM is enough or we need to configure the another OAM separately.
    Application Version is 12.1.1
    Database Version : 11.1.0.7
    OS : RHEL 5.3 64 bit
    Thanks in advance.

    Hi Hussein ,
    I Ran below script,
    ant -f txkEBSAuth.xml \
    -Dwlshosturl=appora.corp.hexaware.com:7021 \
    -Dwlsuser=weblogic \
    -Dwlspwd=password1 \
    -DuseDefaults=true \
    -DforceDataSource=true \
    -DdataSourceName=DEV \
    -DdataSourceJNDIName=jndi/DEV \
    -DasadminUser=SSO11GLOGIN \
    -DasadminPassword=welcome1 \
    -DdbcFile=/u06/oamfmw/Middleware/appsutil/accessgate/DEV/DEV.dbc \
    -DserverName=AdminServer \
    -DdeploymentName=ebsauth_DEV \
    -DfndauthWarFile=/u06/oamfmw/Middleware/appsutil/accessgate/DEV/fndauth.war \
    -DplanPath=/u06/oamfmw/Middleware/appsutil/accessgate/DEV/plan/plan.xml \
    -DforceDeployment=true \
    -DSSOServerRelease=11 \
    -DSSOServerURL=http://appora.corp.hexaware.com:14100 \
    -DWebgateLogoutURL=http://appora.corp.hexaware.com:7780/public/oacleanup.html \
    -DlogConfigfile=/u06/oamfmw/Middleware/appsutil/accessgate/DEV/sample/logging.properties
    -bash: ant: command not found
    Thanks in advance

  • Replacing multiple spaces with a single space

    Hi friends,
    I have a string. It can have zero/one/multiple spaces. I want to make the multiple spaces to single space.
    Here are the cases:
    1. ' a b c d efg h' should be changed to 'a b c d e f g h'
    2. ' a b c d e f g h ' should be changed to 'a b c d e f g h'
    3. 'a b c d e f g h' should not be changed
    4. 'abcdefgh' should not be changed
    Both REPLACE and TRANSLATE do not help. I don't want to go for LOOP logic. Please help me to get it in SQL query.
    Thanks in advance!

    Hi,
    964559 wrote:
    Hi friends,
    I have a string. It can have zero/one/multiple spaces. I want to make the multiple spaces to single space.
    Here are the cases:
    1. ' a b c d efg h' should be changed to 'a b c d e f g h'One solution is to post your string on this site, and then copy it back again. (See below for a more serious solution .)
    This site is doing exactly what you want the function to do: it replaces multiple consecutive spaces with a single space. As a result, it's hard to see what you mean.
    To preserve spacing on this site, type these 6 characters
    \(small letters only, inside curly brackets) before and after each section where you want spacing preserved.
    2. ' a b c d e f g h ' should be changed to 'a b c d e f g h'
    3. 'a b c d e f g h' should not be changed
    4. 'abcdefgh' should not be changed
    Both REPLACE and TRANSLATE do not help. I don't want to go for LOOP logic. Please help me to get it in SQL query.
    Thanks in advance!Regular expressions make this easy:SELECT TRIM ( REGEXP_REPLACE ( str
    , ' +'
    ) AS compressed_str
    FROM table_x;
    You can use nested REPLACE calls to get the same results, but it's messy.
    Edited by: Frank Kulash on Feb 5, 2013 10:18 AM
    Added TRIM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Replace multiple characters to single character

    Hi friends,
    I would like to replace multiple characters in a string to a single character. The character may be a pipe (|) or a tilde (~).
    For example "|||asdf||123|xyz||" should be changed to "asdf|123|xyz".
    I use Oracle 11g2.
    Thanks in advance!

    Without regexp
    with testdata as (
        select '||asdf||||123|xyz|' str from dual union all
        select 'asdf|123|||||||xyz||||' from dual union all
        select '||||||asdf|||123||||||xyz||||||' from dual
    select
    trim (both '|' from
        replace (
            replace (
                replace (str,'|','|'||chr(0))
                ,chr(0)||'|'
            ,chr(0)
    ) str
    from testdata
    STR
    "asdf|123|xyz"
    "asdf|123|xyz"
    "asdf|123|xyz"
    with regexp
    with testdata as (
        select '||asdf||||123|xyz|' str from dual union all
        select 'asdf|123|||||||xyz||||' from dual union all
        select '||||||asdf|||123||||||xyz||||||' from dual
    select
    trim (both '|' from
        regexp_replace (
            str
            ,'\|+'
            ,'|'
    ) str
    from testdata
    STR
    "asdf|123|xyz"
    "asdf|123|xyz"
    "asdf|123|xyz"
    Message was edited by: chris227 regexp added

  • Replacing inconsistant spacing with single space in a string

    is it possible to replace multiple spaces within a string with one space only. Number of spaces is different all the time.
    say one field contains strings with imbedded spaces
    I need to replace all these values so that there will be only one space between words.
    For Eg.
    Input                             Expected Result
    aaa    bbb                       aaa bbb
    ww                vv             ww vv
    ww ss      kk                    ww ss kk
    [/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    user11253970 wrote:
    I am in Oracle 9i :( I can not use reg exp
    Assuming strings do not contain CHR(0) (character with ascii code 0):
    SQL> SELECT  'aaa          bbb  aaa bbb' str,
      2          replace(replace(replace('aaa          bbb  aaa bbb',' ',' ' || CHR(0)),CHR(0) || ' '),CHR(0)) new_str
      3    FROM  dual
      4  /
    STR                                 NEW_STR
    aaa          bbb  aaa bbb           aaa bbb aaa bbb
    SQL> SY.

  • Multiple rows with single date

    I am using a CDC control task to extract and load data from our OLTP source to our Data Warehouse.
    For our Date dimension, we have a DateKey which is a
    DATETIME stamp (created using SSAS dimension wizard). Time is always 00:00:00 as a DATETIME
    value is required for populating the dates.
    Our fact table destination uses this DateKey as a FK.
    Our fact table OLTP data source contains multiple records with a single DATE and TIME field. This fine as I can convert the DATE field to a DATETIME using a derived column.
    However, as our Date dimension has granularity of a day, all we require for our fact table is the most recent daily record from our OLTP data source.
    At present, the data flow task is attempting to write all records and failing on PK constraint.
    How would I go about traversing all records for each date and loading only the most recent for that day? Is there a better way to go about this?

    If you wish to get only one record for today, you can simply use in your source query:
    SELECT TOP 1 ... FROM OLTPdata ORDER BY DEATETIMEcolumn DESC
    if you need one record for each date, you may use ranking functions:
    WITH Q AS (
    SELECT
    ROW_NUMBER() OVER (PARTITION BY CAST(DateTimeColumn AS DATE) ORDER BY DateTimeColumn DESC, some tie breaker column) AS ROWNUM,
    FROM  OLTPData
    SELECT * FROM Q WHERE ROWNUM=1

  • Apply multiple effects to multiple objects with single click box

    I would like to click on a click box and have one object appear and another object disappear. I guess what I'd like to do is apply effects to multiple objects with a single click box. Is that possible?
    Thank you.

    Welcome to our community
    Sure it can be done but you won't use effects to do it.
    When you insert an object in Captivate, you have an option to enable or disable Visibility. You also have an option to name the object. So you would give the object a meaningful name and clear the Visibility option to "hide" it until needed.
    Then you would create an Advanced Action that would hide some objects and show others.
    After that, you would assign the Advanced Action to a Click Box or a Button or some other event.
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Multiple Price with Single Item

    Dear All,
    I work for Logistics company and they have implemented AR,AP,GL,OM,Purchasing...running smoothly.
    Now,they want to create multiple prices for single item,pls find below scenario ,
    A)     Business Process:
    Generally, customer goods will be split and sent in different trains. Then, for same destination & quantity we will get different amount.
    Note: Calculation done by Railways based on variable factors (like penalty charges for over weight or under weight).
    So everyday, every bill have different amount for same quantity and destination will be computed and given by railways.
    B) Current Process in Oracle:
    End user will select item and enter manually.
    C) Client Requirement:
    Needs to create single item with multiple prices
    Note: Item code and price list should be constant due to business requirement.
    I just wondering,how financial company manage price fluactutations...
    Kindly help me out to sort this issue pls.
    Regards,
    Kumar

    Hi Anil/Amit,
    O.K. accept that VK11 is for sales. But when I enter multiple records in VK11 it is getting saved. But same thing is not happening for MEK1. Is there any configuration need to change for the MEk1?
    Please let me know is there any other way or tcode to save the condition with multiple values for single line items.
    Regards,
    Praveen,

  • Update multiple columns with single update statement..

    HI all,
    i am reading the columns value from different table but i want to update it with signle update statement..
    such as how to update multiple columns (50 columns) of table with single update statement .. is there any sql statement available i know it how to do with pl/sql..

    As I understood, may be this. Here i am updating ename,sal, comm columns all at once.
    SQL> select * from emp where empno=7369;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17/12/1980 12:00:00        800                    20
    SQL> UPDATE emp
      2     SET ename = lower (ename),
      3         sal = sal + 1000,
      4         comm = 100
      5   WHERE empno = 7369;
    1 row updated.
    SQL> select * from emp where empno=7369;
         EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
          7369 smith      CLERK           7902 17/12/1980 12:00:00       1800        100         20
    SQL> UPDATE emp
      2     SET ename = (SELECT 'ABCD' FROM DUAL),
      3         sal = (SELECT 1000 FROM DUAL),
      4         comm = (SELECT 100 FROM DUAL)
      5   WHERE empno = 7369;
    1 row updated.

  • Replacing " (double quote) with ' (single quote)

    Hi there,
    I have the following method to manipulate user input. All I want to do is, to replace the double quote with a single quote. The implementation I tried was,
    this.replace(desc, "\"", "'");
    This does not work for me. It jsut removes the double quote and does not introduces the single quote. Could any one please advise?
    Thanks,
    Des
    public static String replace(String line, String oldString, String newString) {
              if(line != null && oldString != null && newString != null) {
                   int index = 0;
                   while ((index = line.indexOf(oldString, index)) >= 0) {
                        line = line.substring(0, index) +
                             newString +
                             line.substring(index + oldString.length());
                        index += newString.length();
              return line;
         }

    Bad luck.. I am unable to get it still.
    This is the code I am using (implemetation is in a JSP. I am using this code to test it).
    public class Test{
    public static void main(String args[]){
         String s = args[0];
         Test t = new Test();
         String doubleQuote = "\"";
         System.out.println(" output :"+ t.replace(s,doubleQuote,"'"));
         //System.out.println(" output :"+ t.replace(s,"\"","'"));
         //System.out.println(" output :"+ t.replace('"', '\''));
    public static String replace(String line, String oldString, String newString) {
              if(line != null && oldString != null && newString != null) {
                   int index = 0;
                   while ((index = line.indexOf(oldString, index)) >= 0) {
                             System.out.println(" line count :");
                        line = line.substring(0, index) +
                             newString +
                             line.substring(index + oldString.length());
                        index += newString.length();
              return line;
    }mshn02
    The main problem is I am stuck with the server's version of Java (which I have no control on it). I could not use 1.4.2

Maybe you are looking for

  • Manufacturer plant Partner not defaulting in PO

    hi all according to SAP Help, the setting for checking manufacturer plants are supposed to be the following: 1) Vendor with account group001 and partner roles LF 2) Manufacturer with account group MNFR which, unless I am missing something,  allows pa

  • OSMF Online-only User Group Meeting -- Edwin van Rijkom  |  TODAY Wed, Jan 20 @ 12:00 NOON PST

    TODAY Wed, Jan 20 @ 12:00 NOON PST we are having the third meeting of the online-only OSMF User Group ( http://www.adobe.com/go/osmf_usergroup ). The online-only OSMF User Group is pleased to have a live presentation on OSMF's new features by a devel

  • Functionalities Change in 11.5.10.2

    Platform: Windows 2003 R2 32-bit EBS: 11.5.10.2 DB: 10.2.0.4 We have just applied all the patches as per our running EBS environment/requirement following metalink note 883202.1. Can anyone please refer me any note/white-paper to come to know what ar

  • Having trouble with aspect ratio when going to iDVD

    I have a movie I am trying to put into iDvd6. I export to qtime , self-contained, with chapter markers. When it is played in idvd it is squeezed. The people are tall and thin. It is all shot, edited, transfered in 4:3 ratio. I have checked if all set

  • Windows Server 2008 x64 Trial Install

    Problem: Error code: 0x80070070.  Situation: I have three drives. C:, D:, and E:. Drive C is my current OS, Win7 Pro x64. Drive D is my main storage drive for videos, music, etc... Drive E is a terabyte drive that is partitioned in half. I am trying