[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Conditional sort instruction as parameter within

Subject: Re: Conditional sort instruction as parameter within group && Syntactic matter of multilevel grouping | XSLT 2.0 | P2
From: "Fiona Chen anonymousjuly1@xxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 6 Jun 2021 22:40:48 -0000
Re:  Conditional sort instruction as parameter within
 The desired result is simple as:B 

<Incarnation>
B B  <Trade>
B B B B B  <Justification>
B B B B B B B B 
<path>fn:doc('/b.xml')//*:putCurrencyAmount/*:currency</path>
B B B B B B B B  <highlight>USD</highlight>
B B B B B B B B  <path>fn:doc('/b.xml')//*:putCurrencyAmount/*:amount</path>
B B B B B B B B  <highlight>38500000</highlight>
B B B B B  </Justification>
B B  </Trade>B B  <Trade>
B B B B B  <Justification>
B B B B B B B B 
<path>fn:doc('/a.xml')//*:putCurrencyAmount/*:currency</path>
B B B B B B B B  <highlight>USD</highlight>
B B B B B B B B  <path>fn:doc('/a.xml')//*:putCurrencyAmount/*:amount</path>
B B B B B B B B  <highlight>26000000</highlight>
B B B B B  </Justification>
B B  </Trade></Incarnation>

Let's put the document content incarnation aside for the moment and focus on
how to get the search:response sort on the  decimal value
@<search:highlight>.B 
This is my working module written in MarkLogic Java, XQuery and XSLT 2.0 API.
But sort is not working in Oxygen without ML:
B B B  <xsl:template match="response">
B B B B B B B  <xsl:element name="Incarnation">
B B B B B B B B B B B  <xsl:element name="Rationale"><xsl:value-of
select="$rationale"/></xsl:element>
B B B B B B B B B B B  <xsl:element name="total"><xsl:value-of
select="@total"/></xsl:element>
B B B B B B B B B B B  <xsl:choose>
B B B B B B B B B B B B B B B  <xsl:when test="xs:integer(@total) eq 0">
B B B B B B B B B B B B B B B B B B B  <xsl:element name="message">No matching
document found.</xsl:element>
B B B B B B B B B B B B B B B  </xsl:when>
B B B B B B B B B B B B B B B  <xsl:otherwise>
B B B B B B B B B B B B B B B B B B B  <xsl:element name="Rendition">
B B B B B B B B B B B B B B B B B B B B B B B  <xsl:apply-templates
select="result"/>
B B B B B B B B B B B B B B B B B B B  </xsl:element>
B B B B B B B B B B B B B B B  </xsl:otherwise>
B B B B B B B B B B B  </xsl:choose>
B B B B B B B  </xsl:element>
B B B  </xsl:template>

B B B  <xsl:template match="result">
B B B B B B  <xsl:variable name="doc" select="document(@uri)"/>
B B B B B B B  <xsl:element name="Trade">
B B B B B B B B B B B  <xsl:element name="documentId"><xsl:value-of
select="$doc/product:requestProduct/product:_metaData/product:docId"/></xsl:e
lement>
B B B B B B B B B B B  <Justification>
B B B B B B B B B B B B B B B  <xsl:for-each select="descendant::match">
B B B B B B B B B B B B B B B B B B B  <path><xsl:value-of
select="@path"/></path>
B B B B B B B B B B B B B B B B B B B  <highlight><xsl:value-of
select="highlight"/></highlight>
B B B B B B B B B B B B B B B  </xsl:for-each>
B B B B B B B B B B B  </Justification>
<!--B  ML failed here::
B B B B B B B  <xsl:for-each-group select="." group-by="@uri">
B B B B B B B B B B B B B B B  <Justification
inDocument="current-grouping-key()">
B B B B B B B B B B B B B B B B B B B  <xsl:for-each-group
select="current-group()" group-by="search:snippet">
B B B B B B B B B B B B B B B B B B B B B B B  <xsl:for-each
select="descendant::search:match">
B B B B B B B B B B B B B B B B B B B B B B B B B B B  <path><xsl:value-of
select="@path"/></path>
B B B B B B B B B B B B B B B B B B B B B B B B B B B 
<highlight><xsl:value-of select="search:highlight"/></highlight>
B B B B B B B B B B B B B B B B B B B B B B B  </xsl:for-each>
B B B B B B B B B B B B B B B B B B B  </xsl:for-each-group>
B B B B B B B B B B B B B B B  </Justification>
B B B B B B B B B B B  </xsl:for-each-group>B B B  -->
B B B B B B B B B B B  <xsl:copy-of
select="incarnation:render-def(fn:normalize-space(@uri))"/>
B B B B B B B  </xsl:element>
B B B  </xsl:template>

B B B  <xsl:template match="node()|@*"/>
So how can I get the sort on decimal value @"search:highlight" work?

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.