Subject: [xsl] RE: alternating node type in a loop From: Dimitre Novatchev <dnovatchev@xxxxxxxxx> Date: Sat, 13 Jul 2002 03:12:22 -0700 (PDT) |
--- "McNally, David" <David dot McNally at moodys dot com> wrote: > > If I understand you correctly, this should do it: > > <xsl:apply-templates select="article"> > <xsl:sort > select="concat(count(preceding-sibling::article[@type=current()/@type]),'::' > ,@type)"/> > </xsl:apply-templates> > > which will process the first article of type 1, then the first of > type > 2 > (and potentially the first of type 3), then move on to the second of > each > type, etc. Hi David, I want to congratulate you for this ellegant solution. Just a minor remark: in case there are many different values for the "type" attribute, it would be necessary to split the xsl:sort instruction into two, each specifying data-type="number". This is necessary, because when sorted as text "10" comes before "2". > > Note that an old version of MSXML that is in my copy of XMLSpy didn't > process this correctly, but Saxon 6.5.2 did. Actually, the buggy processor is MSXML4, MSXML3 produces the correct result. ===== Cheers, Dimitre Novatchev. http://fxsl.sourceforge.net/ -- the home of FXSL __________________________________________________ Do You Yahoo!? Yahoo! Autos - Get free new car price quotes http://autos.yahoo.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: alternating node type in , Dimitre Novatchev | Thread | RE: [xsl] RE: alternating node type, McNally, David |
[xsl] Encription problem, Sachidanandam E K | Date | RE: [xsl] Encription problem, Julian Reschke |
Month |