Join Joe Marini for an in-depth discussion in this video Sorting data, part of XML Essential Training.
- [Instructor] Let's wrap up this chapter…by seeing how we can use xslt…to apply sorting to the incoming XML data.…I'm going to open up sorting.xml and sorting.xslt.…The sorting.xml file is the same one…we've been using in this chapter,…and you can see here in the sorting xsl:stylesheet…I've already got a for each tag inside my template,…and I've left the xsl:choose construct…from the previous exercise in place…to apply some styling to the items in the XML.…
So all we need to do to sort the data…in the collection we're interested in…is to use the xsl:sort tag,…so I'm going to add that right below the for each tag.…So I'll add xsl:sort,…and then xsl:sort takes two attributes.…The first is the select,…so I need to select the tag…or attribute that I'm sorting on.…In this case, I'm going to sort on the available attribute,…and then I need to specify the order,…and in this case I'll use descending order.…
All right, so that's pretty much all I need to do,…so let's open this in the browser…and see what this looks like.…
- What is XML?
- Advantages and drawbacks of XML
- Proper XML syntax
- Working with XML namespaces
- Styling XML tags
- Discovering and creating document content
- Manipulating XML content using XPath and XSLT
- Document type definitions and XML schema
Skill Level Beginner
1. Getting Started
2. XML Overview
3. Working with XML
4. Manipulating XML with the DOM
5. XML and XPath
6. XML and XSLT
7. XSLT Examples
8. Document Type Definitions
9. XML Schema
Next steps1m 4s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.