<xsl:template match="/">
means:: The <xsl:template> element defines a template. The match="/" attribute associates the template with the root of the XML source document.
<xsl:value-of>
The <xsl:value-of> element can be used to extract the value of an XML element and add it to the output stream of the transformation:
<xsl:for-each>
The XSL <xsl:for-each> element can be used to select every XML element of a specified node-set:
<xsl:sort>
To sort the output, simply add an <xsl:sort> element inside the <xsl:for-each> element in the XSL file:
<xsl:if>
To add a conditional test, add the <xsl:if> element inside the <xsl:for-each> element in the XSL file:
<xsl:choose>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="title"/></td>
<xsl:choose>
<xsl:when test="price > 10">
<td bgcolor="#ff00ff">
<xsl:value-of select="artist"/></td>
</xsl:when>
<xsl:otherwise>
<td><xsl:value-of select="artist"/></td>
</xsl:otherwise>
</xsl:choose>
</tr>
</xsl:for-each>
1) $dvt_1_automode = "1" OR $dvt_1_automode = "0" -> This is a variable which is used to switch modes in a DVWP, usually between display and edit. SharePoint Designer creates this variable.
2) "position() mod 2 =1" -> position() returns the current item's position in the rowset. So if the item is number 7 of 312, position() returns 7. Used here to determine if the row is even or odd, usually for alternating row formatting using the ms-alternating CSS class.
3) <xsl:param name ="dvt_apos"> -> This parameter is usually created by SharePoint Designer in DVWPs to provide the ' or apostrophe (') character for use in the XSL. Because of the highly reserved nature of this character, it can be a bear to work with, and this way you have a parameter containing it to use.
4) ddwrt:cf_ignore ="1" -> I've never figured out what this function is for. The only documentation I know of that's worth anything is from Serge van den Oever: http://msdn.microsoft.com/en-us/library/dd583143(office.11).aspx and this function is not described there.
5) <xmsln:ddwrt2="urn:frontpage:internal"> -> Another one I'm not sure of, but this is a declaration of the ddwrt2 namespace (also undocumented, as far as I can determine).
<xsl:with-param>
元素定义了传递给模板的参数的值。