RE: [xsl] test if null

Subject: RE: [xsl] test if null
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 27 Jun 2005 10:46:02 +0100
> How would i test if a node is null?

There's no such thing as "null" in the data model, you'll have to explain
more precisely what condition you want to test. The usual way in XML to
represent absent data is with an absent element: you seem to be testing for
an element that is present but has empty content.

> like i have this empty node <EMPTYNODE />
> <xsl:when test="EMPTYNODE[.!= '']">
> 
> is not working.

You are testing whether the context item has a child named EMPTYNODE whose
content is something other than the zero-length string. If this "isn't
working" then you'll have to describe the context in which you are using it.

Michael Kay
http://www.saxonica.com/

Current Thread