Jintrick.netagenda2004年05月アーカイブ → 2004年05月05日

Re: XPathにおけるノード集合とその他のオブジェクトとの比較 - 徒書

北村さんが引用している仕様書の箇所を読んだら、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))より

ふと気づいて青い本(謎)を調べたら、やっぱり勘違いしていました。


webmaster@jintrick.net
公開: 2004年05月05日
カテゴリ: XPath