RE: (ESED-813) XOR operator in XPath

Hi Michael,

Thank you for your quick response. There is no question that an 'exclusive or' on two booleans can be achieved quite concisely using existing operators. Considering some (derived) logical operators that are not provided by the language (XOR, XNOR, NAND, NOR), three of those are essentially 'not-style' operators and negations of 'affirmative' operands. It seems reasonable enough that we would not bother providing them in XPath (maybe they'd be nice to have, but I'll leave that alone...)

XOR is the missing 'affirmative' operator in XPath. Yes, it is a derived operator and not necessary. Granted, the below two simple concepts are logically equivalent when operating upon booleans:
(X xor Y): "true if only one of its operands are true".
(X != Y) : "true if these operands are not equal"

However, for a user of XPath, I think providing the operator that directly translates to the concept a user might be looking for, rather than a 'logically equivalent' operator, is a nice thing to do. It seems a simple enough translation, but if I can spare my business users of XPath from needing to make one more small leap in their boolean algebra cogitations, then I'd be happy to do so.

Regards,

[cid:image001.jpg@01CAE145.61D6CAA0]

BRENT MCDOWALL  |  System Analyst
EasySuite | Shared Services | BT Corporate Systems
Suncorp | Level 19 Suncorp Plaza | cnr Turbot & Albert Street, Brisbane 4000
ext: 21307 | tel: (07) 3362 1307 | fax: (07) 3362 2966 | ipc: IT042



From: Michael Kay [mailto:mike@saxonica.com]
Sent: Tuesday, 20 April 2010 17:26
To: McDOWALL, Brent; public-qt-comments@w3.org
Cc: EasySuite Operations
Subject: RE: (ESED-813) XOR operator in XPath

If you have too boolean values X and Y, you can write (X xor Y) as (X != Y). If you want to add the coercion to effective boolean value, you can write boolean(X) != boolean(Y). Do we really need a new operator for something that can be expressed so concisely already, and that would be used only rarely?

(personal response)

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay

________________________________
From: public-qt-comments-request@w3.org [mailto:public-qt-comments-request@w3.org] On Behalf Of McDOWALL, Brent
Sent: 19 April 2010 23:42
To: 'public-qt-comments@w3.org'
Cc: EasySuite Operations
Subject: (ESED-813) XOR operator in XPath
Hi,

XPath 2.0 http://www.w3.org/TR/xpath20/, http://www.w3schools.com/xpath/xpath_operators.asp, currently does not provide an 'exclusive or (XOR)' Boolean Operator. As a user of XPath, I would view it as a useful addition to the specification. It was mentioned in a working draft http://www.w3.org/TR/2001/WD-xquery-operators-20011220/ but resolved at the time simply as "The XOR function will not be introduced at this time."

Please consider this operator for future versions of W3C recommendations http://www.w3.org/TR/xquery-operators/ associated with XPath.

Regards,

[cid:image001.jpg@01CAE145.61D6CAA0]

BRENT MCDOWALL  |  System Analyst
EasySuite | Shared Services | BT Corporate Systems
Suncorp | Level 19 Suncorp Plaza | cnr Turbot & Albert Street, Brisbane 4000
ext: 21307 | tel: (07) 3362 1307 | fax: (07) 3362 2966 | ipc: IT042




________________________________
This e-mail is sent by Suncorp-Metway Limited ABN 66 010 831 722 or one of its related entities "Suncorp".
Suncorp may be contacted at Level 18, 36 Wickham Terrace, Brisbane or on 13 11 55 or at suncorp.com.au.
The content of this e-mail is the view of the sender or stated author and does not necessarily reflect the view of Suncorp. The content, including attachments, is a confidential communication between Suncorp and the intended recipient. If you are not the intended recipient, any use, interference with, disclosure or copying of this e-mail, including attachments, is unauthorised and expressly prohibited. If you have received this e-mail in error please contact the sender immediately and delete the e-mail and any attachments from your system.
If this e-mail constitutes a commercial message of a type that you no longer wish to receive please reply to this e-mail by typing Unsubscribe in the subject line.

Received on Wednesday, 21 April 2010 03:16:02 UTC