Join Joe Marini for an in-depth discussion in this video Sorting XML data with XSLT, part of XML Essential Training.
…Okay, let's wrap up by seeing how we can use XSLT to sort the incoming XML data.…So here in the snippets, I've scrolled down to the Sorting XML Data section.…And I'm going to open up sorting.xml and sorting.xslt.…Now, the sorting.xml file is the same one that we've been using in this chapter.…It's the items with…the, you know, various coffee and tea items.…And you can see here in the sorting XSLT…stylesheet, I've already got a for-each tag inside my template.…
And I've left the xsl:choose construct from the…previous example in place to apply some styling.…Now all we need to do to sort the data…in the collection we're interested in is use the xsl:sort tag.…So in the snippets, let's copy this line, and let's put into the stylesheet…right here at the top of the for-each statement, paste there.…So now, you can see that each one of these…tags has an available attribute, and that's what we're sorting on.…
So we're sorting on the available attribute, and…we're going to do descending order to begin with.…So let's save, and let's go out to the file system.…
- What is XML?
- The advantages and drawbacks of XML
- Proper XML syntax
- Working with namespaces
- Styling XML tags with CSS
- Extracting and manipulating data
- Taking XPath and XSLT for a spin
- Creating document type definitions and schema definitions
Skill Level Beginner
1. Getting Started
2. How Developers Use XML
Real-world examples of XML6m 21s
3. Basic Rules of XML
4. Starting to Work with XML
5. Using the DOM to Manipulate XML
6. XML and XPath
7. XML and XSLT
8. XSLT Examples
9. Creating Document Type Definitions (DTDs)
10. Creating XML Schema Definitions
- 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.