XSL For Each - Path



I have a XML file looks like below



- <alert>
- <adv_details>
<type>Primary Type</type>
<name>Some Name</name>
<id>ID Num</id>
<adv_details>
.....
<alert>


My XSL looks like this



<fo:flow flow-name="xsl-region-body">
<xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
<fo:block>
<xsl:for-each select="//alert">
<xsl:call-template name="alert_details">
<xsl:with-param name="xmlSection" select="./alert_details"/>
</xsl:call-template>
......


Then I try to reach each value of the element inside the node <adv_details>. First I declare this template name <xsl:template name="alert_details">and the whole code is



<xsl:template name="alert_details">
<fo:table>
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block >
<xsl:value-of select="./@type"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block >
<xsl:value-of select="./@name"/>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block >
<xsl:value-of select="./id"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>


It doesn't show the values! I thought it is a right way. first, I have for-each select="//alert, then I have <xsl:with-param name="xmlSection" select="./alert_details"/> and lastly, I select each node inside alert_details, but somehow the values don't show up.


Please help.


No comments:

Post a Comment