xsl-list
[Top] [All Lists]

Re: Grouping

2005-12-07 02:58:08
Hi again,

          I  take back my previous post as I don't see where I am wrong.
The muenchian grouping is not required for the answers and only for the
questions that too only if the OP is prticular about it.

Otherwise, my code should work fine.

Yes, your solution would work fine on the input given by the OP (is OP
for Original Poster?). My point was that if the question_id's where
not ordered, then I think that your answer would not work, for
example:

<recordset>
    <row>
       <question_id>1</question_id>
       <answer>1: blah blah blah...</answer>
    </row>
    <row>
       <question_id>2</question_id>
       <answer>2: blah blah blah...</answer>
    </row>
    <row>
       <question_id>1</question_id>
       <answer>3: blah blah blah...</answer>
    </row>
    <row>
       <question_id>2</question_id>
       <answer>4: blah blah blah...</answer>
    </row>
    ...etc...
</recordset>

And now that I think about it, would:
<xsl:value-of select="key('rec', question_id)/answer"/>
not give only the first row/answer element with a given question_id,
no matter the current row element?

As I said, if I am wrong in my assumptions on how the language work, I
would be grateful for clarification.

Regards,
Ragulf Pickaxe :-)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>