I am trying to extract the forecast data from XML file to my XSLT 1.0.
I am new to these language, so I am using same lines of code multiple times. The difference in given code is only attribute @aac on for-each loop.
<xsl:for-each select="product/forecast/area[@aac='SA_PT001']">
<xsl:value-of select="@description" /> :
<xsl:value-of select="forecast-period/text[@type='precis']"/> : Min
<xsl:value-of select="forecast-period/element[@type='air_temperature_minimum']"/> : Max
<xsl:value-of select="forecast-period/element[@type='air_temperature_maximum']"/><br/>
</xsl:for-each>
<xsl:for-each select="product/forecast/area[@aac='QLD_PT015']">
<xsl:value-of select="@description" /> :
<xsl:value-of select="forecast-period/text[@type='precis']"/> : Min
<xsl:value-of select="forecast-period/element[@type='air_temperature_minimum']"/> : Max
<xsl:value-of select="forecast-period/element[@type='air_temperature_maximum']"/><br/>
</xsl:for-each>
<xsl:for-each select="product/forecast/area[@aac='NSW_PT027']">
<xsl:value-of select="@description" /> :
<xsl:value-of select="forecast-period/text[@type='precis']"/> : Min
<xsl:value-of select="forecast-period/element[@type='air_temperature_minimum']"/> : Max
<xsl:value-of select="forecast-period/element[@type='air_temperature_maximum']"/><br/>
</xsl:for-each>
can you give me idea to use loop or XSL template to reduce the code size?
aac_listvariable you can build dynamically