Re: [xslt] XML_DOCUMENT_NODE and boolean testing
- From: Daniel Veillard <veillard redhat com>
- To: The Gnome XSLT library mailing-list <xslt gnome org>
- Subject: Re: [xslt] XML_DOCUMENT_NODE and boolean testing
- Date: Fri, 11 Jul 2008 03:51:03 -0400
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
http://www.w3.org/TR/xpath#booleans
http://www.w3.org/TR/xpath#function-boolean
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.
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]