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

RE: Sorting unsorted elements based on their attribute

Subject: RE: Sorting unsorted elements based on their attributes
From: Erika Marlow <EMarlow@xxxxxxxxxxxxxx>
Date: Wed, 4 Jun 2003 12:09:06 -0500
RE:  Sorting unsorted elements based on their attribute
Hi.

	<comments>
	<comment page="20030101">blah</comment>
	<comment page="20030207">blah</comment>
	<comment page="20011127">blah</comment>
	...etc
	</comments>

	Each <comment> element has a page attribute, which contains a date
in
	format CCYYMMDD as shown above.

	I'm trying to use a XSL stylesheet to display these, or sort them if
you prefer that wording, into a year/month/day type format.

I think you can use the substring() function in a match attribute as part of
a valid XPath expression.

substring(string, start_position, length)

<xsl:key match="comment" use="comment/substring(@page, 1, 4)" /> 

That would select the unique years.  If all of your dates are the same you
can supply start points for the parts you need.

Hope that helps.
Erika

end



------------  Gateway EDI, Inc.  ---------------------------------------------------------------------------------------------------

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.  If you are not the intended addressee, or the person responsible for delivering it to them, you may not copy, forward, disclose or otherwise use it or any part of it in any way.  To do so may be unlawful.  If you receive this email by mistake, please advise the sender immediately and destroy all copies of the original message.


 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.