Click to See Complete Forum and Search --> : test if a tag contains data


tyris
July 13th, 2001, 09:57 AM
hi all
i do have a xml structure this way :

<results dbname="Sales & Marketings">
<searchview name="AllDocs">
<result>
<url>http://etc</url>
<icon>171</icon>
<description>abcdef</description>
</result>
<result>
<url>http://etc</url>
<icon></icon>
<description>jaehdeg</description>
</result>
<result>
<url>http://etc</url>
<icon></icon>
<description>adhthsdgz</description>
</result>
</searchview>
</results>


what i want is :
if in a the icon tag is empty, put the description in bold, else do not put the description in bold and put the icon url.
well in fact i just want to know how could i expres this :
"if icon is empty do this, else do this" in xslt ?

my namespace is http://www.w3.org/1999/XSL/Transform" (MS XSL 3)

regards ;-)

elise

tyris
July 13th, 2001, 10:39 AM
i forgot one precision :

the test is harder :

if ALL icons are empty do this, else do this"


regards ;-)

elise

tyris
July 13th, 2001, 11:10 AM
i have a beginning of idea..
i guess i must use :
<xsl:for-each select="icon">
<xsl:choose>
<xsl:when test="{.} != '[empty test ]'">
....
</xsl:when>
<xsl:otherwise>
<b>ghfj</b>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>


the things i don't know how to do are :

1.the empty test of the icon tag
2.the ALL test (is ALL icon tags are empty then... else ...)

regards ;-)

elise