How to sort XML by multiple elements using XSLT?
By adding more
<xsl:sort> will sort the output by the first and then by the second element specified. Identical elements are sorted in the order they appear in an XML document.
<xsl:sort select="title" />
<xsl:sort select="publisher" />
Output:
Title
An Introduction to NURBS: With Historical Perspective
Curves and Surfaces for CAGD: A Practical Guide
NURBS: From Projective Geometry to Practical Use
OpenGL Programming Guide Fourth Edition
Publisher
Academic Press
Academic Press
A K Peters
Addison-Wesley
Back to
XML FAQ