Re: [xslt] XML_DOCUMENT_NODE and boolean testing

On Thu, Jul 10, 2008 at 06:22:27PM -0400, Phil Shafer wrote:
> If I call a template that doesn't return anything, should
> the result (when type converted to boolean) be false?

  Answer is here

  a node-set is true if and only if it is non-empty
> I call a template and assign the returned RTF to a variable.  If I
> test this variable, it's always true, even if the contents are
> empty.  The same behavior when I use ext:node-set() to turn the RTF
> into a node-set.
> Looks like the variable gets a node set with one member, a "fake
> node libxslt" with type set to XML_DOCUMENT_NODE.  This node
> has no children.  If I pass the variable to an extension function,
> I see this:

  maybe it's a bug, yes.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]