「XML Path Language」の版間の差分

削除された内容 追加された内容
SieBot (会話 | 投稿記録)
m ロボットによる 追加: is:XPath
copyedit
1行目:
[[画像:XPath example.svg|300px|thumb|[[Extensible Markup Language|XMLファイル]]文書に XPath の式を適用したイメージ]]
'''XML Path Language''' ('''XPath'''; XMLパス言語) は、[[マークアップ言語]] [[Extensible Markup Language|XML]] に準拠した文書の特定の部分を指定する言語構文である。
XPath自体は簡潔な構文 (式言語) であり、XMLに準拠したマークアップ言語ではない。
15行目:
== データモデル ==
 
XPathの[[データモデル]]では、[[Extensible Markup Language|XML]]文書はルートノードを頂点とするノードの[[木構造 (データ構造)|木構造]]であり、以下の7種類のノードから構成される (参考: [[Extensible Markup Language|XML]]) 。
* ルートノード
* 要素ノード
269行目:
 
次のXML文書でXPathを例示して説明する。
 
<?xml version="1.0" encoding="utf-8"?>
<source lang="xml">
<document>
<?xml version="1.0" encoding="utf-8"?>
&lt;!-- XML文書 --&gt;
<document>
<chapter title="第1章">
&lt;<!-- XML文書 --&gt;>
<paragraph>段落</paragraph>
<chapter title="第1章">
<paragraph>次の段落</paragraph>
<paragraph>さらに次の段落</paragraph>
<paragraph>最後の段落</paragraph>
<paragraph>さらに次の段落</paragraph>
</chapter>
<paragraph>最後の段落</paragraph>
<chapter title="第2章">
</chapter>
<paragraph>段落</paragraph>
</chapter title="第2章">
<paragraph>段落</paragraph>
</document>
</chapter title="第2章">
</document>
</source>
 
* <code>/document</code> : ルート要素 <code>document</code> を選択する。
341 ⟶ 344行目:
** [http://www.infoteria.com/jp/contents/xml-data/REC-xpath-19991116-jpn.htm XPath 1.0 仕様 (日本語訳)] - [[インフォテリア|インフォテリア株式会社]]
** [http://www.doraneko.org/xml/xpath10/19991116/Overview.html XPath 1.0 仕様 (日本語訳)] - どら猫本舗
* [http://www.w3.org/TR/xpath20/ XPath 2.0 (W3C仕様 勧告候補(英語)] - W3C
** [http://www.w3.org/TR/xquery/ XQuery 1.0 (W3C仕様 勧告候補(英語)]
** [http://www.w3.org/TR/xslt20/ XSLT 2.0 (W3C仕様 勧告候補(英語)]
* [http://www.atmarkit.co.jp/fxml/tanpatsu/10xslt/xslt02.html XPathの書き方の基本 (日本語)] - @IT (アットマーク・アイティ)
* [http://www.w3schools.com/xpath/default.asp XPath tutorial (英語)]