Re: [xslt] math:max and node-sets



Markus Bayerlein said:
> "William M. Brack" wrote:
>> My apologies for missing your NaN test, but I assume you agree
>> with my
>> other points.
>>
>> Regards,
>>
>> Bill
>
>
> Well, I agree - almost :)
> I actually did not know that the context is important for the
> element-available function, sorry.
>
> But I'm still not so shure about what you said here:
>
>>Your description of the problem, as well as your
>>variable name, shows that you believe foo:getMaxVal is giving
>>math:max a nodeset as its argument.  This is, unfortunately, *not*
>>correct.  The variable resNodeSet, even though it "selects" a
>>node-set, is by definition a Result Tree Fragment.
>
> The XSLT spec http://www.w3.org/TR/xslt#variables (that is, XSLT
> 1.0)
> says that "if the variable-binding element has a select attribute,
> then
> the value of the attribute must be an expression and the value of
> the
> variable is the object that results from evaluating the expression."
> Well, evaluating the expression exsl:node-set($resNodes) results in
> a
> node-set (according to the EXSLT spec). Otherwise
> math:max($resNodeSet/*) would  even be and invalid expression,
> because
> (according to the XSLT spec) "it is not permitted to use the /, //,
> and
> [] operators on result tree fragments". Or do I get something wrong
> here?
>
> By the way, it is not my aim to criticize your work. Maybe my words
> sound harsher than intended (like the "another xsltproc misconduct"
> phrase). This is due to my limitations in English. I am not a native
> speaker and sometimes simply don't know how to express things
> better.
> Sorry.
>
> Markus

Well, after re-reading the spec (particulary 11.2):
"If the variable-binding element has a select attribute, then the
value of the attribute must be an expression and the value of the
variable is the object that results from evaluating the expression.
In this case, the content must be empty."
I think I must agree with you.  Furthermore, after going into the
library code, this is basically what the library does.

The apologies should be from me, not from you.

Anyway, I believe I found the problem within the library code. I
have fixed it (module libexslt/math.c) and committed the changes to
CVS.  I have also added a slightly modified version of your test
program to the regression tests (tests/exslt/math/max.3.xsl).  If
possible, please try the CVS version and see if it clears the
problem for you.

Regards,

Bill





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