P
Patrick
Hi All,
Kind of new to this. What I have below works, but I am wondering if
there is a way to make it more efficient/simpler instead of having to
write an if, tr, td, blah for each datatype. How would I simplify this?
Any thoughts are appreciated.
Thanks,
Patrick
Datatypes will be at leat 1 but could be up to 10 depending on the setup.
<datacollected>
<datatype1>ADCP Velocity Measurements</datatype1>
<datatype2>ADCP Temperature</datatype2>
<datatype3>ADCP Performance DataX</datatype3>
<datatype4>Seabird Microcat Data</datatype4>
<datatype5>WaDAR Temperature Data</datatype5>
<datatype6>Coastal Climate MET Data</datatype6>
</datacollected>
<xsl:for-each select="./datacollected"> <th align="left"
bgcolor="#28609E">Data Collected</th>
<xsl:if test="datatype1">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype1"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype2">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype2"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype3">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype3"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype4">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype4"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype5">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype5"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype6">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype6"/></td><td align="center">X</td>
</tr>
</xsl:if>
</xsl:for-each>
--
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group – USF - College of Marine Science
http://ocgweb.marine.usf.edu Phone: 727 553-3334
The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld
Kind of new to this. What I have below works, but I am wondering if
there is a way to make it more efficient/simpler instead of having to
write an if, tr, td, blah for each datatype. How would I simplify this?
Any thoughts are appreciated.
Thanks,
Patrick
Datatypes will be at leat 1 but could be up to 10 depending on the setup.
<datacollected>
<datatype1>ADCP Velocity Measurements</datatype1>
<datatype2>ADCP Temperature</datatype2>
<datatype3>ADCP Performance DataX</datatype3>
<datatype4>Seabird Microcat Data</datatype4>
<datatype5>WaDAR Temperature Data</datatype5>
<datatype6>Coastal Climate MET Data</datatype6>
</datacollected>
<xsl:for-each select="./datacollected"> <th align="left"
bgcolor="#28609E">Data Collected</th>
<xsl:if test="datatype1">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype1"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype2">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype2"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype3">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype3"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype4">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype4"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype5">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype5"/></td><td align="center">X</td>
</tr>
</xsl:if>
<xsl:if test="datatype6">
<tr>
<td class="dt" bgcolor="#92ADC8"><xsl:value-of
select="datatype6"/></td><td align="center">X</td>
</tr>
</xsl:if>
</xsl:for-each>
--
Patrick A. Smith Assistant System Administrator
Ocean Circulation Group – USF - College of Marine Science
http://ocgweb.marine.usf.edu Phone: 727 553-3334
The trouble with doing something right the first time is that nobody
appreciates how difficult it was. - La Rochefoucauld