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

Re: Sorting Issue

Subject: Re: Sorting Issue
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 6 Sep 2000 17:39:48 -0600 (MDT)
ms xmldom sort param
Jon Wynacht wrote:
> http://www.switchlight2239.com/temp/vtreport_sort.txt
> PS - I'm using the old namespace because I'm using the old parser (v0185)

Good thing you said this. I was about to comment on it. :)

> I declare an xsl:param at the top of the page and set it to 1; this would
> normally get set by a servlet, but for development I'm just setting it
> manually.

Looks fine. You're setting it to default to a result tree fragment
containing a root node and a text node, but this shouldn't matter when you
compare it to the number 1; it will be interpreted like
<xsl:if test="number($sort) = 1">

> My second template matches PXML and test for the value of $sort, the param,
> and applies the other template and sorts it all by Title.

Without seeing your XML, it's hard to say. The way you have it written in
the part that' snot commented out, you're saying to go process the child
nodes of the PXML element, in order dictated by *their* child elements
named Title. It implies that you have

 <PXML>
   <something> <!-- the things you are sorting = something -->
     <Title>foo</Title>
   </something>
   <something>
     <Title>bar</Title>
   </something>
   ...
 </PXML>

In the template that matches "/*" (the document element) you are saying to
process the child elements, and if you uncomment that xsl:sort, you'll
ensure that it's done in order by their child elements named Title. Again,
it implies that the nodes you are applying the sort to have child elements
named Title.

Is this really the case?

Also, no need to use choose/when if there's only one condition; use if.
Although you might want to keep it there and throw in an xsl:otherwise so
you can see if the test is failing.


   - Mike
____________________________________________________________________
Mike J. Brown, software engineer at         My XML/XSL resources:
webb.net in Denver, Colorado, USA           http://www.skew.org/xml/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.