xsl-list
[Top] [All Lists]

Re: [xsl] Conditional sort instruction as parameter within group && Syntactic matter of multilevel grouping | XSLT 2.0 | P2

2021-06-06 13:29:14
On 06.06.2021 19:34, Fiona Chen anonymousjuly1(_at_)yahoo(_dot_)ca wrote:

Question One: The conditional sort is based on the search:highlight, if
it is decimal, sort the putAmount and then incarnate the document.
Notice: The "Rationale" is that currency and amount must be paired. In
each search:snippet, the currency is one search:highlight while amount
another. I would imagine a pure XSLT conditional sort in below manner.

=====================================================
     <xsl:param name="sortAmount">
         <xsl:for-each select="highlight">
             <xsl:sort select="if (normalize-space() castable as
xs:decimal) then descending
                 else ()"/>
         </xsl:for-each>
     </xsl:param>

     <xsl:template match="result">
         <xsl:variable name="doc" select="document(@uri)"/>
         <xsl:element name="Trade">
             <xsl:for-each-group select="." group-by="@uri">

A select="." on for-each-group is an attempt to group a single element
and if the group-by="@uri" selects a single grouping key value I fail to
understand what that whole attempt is about.


Question Two: Below produces the same result by replacing Line 55 - 60
in my original XSLT module. Can someone point out if below module is
syntactically correct? (It runs fine in the Oxygen.)

         <xsl:for-each-group select="." group-by="@uri">

Same here, a single element grouped by its single @uri attribute value
simply processes that single element.
Grouping doesn't make sense on a single element with a single grouping
key, in my understanding.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--


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