[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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?
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|