|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Using xsl:if to determine if a node is empty.
Roger,
> I am trying to determine if a node is empty so that
> I can print a line or not. I have tried several different variations of
> template matching and xsl:if statements and have not been able to get
> anywhere.
>
> Here is the latest thing that I have tried which seems to match evertime
> through so the text is coming out even on empty tags.
>
> <xsl:template match="VENDOR_ITEM_NUM">
> <xsl:variable name="empty_tag"></xsl:variable>
> <tr>
> <td></td>
> <td>
> <font size="2">
> <xsl:if test="$empty_tag != .">
empty_tag is an empty node-set, while . is one node: self::node()
resp. VENDOR_ITEM_NUM.
So the test is always true.
> <xsl:value-of select="concat('Vendor Item number:
> ',.)"/>
> </xsl:if>
> </font>
> </td>
> </tr>
> </xsl:template>
Have a look at the FAQ to get some clues:
http://www.dpawson.freeserve.co.uk/xsl/N3328.html
Cheers,
Oliver
/-------------------------------------------------------------------\
| ob|do Dipl.Inf. Oliver Becker |
| --+-- E-Mail: obecker@xxxxxxxxxxxxxxxxxxxxxxx |
| op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








