I have an XML file that attaches an xsl stylesheet using version that has sorting function at the beginning of the file. At the same time, eason, I would like to put in some other information in the beginning, such as html headers as well.
Here is my code:

<xsl:template match="/">

<xsl:apply-templates select="music_songs/song">
<xsl:sort select="title"/>
<xsl:sort select="category"/>
<xsl:sort select="artist"/>

<title>My Page</title>
<link rel="stylesheet" href="css/cd_collection.css" type="text/css"/>
<!--[if IE]><link href="css/ie.css" rel="stylesheet" type="text/css"/><![endif]-->
<div id="main">
<h1>My Music List</h1>
<table class="songs">
<th width="35%">Title</th>
<th width="25%">Album</th>
<th width="20%">Artist</th>
<th width="20%">Date</th>

The xsl is applied properly regarding sorting on xml elements, but none of the html documentation I tried to apply are displayed on the page when I opened it with my browser. Could anyone on the list please guide me on what problem I may have here?

Thanks for your help.

6 Years
Discussion Span
Last Post by ajwei810192

I got it figured out after fiddling around XSLT W3 Schools TryIt editor.

Got to do something like this:

<xsl:apply-templates select="music_songs/song">
                      <xsl:sort select="title"/>
                      <xsl:sort select="artist"/>

Then it would work.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.