Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2007, 09:35 AM
Authorized User
 
Join Date: Jan 2006
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default sort - some fixes in my previous Q

hello

I am trying to feel according to an attribute name dbcolumn and I want to sort the response according to other attribute name order.
input file:
<entities>
    <entity eid="A" tid="501" plural-tid="502" grouping-tid="503" plural-grouping-tid="504" length="256">
        <display mandatory="yes" order="11"></display>
        <data class="activity" type="varchar" dbcolumn="SERVICE_ID" mandatory="yes" last-summary="all" collection-id="service-id"></data>
    </entity>
    <entity eid="Q" tid="511" plural-tid="512" grouping-tid="513" plural-grouping-tid="514" length="256">
        <display mandatory="no" order="31"></display>
        <data class="user-defined" type="varchar" dbcolumn="HANDLER_TYPE" mandatory="no" last-summary="all" collection-id="handler-type"></data>
    </entity>
    <entity eid="C" tid="521" plural-tid="522" grouping-tid="523" plural-grouping-tid="524" length="256">
        <display mandatory="no" order="22"></display>
        <data class="user-defined" type="varchar" dbcolumn="CLASS_NAME" mandatory="no" last-summary="all" collection-id="class-name"></data>
    </entity>
    <entity eid="D" tid="531" plural-tid="532" grouping-tid="533" plural-grouping-tid="534" length="256">
        <display mandatory="no" order="14"></display>
        <data class="user-defined" type="varchar" dbcolumn="COMMAND_LINE" mandatory="no" last-summary="all" collection-id="command-line"></data>
    </entity>
    <entity eid="F" tid="551" plural-tid="552" grouping-tid="553" plural-grouping-tid="554" length="256">
        <display mandatory="no" order="5"></display>
        <data class="user-defined" type="varchar" dbcolumn="SERVER_PRODUCT" mandatory="no" last-summary="all" collection-id="server-product"></data>
    </entity>
</entities>

xsl file that is working now

<case v2="">
<xsl:for-each select = "@dbcolumn">
<xsl:call-template name="apptier-graphs">
    <xsl:with-param name="v1" select="concat('!~isGraphEnabled.', @dbcolumn, '!~')"/>
    <xsl:with-param name="node" select="concat('/entity[@key=', $apos, 'common', $apos, ']/graphs/graph[@key=', $apos, @dbcolumn, $apos, ']')"/>
</xsl:call-template>
</xsl:for-each>
</case>

out put now:

<select v1="!~isGraphEnabled.SERVICE_ID!~">
  <case v2="true">
   <include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='SERVICE_ID']"/>
  </case>
</select>
<select v1="!~isGraphEnabled.HANDLER_TYPE!~">
  <case v2="true">
   <include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='HANDLER_TYPE']"/>
  </case>
</select>
<select v1="!~isGraphEnabled.CLASS_NAME!~">
  <case v2="true">
   <include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='CLASS_NAME']"/>
  </case>
</select>
<select v1="!~isGraphEnabled.COMMAND_LINE!~">
  <case v2="true">
   <include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='COMMAND_LINE']"/>
  </case>
</select>
<select v1="!~isGraphEnabled.SERVER_PRODUCT!~">
  <case v2="true">
   <include import="this-I3-entity" node="/entity[@key='common']/graphs/graph[@key='SERVER_PRODUCT']"/>
  </case>
</select>

I would like to know how can I make the output sorted by the order attribute that I have in the input file?

I tried to use
<xsl:sort data-type="number" select="/etd/*/entity/display/@order"/>
but I believe that something is missing.
need help

thanks







Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 16 Try It Out doesn' t work + Fixes VictorVictor BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 3 December 12th, 2007 10:04 AM
Chapter 10 fixes .MAttButler BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X 2 September 3rd, 2006 08:02 PM
how to sort cross tab.sort based on row total joxa83 Crystal Reports 7 March 2nd, 2006 09:12 AM
Hot Fixes to Patches Walden SQL Server 2000 2 September 16th, 2003 12:48 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.