RE: Scalar -> node-set conversion (was How to distinguish b/n

Subject: RE: Scalar -> node-set conversion (was How to distinguish b/n
From: David_Marston@xxxxxxxxx
Date: Mon, 6 Nov 2000 11:48:48 -0500
Dimitre Novatchev wrote:
>Anyway, it appears that there isn't a reliable way of finding whether
>a parameter is a node-set or a scalar -- it's a pity, because something
>as simple as a function (defined over a nodeset like count()) returning
>NaN for a scalar would do the job.

I'm sympathetic, but as I reviewed the possible ways to determine the
difference, I also saw that it is highly unusual for it to matter. For
example, it initially seems to matter whether the first argument to
document() is a string or node-set, but if that node-set contains a
single text node (which is what we're discussing), it turns out that it
doesn't matter.

The underlying question is whether XSLT is designed so that call-template
can be used to act upon, or provide data about, a parameter of arbitrary
type. If call-template must be used with some minimal pre-arrangement of
the type of parameters it will pass, does that really impact a real-world
use of XSLT? Sure, it's nice to be able to say "call my template with any
arbitrary param, and I'll figure out its type and act accordingly" but
that may be a luxury.

I suggest that you send a request to the W3C Working Group on XPath for
that expansion of the count() specs. It would be nice to have.
.................David Marston

 XSL-List info and archive:

Current Thread