Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

NOT equal to

Status
Not open for further replies.

divinyl

IS-IT--Management
Nov 2, 2001
163
GB
Hi all,

I need to do a "not equal to" test within my XSLT file. Basically I am pulling fields from a database and showing them in the HTML output like this:

<xsl:value-of select="TM_PROJECT.TITLE"/>

Just as an example, I want to a test to find out whether the value of TM_PROJECT.TITLE is empty so i would think this would work:

<xsl:if test="'TM_PROJECT.TITLE'!=''"> No value </xsl:if>

It doesn't!! But then i'm a beginner so...that's quite normal. Can someone please point out how to do this?? Thanks!

Divinyl

 

Hi Divinyl,

I'm pretty new to XML, but I have a similar XSL, set up as you have, I think you may have your double/single quotes a little messed up, you wrote:

<xsl:if test="'TM_PROJECT.TITLE'!=''"> No value </xsl:if>

Try this:

<xsl:if test="TM_PROJECT.TITLE !=''"> No value </xsl:if>

HTH

Thanks

Jim


 
If your XML looks like:
<TM_PROJECT>
<TITLE>abc</TITLE>
</TM_PROJECT>


Then try this...
<xsl:if test="TM_PROJECT/TITLE != '"> No value </xsl:if>

A "." typically represents the current Element...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top