I'm reviewing an xsl document which has the following:
<xsl:template match="myerson">
<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="myerson" means to substitute this template where xsl:apply-templates for myerson 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
<xsl:template match="myerson">
<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="myerson" means to substitute this template where xsl:apply-templates for myerson 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