This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Determining if an element exists within any tag of a specifiedname...
- From: Joerg Heinicke <joerg dot heinicke at gmx dot de>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Thu, 06 Jun 2002 20:26:32 +0200
- Subject: Re: [xsl] Determining if an element exists within any tag of a specifiedname...
- References: <200206061214.g56CEkR20552@fes.uwaterloo.ca>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hello Michael,
I must say that I don't know nothing about WD-XSL. I only can guess,
what the old version does and how you can replace it with the new one:
<xsl:for-each select="attr[attrlabl != '']">
<tr>
<td>
<font color="#000000" face="Arial, Helvetica, sans-serif" size="2">
<xsl:value-of select="attrtype"/>
<xsl:if test="not(normalize-space(attrtype))">---</xsl:if>
</font>
</td>
<td>
<font color="#000000" face="Arial, Helvetica, sans-serif" size="2">
<xsl:value-of select="atoutwid"/>
<xsl:if test="not(normalize-space(atoutwid))">---</xsl:if>
</font>
</td>
</tr>
</xsl:for-each>
Does this do the job? It should do the same, if you have only one
'attrtype' or onr 'atoutwid'. If there are more of them, the code must
be changed a bit. Ask for it ;-)
Regards,
Joerg
<xsl:for-each select="attr[attrlabl != '']">
<tr>
....
<xsl:choose>
<!-- Write the attrtype property if it is defined. -->
<xsl:when test="current()[(attrtype !='')]"> <xsl:for-each select="attrtype">
<td><font color="#000000" face="Arial, Helvetica, sans-serif"
size="2"><xsl:value-of select="."/></font></td>
</xsl:for-each> </xsl:when> <xsl:otherwise>
<!-- If the property was not defined, yet the table has the heading "Type"
because some other
attribute in the currently selected tag ("current()") has this property
defined, then write out
three dashes in the table cell-->
<xsl:if test="..[($any$ attr/attrtype != '')]">
<td><font color="#000000" face="Arial, Helvetica, sans-serif" size="2">---
</font></td>
</xsl:if> </xsl:otherwise> </xsl:choose>
<!-- Write the atoutwid property-->
<xsl:choose> <xsl:when test="current()[(atoutwid != '')]"> <xsl:for-each
select="atoutwid">
<td><font color="#000000" face="Arial, Helvetica, sans-serif"
size="2"><xsl:value-of select="."/></font></td>
</xsl:for-each> </xsl:when> <xsl:otherwise> <xsl:if test="..[($any$
attr/atoutwid != '')]">
<td><font color="#000000" face="Arial, Helvetica, sans-serif" size="2">---
</font></td>
</xsl:if> </xsl:otherwise> </xsl:choose>
....code repeated for all required properties
</tr>
</xsl:for-each>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list