xsl:for-each (beginner question)

wxdqz

New Member
I'm reviewing an xsl document which has the following:

<xsl:template match="my:Person">
<tr>
<xsl:for-each select="*">
<td><xsl:value-of select="."/></td>
</xsl:for-each>

<xsl:for-each select="@*">
<td><xsl:value-of select="."/></td>
</xsl:for-each>
</tr>
</xsl:template>I've figured out that match="my:Person" means to substitute this template where xsl:apply-templates for my:Person appears.

Also, it seems that the xsl:for-each means to apply this bit of HTML for each occurrence of Person in the XML file. (How am I doing so far?)

But why are there two for-each? What is the difference between select="*" and select="@*"? Also, what does value-of select="." mean?

Thanks.
-Jeff
 
Back
Top