Altova Mailing List Archives


Re: [xsl] () eq () vs () = ()

From: Andrew Welch <andrew.j.welch@-----.--->
To: xsl-list@-----.------------.---
Date: 9/30/2011 1:58:00 PM
>> So, now that () and () are the same, why does () eq () not return true?
>
> Because eq is in the set of "value comparisons" and there are no values to
> operate on, thus, no items in either sequence are equal.  Functions 3.5.1
> says "Value comparisons are used for comparing single values".

Ok, that makes sense.  Like =, there is no value in either sequence to
compare, so you cant return true.

> Note that you ask "why not true()?", but the return from eq with an empty
> sequence operand isn't false().  Rather it is () as if to say "there are no
> comparisons returned from this expression".

So for me that would be more helpful/consistent if it returned false.
Do you know of a use-case where returning () is needed?

> Converting that to Boolean is
> false(), but the return itself isn't false().

Only using boolean(), using xs:boolean() is an error.

> With either operand as
> the empty set you are getting a value comparison response of "no response"
> with ().  An empty response.

Yeah, again, I can't see why anyone would want that instead of false.

> I think David said it the best and wish I'd thought of saying it that way
> myself!

This is all good stuff... I'm actually in the middle of writing
something xslt related and this will feature in the gotchas section.
I promise to give credits (at the back, in a very small font).  Time
for a pint in the sun.


-- 
Andrew Welch
http://andrewjwelch.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@l...>
--~--

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.