北村さんが引用している仕様書の箇所を読んだら、true() != foo
(fooは空のノード集合)は真であると気づきました。この時は各ノードではなくてノード集合foo
自身にboolean
関数が適用されるようです(true() != false()
で真)。MSXML4.0は正しかった。4Suiteの実装が間違い。でも片方がブール値の時だけ処理が違うというのも一貫性が無くて混乱の元だし、Ogbujiさんを責める気にはなれません。私も勘違いしていたわけだし。一応原文もチェック:
If one object to be compared is a node-set and the other is a boolean, then the comparison will be true if and only if the result of performing the comparison on the boolean and on the result of converting the node-set to a boolean using the boolean function is true.
3.4 Booleans(XML Path Language (XPath))より
ふと気づいて青い本(謎)を調べたら、やっぱり勘違いしていました。