select/join using XSL

Discussion in 'XML' started by [Jongware], May 23, 2007.

  1. [Jongware]

    [Jongware] Guest

    I have a large table in XML, of the form (simplified)
    <item><a>data1</a><b>more 1</b></item>
    <item><a>data1</a><b>more 2</b></item>
    <item><a>data2</a><b>more 3</b></item>
    -- where I want the output to be
    "data1: more 1, more 2
    data2: more 3"
    i.e., all <a> tags with the same contents grouped into one output item. I can
    select them iterating over <item>, using sth like
    <xsl:variable name="current_item" value="." />
    <xsl:variable name="curr_subset" value=item[a=$current_item]" />
    (that's OTOH; it looks like this, anyway), so I get subsets consisting of all
    <a>'s containing "data1", "data2" etc. However. I get this subset _for each_ of
    the <item>'s, so, for the above example, I get it *twice* for "data1".
    I sense the logic, and yet it's somehow not what I intended. What am I missing?
    (My XSLT proggie misses the 'unique' function, or whatever it is called--that'd
    be an answer :)

    [Jw]
     
    [Jongware], May 23, 2007
    #1
    1. Advertising

  2. [Jongware]

    Pavel Lepin Guest

    [Jongware] <> wrote in
    <74985$4654bb05$3ec3d632$>:
    > I have a large table in XML, of the form (simplified)
    > <item><a>data1</a><b>more 1</b></item>
    > <item><a>data1</a><b>more 2</b></item>
    > <item><a>data2</a><b>more 3</b></item>
    > -- where I want the output to be
    > "data1: more 1, more 2
    > data2: more 3"
    > i.e., all <a> tags with the same contents grouped into one
    > output item.


    XSLT FAQ. Grouping problems. GIYF.

    --
    Pavel Lepin
     
    Pavel Lepin, May 24, 2007
    #2
    1. Advertising

  3. [Jongware]

    [Jongware] Guest

    "Pavel Lepin" <> wrote in message
    news:f33gfp$e4f$...
    >
    > [Jongware] <> wrote in
    > <74985$4654bb05$3ec3d632$>:
    > > I have a large table in XML, of the form (simplified)
    > > <item><a>data1</a><b>more 1</b></item>
    > > <item><a>data1</a><b>more 2</b></item>
    > > <item><a>data2</a><b>more 3</b></item>
    > > -- where I want the output to be
    > > "data1: more 1, more 2
    > > data2: more 3"
    > > i.e., all <a> tags with the same contents grouped into one
    > > output item.

    >
    > XSLT FAQ. Grouping problems. GIYF.


    Google *is* my friend, but it's a very reticent one. The XSLT faq on usenet.faqs
    is pretty worthless -- it took me a while to sort out the exact terms to look
    for, although 'grouping' did find a lot more than my pseudo-SQL notation :)
    For future reference: it's called the "Muench method":
    <q>The Muenchian technique is a grouping method discovered by Steve Muench</q>
    (No apparent relation to the Scream painter.) Anyhoo, thanks for nudging me in
    the proper direction; I got it working.

    [Jw]
     
    [Jongware], May 24, 2007
    #3
  4. On May 25, 12:36 am, "[Jongware]" <> wrote:
    > For future reference: it's called the "Muench method":
    > <q>The Muenchian technique is a grouping method discovered by Steve Muench</q>
    > (No apparent relation to the Scream painter.)


    The painter's name is not quite identical, though: it's Munch.
     
    Arndt Jonasson, May 25, 2007
    #4
  5. [Jongware]

    [Jongware] Guest

    "Arndt Jonasson" <> wrote in message
    news:...
    > On May 25, 12:36 am, "[Jongware]" <> wrote:
    > > For future reference: it's called the "Muench method":
    > > <q>The Muenchian technique is a grouping method discovered by Steve

    Muench</q>
    > > (No apparent relation to the Scream painter.)

    >
    > The painter's name is not quite identical, though: it's Munch.


    Sorry, musta had a bad case of the umlauts. You must be Swedish as well.

    .... (silence)

    Oops--just joking! -- Norvegian!
     
    [Jongware], May 25, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    3,613
    A. Bolmarcich
    May 27, 2005
  2. Alan Silver
    Replies:
    0
    Views:
    889
    Alan Silver
    Jun 5, 2006
  3. googleboy
    Replies:
    1
    Views:
    929
    Benji York
    Oct 1, 2005
  4. Replies:
    2
    Views:
    9,279
    Martin Honnen
    Sep 5, 2006
  5. palmiere
    Replies:
    1
    Views:
    413
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page