CARVIEW |
Select Language
HTTP/2 200
content-type: text/html
x-guploader-uploadid: AAwnv3LlSWGI1H3bWE9nIRyeHO6H46DNujwWBn-3EkILXznNjdRd4yXzvq-md6rssbMYAng5
cache-control: public, max-age=3600
expires: Tue, 07 Oct 2025 08:41:27 GMT
last-modified: Tue, 07 Oct 2025 01:16:10 GMT
etag: W/"d5bed9e82bf91d4d500f15eb6d8ec3a6"
x-goog-generation: 1759799770578273
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 159927
x-goog-meta-goog-reserved-file-mtime: 1759797506
x-goog-hash: crc32c=cISefw==, md5=1b7Z6Cv5HU1QDxXrbY7Dpg==
x-goog-storage-class: STANDARD
accept-ranges: none
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
alt-svc: clear
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff
strict-transport-security: max-age=63072000
content-security-policy: default-src 'self'; script-src 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; script-src-elem 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://www.googletagmanager.com/gtag/js assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; style-src 'report-sample' 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' developer.allizom.org bcd.developer.allizom.org bcd.developer.mozilla.org updates.developer.allizom.org updates.developer.mozilla.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://incoming.telemetry.mozilla.org https://observatory-api.mdn.allizom.net https://observatory-api.mdn.mozilla.net https://api.github.com/search/issues stats.g.doubleclick.net https://api.stripe.com; font-src 'self'; frame-src 'self' interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net mdn.github.io live-samples.mdn.mozilla.net live-samples.mdn.allizom.net *.mdnplay.dev *.mdnyalp.dev *.play.test.mdn.allizom.net https://v2.scrimba.com https://scrimba.com jsfiddle.net www.youtube-nocookie.com codepen.io survey.alchemer.com https://js.stripe.com; img-src 'self' data: *.githubusercontent.com *.googleusercontent.com *.gravatar.com mozillausercontent.com firefoxusercontent.com profile.stage.mozaws.net profile.accounts.firefox.com developer.mozilla.org mdn.dev interactive-examples.mdn.mozilla.net interactive-examples.mdn.allizom.net wikipedia.org upload.wikimedia.org https://mdn.github.io/shared-assets/ https://mdn.dev/ https://*.google-analytics.com https://*.googletagmanager.com www.gstatic.com; manifest-src 'self'; media-src 'self' archive.org videos.cdn.mozilla.net https://mdn.github.io/shared-assets/; child-src 'self'; worker-src 'self';
x-frame-options: DENY
origin-trial: AxVILwizhbMjxFeHOn1P3R8niO1RJY/smaK4B4d1rLzc1gTaxtXMSaTi+FoigYgCw40uFRDwFcEAeqDR+vVLOW4AAABfeyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZyIsImZlYXR1cmUiOiJQcml2YXRlQXR0cmlidXRpb25WMiIsImV4cGlyeSI6MTc0MjA3OTYwMH0=
x-cloud-trace-context: 1909c4c1abbc7aa902559a0b3a1861b8;o=1
date: Tue, 07 Oct 2025 07:41:27 GMT
server: Google Frontend
via: 1.1 google
vary: Accept-Encoding
content-encoding: gzip
x-cache: miss
XPath - XML: Extensible Markup Language | MDN
Toggle sidebar
このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。
XPath
XPath は XML Path Language の略称です。非 XML 構文を使って、柔軟な方法で XML 文書の様々な部分をアドレッシングする(指し示す)ことができます。さらに、文書中で指し示されたノードがパターンに一致するかどうかの判定を行うこともできます。
XPath は主に XSLT で使われていますが、 HTML や SVG のような XML 風の言語の文書の DOM においても XPathExpression
を用いることで、 Document.getElementById()
や Document.querySelectorAll()
メソッドや Node.childNodes
プロパティ、その他の DOM コア機能に依存することなく、はるかにパワフルな方法でたどることができます。
XPath は XML 文書の階層構造を辿るために(URL のような)パス表記を使います。また、URI や XML 属性値の中で使えるように非 XML 構文を採用しています。
ガイド
- JavaScript からの XPath 利用入門
-
XSLT 以外で XPath を使用する方法です。
- XPath スニペット
-
JavaScript ユーティリティ関数があり、 DOM Level 3 XPath API に基づいて、独自のコードで使用することができます。
リファレンス
- XPath:Axes
-
XPath 仕様で定められている軸 (Axis) の一覧とその定義。軸はノード間の関係性を記述するのに使われます。
- XPath:Functions
-
コア XPath 関数及び XSLT 固有の追加 XPath 関数の一覧とその定義。
関連事項
- XSLT, XML, DOM
- XSLT による XML の変換
- CSS セレクターと XPath の比較
- What is XSLT? - XSLT と XPath の予備知識が無い人を対象に、その背景や構造、概念、初歩的な専門用語を紹介する広範囲な入門ガイド。 (xml.com, 2000)
- XPath tester - オンラインの XPath ビルダー/デバッガー