[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Not Node() but string onlye

Subject: RE: [xsl] Not Node() but string onlye
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sat, 8 Jan 2005 17:14:19 -0000

> I am using this:
> <xsl:when test="not(node()) and string(.)">
> To test if a node has "No Child Nodes" but contains "String only".

If an element has no children, then its string value will always be "".

> So example:
> <!-- This should FAIL above test -->
> <mynode>
>     I hope
> </mynode>

Perhaps you are overlooking that the element <mynode> has one text node

Michael Kay

Current Thread