IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Grouping in Tamino

    Posted Mon October 13, 2003 08:19 AM

    How do I do grouping in tamino?


    #webMethods
    #Tamino
    #API-Management


  • 2.  RE: Grouping in Tamino

    Posted Wed October 15, 2003 07:58 AM

    Finally I find out the way to do grouping. But now I have a different problem. Now I want to sum up one of the field. Following is my senario.

    -
    -
    B7
    1
    hello world
    232.89

    -
    B7
    2
    hello world
    232.89

    -
    B1
    2
    Watermelon Blend
    2.00

    -
    b78
    1
    4354
    45.00

    -
    b78
    1
    4354
    45.00

    -
    b78
    7
    4354
    45.00

    -
    B3
    1
    Papaya Blend
    1.50

    -
    B3
    1
    Papaya Blend
    1.50

    -
    B5
    10
    Sousop Blend
    2.00

    -
    B1
    5
    Watermelon Blend
    1.50

    -
    b00
    1
    tete
    1.00

    -
    b00
    1
    tete
    1.00

    -
    b00
    3
    tete
    1.00

    -
    b00
    2
    tete
    1.00

    -
    b00
    3
    tete
    1.00



    I did the grouping in using the following code.
    Defined the Key:
    <xsl:key name=“itemdescrption” match=“itemdetail” use=“itemdes” />
    <xsl:key name=“optionselect” match=“itemdetail” use=“concat(itemdes, ‘/’, @option)” />
    For loop for retrival

    <xsl:variable name=“itemdetail_items” select=“itemdetail[key(‘itemdescrption’, itemdes)]” />
    - <xsl:for-each select=“$itemdetail_items[generate-id() = generate-id(key(‘optionselect’, concat(itemdes, ‘/’, @option))[1])]”>
    <xsl:value-of select=“itemdes” />


    <xsl:value-of select=“@option” />




    - <xsl:for-each select=“key(‘optionselect’, concat(itemdes, ‘/’, @option))”>
    <xsl:value-of select=“quantity” />


    </xsl:for-each>


    </xsl:for-each>

    Now how do I sum up the quantity? Or is there a better way to do this?


    #API-Management
    #webMethods
    #Tamino


  • 3.  RE: Grouping in Tamino

    Posted Fri November 07, 2003 06:52 AM

    This is an XSLT question, not really a Tamino question. Grouping and summing in XSLT have changed significantly from XSLT version 1 to version 2. In version 2 (only available in the Saxon XSLT processor), you can use the sum function http://www.w3.org/TR/xpath-functions/#func-sum
    but in version 1 I don’t know how to do it.

    Bill


    #webMethods
    #Tamino
    #API-Management


  • 4.  RE: Grouping in Tamino

    Posted Mon November 24, 2003 09:32 AM

    I missed the fact that this question had not yet been answered. Are you still looking for an answer? As Bill says, it’s an XSLT question: perhaps you should start again and ask it in the XSLT forum. Or a good place for XSLT coding advice, if the question isn’t specific to Software AG products, is the xsl-list at www.mulberrytech.com.


    #Tamino
    #webMethods
    #API-Management