XPathのevaluate結果に対する処理をスマートに書くための便利関数 - 今日もスミマセン。を見て、思いついた。 $X関数は便利だけど、配列を詰めなおす処理が今ひとつだと感じてました。 で、その改案です。 http://gist.github.com/19461 function $XA (exp, context) { context || (context = document); var expr = (context.ownerDocument || context).createExpression(exp, function (prefix) { return document.createNSResolver(context.documentElement || context).lookupNamespaceURI(prefix) || context.namespa