タグ

codeとtipsに関するterurouのブックマーク (2)

  • ノードの集合を「ドキュメント順」に高速に並べ替える。その1 - IT戦記

    ドキュメント順とは何か? ドキュメント順とは、簡単に言えば「XML のソース上の前にある順」のこと。 詳しくはこのへんを見てね。 XPath ではこの「ドキュメント順」という概念がよく登場する。 たとえば、ノードを文字列化するときは子孫テキストノードを「ドキュメント順」に文字列として連結しなければならない。とかとか でも、このドキュメント順へのソート 考えただけでもめちゃめちゃ重そうだ・・・。 いろいろ考えてみた。 XPath 実行中はドキュメント順が変わることがないので、DOM アクセスはキャッシュできる。 ノードの集合は木構造で保存したほうが比較回数が少なくてすむ(アルゴリズム初心者なので、実際に早いか検証しないと><) で、今回は DOM アクセスをキャッシュしながらノードを比較する関数を作る 汎用的に作ったので XPath 目的以外でも使えます。 var order = funct

    ノードの集合を「ドキュメント順」に高速に並べ替える。その1 - IT戦記
  • TechNet Script Center

    The “Hey, Scripting Guys!” blog has been retired. There are many useful posts in this blog, so we keep the blog here for historical reference. However, some information might be very outdated and many of the links might not work anymore. New PowerShell content is being posted to the PowerShell Community blog where members of the community can create posts by submitting content in the GitHub reposi

  • 1