Discussion Forums

Re: Edit logicOperator="XOR"
Steve Wilkinson / Cornerstone Technology Limited
10 May 2010 7:13AM ET

Sergey - I would strongly support Greg's viewpoint, that XOR is a two-operand-only operator. Whilst it's possible that some implementers may disagree, the likelihood that all implementers will support > two operands is in my view small.

For this reason, I would suggest that if you get FIXatdl with > 2 operands in an XOR clause, then you ask the author to refactor it along the lines of Greg's suggestion. I accept that the syntax is far from elegant, but I believe it is the only safe approach across such a potentially wide range of implementations.

Hope this helps - Steve.

>
> According to the FIXatdl-1.1 spec: ".. the logical operators, AND and
> OR, can have more than two operands. Furthermore, they both perform short-
> circuit evaluation of their operands. That being the case, it is
> important that XML parsing or binding libraries maintain the order of
> the elements as they appear; otherwise unexpected results may occur."
>
> But what abuot XOR? The spec doesn;t say anything about it.
>
> SO here is my interpetation... All logical operators are binary.
> However, there is an exception for AND and OR, which can have more than
> two operands (this was stricly for convenience since most programming
> languages allow for this). XOR must have two and only two operands. The
> operator, NOT, must have exactly one operand.
>
> I realize that we can get a creative and let XOR have multiple
> interpretations (one and only one from a set, two and only two from a
> set, three but not more than four, etc.), but that's the programmers
> job, or in this case the FIXatdl author's job.
>
> So I think you'll need to re-write the <Edit> to something like this:
> <Edit logiOperator="OR"> <Edit logicOperator="AND"> <Edit operator="EX"
> field="Field1"/> <Edit operator="NX" field="Field2"/> <Edit
> operator="NX" field="field3"/> </Edit> <Edit logicOperator="AND"> <Edit
> operator="NX" field="Field1"/> <Edit operator="EX" field="Field2"/>
> <Edit operator="NX" field="field3"/> </Edit> <Edit logicOperator="AND">
> <Edit operator="NX" field="Field1"/> <Edit operator="NX"
> field="Field2"/> <Edit operator="EX" field="field3"/> </Edit> </Edit>
>
> -Greg


Edit logicOperator="XOR"
Sergey Axenov / Metabit Systems Co., Ltd.   6 May 2010 10:47PM ET
Re: Edit logicOperator="XOR"
Witold Sames / Portware   7 May 2010 5:37AM ET
Re: Edit logicOperator="XOR"
Richard Labs / CL&B Capital Management, LLC   7 May 2010 9:09AM ET
Re: Edit logicOperator="XOR"
Greg Malatestinic / Jordan & Jordan   7 May 2010 10:14AM ET
Re: Edit logicOperator="XOR"
Steve Wilkinson / Cornerstone Technology Limited   10 May 2010 7:13AM ET
Re: Edit logicOperator="XOR"
Sergey Axenov / Metabit Systems Co., Ltd.   10 May 2010 9:25PM ET
Re: Edit logicOperator="XOR"
John Shields / Nomura Securities Co.   15 May 2010 9:26AM ET