This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Conditional output for empty node value
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] Conditional output for empty node value
- From: "Michael Kay" <mhkay at iclway dot co dot uk>
- Date: Mon, 5 Feb 2001 17:19:34 -0000
- Reply-To: xsl-list at lists dot mulberrytech dot com
> I have a basic problem I am using a xalan parser and not able to put a
> condition for empty node in my xsl.
You can test whether the current node has children by writing
test="node()"
You can test whether its string-value is non-empty by writing
test="string(.)"
Which test you use depends on how you want to handle comments, etc,
appearing within the element.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list