Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web/XPath/Comparison_with_CSS_selectors を更新 #16677

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 11 additions & 39 deletions files/ja/web/xpath/comparison_with_css_selectors/index.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,19 @@
---
title: CSS セレクターと XPath の比較
slug: Web/XPath/Comparison_with_CSS_selectors
l10n:
sourceCommit: bb652aaf3e38f3c7fef970a62f813047dffac879
---

{{XSLTRef}}
{{XsltSidebar}}

この記事では、ウェブ開発者が適材適所のツールを選択できるように、CSSセレクターとXPathの違いを説明することを目的としています。

| [XPath 機能](/ja/docs/Web/XPath) | [相当する CSS](/ja/docs/Web/CSS/CSS_Selectors) |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| [`ancestor`](/ja/docs/Web/XPath/Axes/ancestor), [`parent`](/ja/docs/Web/XPath/Axes/parent) or [`preceding-sibling`](/ja/docs/Web/XPath/Axes/preceding-sibling) 軸 | {{CSSxRef(":has",":has()")}} セレクター {{experimental_inline}} |
| [`attribute`](/ja/docs/Web/XPath/Axes/attribute) 軸 | [属性セレクター](/ja/docs/Web/CSS/Attribute_selectors) |
| [`child`](/ja/docs/Web/XPath/Axes/child) 軸 | [子結合子](/ja/docs/Web/CSS/Child_combinator) |
| [`descendant`](/ja/docs/Web/XPath/Axes/descendant) 軸 | [子孫結合子](/ja/docs/Web/CSS/Descendant_combinator) |
| [`following-sibling`](/ja/docs/Web/XPath/Axes/following-sibling) 軸 | [一般兄弟結合子](/ja/docs/Web/CSS/General_sibling_combinator)または[隣接兄弟結合子](/ja/docs/Web/CSS/Adjacent_sibling_combinator) |
| [`self`](/ja/docs/Web/XPath/Axes/self) 軸 | {{CSSxRef(":scope")}} または {{CSSxRef(":host")}} セレクター^ |

<section id="Quick_links">
<ol>
<li><strong><a href="/ja/docs/Web/XSLT">XSLT</a></strong></li>
<li><strong><a href="/ja/docs/Web/EXSLT">EXSLT</a></strong></li>
<li><strong><a href="/ja/docs/Web/XPath">XPath</a></strong></li>
<li class="toggle">
<details open>
<summary>ガイド</summary>
<ol>
<li><a href="/ja/docs/Web/XPath/Comparison_with_CSS_selectors">CSS セレクターと XPath の比較</a>
</li>
<li><a href="/ja/docs/Web/XPath/Snippets">XPath スニペット</a></li>
</ol>
</details>
</li>
<li class="toggle">
<details open>
<summary><a href="/ja/docs/Web/XPath/Axes">XPath 軸</a></summary>
{{ListSubpagesForSidebar("/ja/docs/Web/XPath/Axes")}}
</details>
</li>
<li class="toggle">
<details open>
<summary><a href="/ja/docs/Web/XPath/Functions">XPath 関数</a></summary>
{{ListSubpagesForSidebar("/ja/docs/Web/XPath/Functions")}}
</details>
</li>
</ol>
</section>
| [XPath 機能](/ja/docs/Web/XPath) | [相当する CSS](/ja/docs/Web/CSS/CSS_selectors) |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| [`ancestor`](/ja/docs/Web/XPath/Axes#ancestor), [`parent`](/ja/docs/Web/XPath/Axes#parent) or [`preceding-sibling`](/ja/docs/Web/XPath/Axes#preceding-sibling) 軸 | {{CSSxRef(":has",":has()")}} セレクター {{experimental_inline}} |
| [`attribute`](/ja/docs/Web/XPath/Axes#attribute) 軸 | [属性セレクター](/ja/docs/Web/CSS/Attribute_selectors) |
| [`child`](/ja/docs/Web/XPath/Axes#child) 軸 | [子結合子](/ja/docs/Web/CSS/Child_combinator) |
| [`descendant`](/ja/docs/Web/XPath/Axes#descendant) 軸 | [子孫結合子](/ja/docs/Web/CSS/Descendant_combinator) |
| [`following-sibling`](/ja/docs/Web/XPath/Axes#following-sibling) 軸 | [後続兄弟結合子](/ja/docs/Web/CSS/Subsequent-sibling_combinator)または[次兄弟結合子](/ja/docs/Web/CSS/Next-sibling_combinator) |
| [`self`](/ja/docs/Web/XPath/Axes#self) 軸 | {{CSSxRef(":scope")}} または {{CSSxRef(":host")}} セレクター^ |