These stylesheets demonstrate several variations of filtering and sorting XML data.
| Stylesheet |
Description |
Files |
| ConcatDDMMYYYY |
This stylesheet demonstrates how to use string functions to sort date values. As you might know, there is no built in date sorting in XSL. In this example, we are using substring and concatenation functions to elements in order or Day, Month, Year |
Output XSL File XML File Download this sample
|
| |
|
|
| ConcatHHMMSSAP |
This stylesheet demonstrates how to use string functions to sort date/time values. As you might know, there is no built in "time" sorting in XSL. In this example, we are using substring and concatenation functions to sort elements in order of Hour, Minute, Second, AM/PM |
Output XSL File XML File Download this sample
|
| |
|
|
| ConcatMMDDYYYY |
This stylesheet demonstrates how to use string functions to sort date/time values. As you might know, there is no built in date sorting in XSL. In this example, we are using substring and concatenation functions to sort elements in order of Month, Day and Year (a very common sorting requirement) |
Output XSL File XML File Download this sample
|
| |
|
|
| DrinkParams |
This stylesheet demonstrates filtering records based on a value passed in as a parameter. In this example, we are extracting only the records that match the parameter passed in. |
Output XSL File XML File Download this sample
|
| |
|
|
| DrinksSorted |
This stylesheet demonstrates parameter based sorting. In this example, both the sort order and sort field are passed in as parameters. Note: This is not as easy as it might appear on the surface and is one of the most common XSL requirements. |
Output XSL File XML File Download this sample
|
| |
|
|
| SubstringDDMMYYYY |
This stylesheet demonstrates how to use the substring function to sort a date. In this example, we are using a 3 part sort key for month, day and year. Since we are breaking it into 3 sections, we can easily control the order (ascending or descending) for each part of our date. In this example, we are sorting by Day, Month, Year |
Output XSL File XML File Download this sample
|
| |
|
|
| SubstringHHMMSSAP |
This stylesheet demonstrates how to use the substring function to sort elements by time. In this example, we are using a 4 part sort key for hours, minutes, seconds and am/pm Since we are breaking it into 4 sections, we can easily control the order (ascending or descending)for each part of our time. In this example, we are sorting by Hours, Minutes, Seconds and am/pm. |
Output XSL File XML File Download this sample
|
| |
|
|
| SubstringMMDDYYYY |
This stylesheet demonstrates how to use the substring function to sort a date. In this example, we are using a 3 part sort key for month, day and year. Since we are breaking it into 3 sections, we can easily control the order (ascending or descending)for each part of our date. In this example, we are sorting by Month, Day, Year |
Output XSL File XML File Download this sample
|
| |
|
|
| SubstringYYYYMMDD |
This stylesheet demonstrates how to use the date field by itself (without conversion) to sort a date. In this example it is possible since the date is already in ISO format. Having the date in this format to begin with will allow the normal sorting to behave alphabetically and respect the order of the input dates. |
Output XSL File XML File Download this sample
|
| |
|
|