Created
March 16, 2012 06:45
-
-
Save vmi/2048811 to your computer and use it in GitHub Desktop.
JavaScript XPath メモ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// XPath メモ | |
// 使用例 | |
var xpathResult = document.evaluate("XPath式", document.body, null, 9, null); | |
// var xpathResult = document.evaluate( | |
// xpathExpression, | |
// contextNode, | |
// namespaceResolver, | |
// resultType, | |
// result | |
// ); | |
// | |
// namespaceResolver: とりあえずnull | |
// | |
// resultType: 結果型 | |
// 1 = 数値 | |
// 2 = 文字列 | |
// 3 = ブール値 | |
// 5 = 全ノード集合(出現順) | |
// 7 = 全ノード集合のスナップショット(出現順) | |
// 9 = 最初にマッチしたノードのみを格納するノード集合 | |
// | |
// result: 過去の結果を再利用する場合に指定。最初はnull |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment