Re: [xsl] Is there an OR for XSL IF?

Subject: Re: [xsl] Is there an OR for XSL IF?
From: Murray McDonald <murray.mcdonald@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 09 Jan 2012 13:36:00 -0500
Michael,

Perhaps I could offer a thought on your question of why so many readers of the spec have trouble finding "and" and "or" in the documentation.

I would think most people approaching XSLT with a knowledge of "other programming languages" are going to consider "and" and "or" to be operators. The third paragraph of the XSLT 2.0 spec abstract is as follows:

XSLT 2.0 is designed to be used in conjunction with XPath 2.0, which is defined in [XPath 2.0] <#xpath20>. XSLT shares the same data model as XPath 2.0, which is defined in [Data Model] <#xpath-datamodel>, and it uses the library of functions and operators defined in [Functions and Operators] <#xpath-functions>.

If one follows the link to the Functions and Operators document one will not find any mention of "and" or "or" as operators - and come away with the mistaken impression that these operator don't exist.

Take care,

Murray



On 1/4/2012 3:13 AM, Michael Kay wrote:
On 04/01/2012 02:56, GWmbox wrote:
I have had a read through the W3C stuff for IF elements but I cannot find anything conclusive about an OR for the IF elements.

Is there in fact an option for OR, is it the | to do this. Can I have something like

See section 3.6 of the XPath 2.0 specification, "logical expressions"

http://www.w3.org/TR/xpath20/#id-logical-expressions

As an editor of the spec, I would love to understand why so many readers of the spec seem to have difficulty finding this section, or discovering that the XPath "and" and "or" operators are written "and" and "or". If you could explain what your strategy was for finding the information, and how you came to miss it, I would be most interested to see what we can learn.

Michael Kay
Saxonica

Current Thread