This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RE: What is the correct behaviour of vendor:node-set($x) when x is empty?


> > I cannot reply anything definite, except that Saxon 6.5, MSXML3 and
> > MSXML4 all work OK with node-set($x), when x is the "empty
node-set"
> > (or should I say the "empty RTF" :o) ).
> 
> 
> Saxon's node-set() is a no-op when the argument is a node-set, i.e. 
> it just returns the node-set itself; so when applied to an empty
node-
> set, it returns an empty node-set.
> 
> But what exactly do you mean by an "empty RTF"? There is no such 
> thing. The construct
> 
> <xsl:variable name="x"/>
> 
> is defined to evaluate to an empty string.

Maybe something as $vrtf-Empty as defined bellow:

<xsl:variable name="vrtf-Empty">
  <xsl:copy-of select="/.."/>
</xsl:variable>


This could be an XPath expression, whose value (an empty or non-empty
node-set) depends on the values of the variables it references.

In such case, it is not obvious whether an RTF is empty or not,
therefore it would require the programmer to always test for
non-emptiness before applying the node-set() function, if an empty
argument (empty RTF) was not allowed. 

This would be ***extremely inconvenient***.


> 
> On the other hand
> 
> <xsl:variable name="y"><xsl:text/></xsl:variable>
> 
> is defined to evaluate to an RTF consisting of a root node with no 
> children.
> 
> Saxon's node-set() extension (at least in recent releases), when 
> given a boolean, number, or string as the argument, returns a node-
> set consisting of a newly-constructed root node that owns a single 
> text node holding the value of the argument, converted to a string. 
> Looking at the code, I fear that saxon:node-set($x) (with $x defined 
> as above) will give you a root node owning a zero-length text node, 
> but I think that's a buglet we can live with.

If this is a buglet, then using a "correct" processor would be
extremely inconvenient -- see the preceding explanation.

Therefore, would it be possible, ***please***, to produce a short,
one-paragraph specification for vendor:node-set(), which says that it
should also accept node-sets, including the empty one?

I regard this as a "mini-EXSLT", just covering the 
vendor:node-set() function, which is a de-facto standard, but appears
to lack a specification...

Maybe Jeni could do this and include appropriate text in EXSL, if
nobody has any objections?

Cheers,
Dimitre.

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]