From 2e2f504d9fac77e3c66b132e0f880faa9a1294a6 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Wed, 25 Oct 2023 22:29:52 +0900 Subject: [PATCH] =?UTF-8?q?2023/07/10=20=E6=99=82=E7=82=B9=E3=81=AE?= =?UTF-8?q?=E8=8B=B1=E8=AA=9E=E7=89=88=E3=81=AB=E5=90=8C=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xslt/transforming_xml_with_xslt/index.md | 233 +++++++++--------- 1 file changed, 120 insertions(+), 113 deletions(-) diff --git a/files/ja/web/xslt/transforming_xml_with_xslt/index.md b/files/ja/web/xslt/transforming_xml_with_xslt/index.md index 632535d3e3db51..e05cddb374f182 100644 --- a/files/ja/web/xslt/transforming_xml_with_xslt/index.md +++ b/files/ja/web/xslt/transforming_xml_with_xslt/index.md @@ -1,129 +1,136 @@ --- title: XSLT による XML の変換 slug: Web/XSLT/Transforming_XML_with_XSLT +l10n: + sourceCommit: b6f343538eac4a803943b4e99b0c0545b372645a --- -{{XSLTRef}} +{{XsltSidebar}} -## [概要](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/An_Overview) +## 概要 -コンテンツとプレゼンテーションの分離は、[XML](/ja/docs/XML) の重要な設計の特徴です。 XML 文書の構造は、コンテンツ自体の個々の側面の間の重要な関係を反映し、明確にするように設計されています。このデータが最終的にどのように提示されるべきかに関する指示を提供する必要はありません。このインテリジェントな構造化は、ますます多くのデータ転送が自動化され、ネットワークでリンクされた非常に異種のマシン間で行われるため、特に重要です。 +[概要](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/An_Overview) -しかし、最終的には XML 文書に格納されているコンテンツの大部分を人間の読者に提示する必要があります。ブラウザは使い慣れた非常に柔軟なインタフェースを提供するため、このようなプレゼンテーションバージョンの XML コンテンツを配信するための理想的なメカニズムです。さまざまな XML テクノロジを利用してゼロから構築されているため、 Firefox は、元の XML 文書とそれを HTML 表示用にスタイル設定してレイアウトするために使用される特殊なスタイルシートの両方を処理するために必要なすべてのメカニズムを組み込んでおり、クライアントサイド処理によるサーバの負荷を軽減します。 +コンテンツとプレゼンテーションの分離は、[XML](/ja/docs/Web/XML) の重要な設計の特徴です。 XML 文書の構造は、このデータが最終的にどのように表現されるべきかを示す必要性に妨げられることなく、コンテンツ自体の個々の側面間の重要な関係を反映し、明確にするように設計されています。このインテリジェントな構造化は、より多くのデータ移行を自動化し、ネットワークでリンクされた異機種間で配置する際に具体的な意味を持ちます。 -現時点で、 Gecko (Firefox のレイアウトエンジン) は二種類の XML 用のスタイルシートに対応しています。基本的な表示方法の制御 — フォント、色、位置、など — については、 Gecko は [CSS](/ja/docs/CSS) を使用します。 CSS1 と CSS2 はよく対応されており、 CSS3 標準への対応は開発中です。 CSS についての更なる情報は、 [Eric Meyer's CSS pages](http://www.meyerweb.com/eric/css/) を参照してください。 +しかし、 XML 文書内に格納されるコンテンツの多くは、最終的には人間の読者に表示する必要があります。ブラウザーは、親しみやすく柔軟性の高いインターフェイスを提供しているため、 XML コンテンツの表示版を提供するための理想的なメカニズムです。さまざまな XML 技術を利用して一から構築された Firefox は、元の XML 文書と、それらを HTML 表示用にスタイル設定およびレイアウトするために使用される特殊なスタイルシートの両方を処理するために必要なすべてのメカニズムをそれ自体に組み込んでおり、クライアントサイドの処理でサーバーの負荷を軽減します。 -ここで注目するのは、 Gecko が対応する二番目の種類のスタイルシート、 XSLT スタイルシートです。 XSLT は eXtensible Stylesheet Language/Transform のことで、名前の通りです。 XSLT ではスタイルシートで最初の XML 文書を二つの意味のある方法、必要に応じてコンテンツを大規模に並べ替えたり、コンテンツを別の形式に変形したりすることで変換します。 (Firefox の場合は、 HTML に変換して表示することができます)。 +現時点で、 Gecko (Firefox のレイアウトエンジン)は 2 種類の XML 用のスタイルシートに対応しています。基本的な表示方法の制御 — フォント、色、位置、など — については、 Gecko は [CSS](/ja/docs/Web/CSS) を使用します。 + +ここでは、Gecko が対応している 2 つ目の種類のスタイルシート、XSLT スタイルシートに注目します。XSLT は eXtensible Stylesheet Language/Transform の略で、この名前は最適です。 XSLT は、スタイルシート作成者が主要な XML 文書を 2 つの重要な方法で変換することができます。コンテンツの操作と並べ替え(必要であれば、コンテンツの並べ替えも含みます)、およびコンテンツの異なる形式への変換(Firefox の場合は、ブラウザーで表示できる HTML への変換)です。 ## XSLT/XPath リファレンス -### [要素](/ja/docs/Web/XSLT/Elements) - -- [xsl:apply-imports](/ja/docs/Web/XSLT/Elements/apply-imports) _(対応済み)_ -- [xsl:apply-templates](/ja/docs/Web/XSLT/Elements/apply-templates) _(対応済み)_ -- [xsl:attribute](/ja/docs/Web/XSLT/Elements/attribute) _(対応済み)_ -- [xsl:attribute-set](/ja/docs/Web/XSLT/Elements/attribute-set) _(対応済み)_ -- [xsl:call-template](/ja/docs/Web/XSLT/Elements/call-template) _(対応済み)_ -- [xsl:choose](/ja/docs/Web/XSLT/Elements/choose) _(対応済み)_ -- [xsl:comment](/ja/docs/Web/XSLT/Elements/comment) _(対応済み)_ -- [xsl:copy](/ja/docs/Web/XSLT/Elements/copy) _(対応済み)_ -- [xsl:copy-of](/ja/docs/Web/XSLT/Elements/copy-of) _(対応済み)_ -- [xsl:decimal-format](/ja/docs/Web/XSLT/Elements/decimal-format) _(対応済み)_ -- [xsl:element](/ja/docs/Web/XSLT/Elements/element) _(対応済み)_ -- [xsl:fallback](/ja/docs/Web/XSLT/Elements/fallback) _(未対応)_ -- [xsl:for-each](/ja/docs/Web/XSLT/Elements/for-each) _(対応済み)_ -- [xsl:if](/ja/docs/Web/XSLT/Elements/if) _(対応済み)_ -- [xsl:import](/ja/docs/Web/XSLT/Elements/import) _(ほぼ対応済み)_ -- [xsl:include](/ja/docs/Web/XSLT/Elements/include) _(対応済み)_ -- [xsl:key](/ja/docs/Web/XSLT/Elements/key) _(対応済み)_ -- [xsl:message](/ja/docs/Web/XSLT/Elements/message) _(対応済み)_ -- [xsl:namespace-alias](/ja/docs/Web/XSLT/Elements/namespace-alias) _(未対応)_ -- [xsl:number](/ja/docs/Web/XSLT/Elements/number) _(一部対応済み)_ -- [xsl:otherwise](/ja/docs/Web/XSLT/Elements/otherwise) _(対応済み)_ -- [xsl:output](/ja/docs/Web/XSLT/Elements/output) _(一部対応済み)_ -- [xsl:param](/ja/docs/Web/XSLT/Elements/param) _(対応済み)_ -- [xsl:preserve-space](/ja/docs/Web/XSLT/Elements/preserve-space) _(対応済み)_ -- [xsl:processing-instruction](/ja/docs/Web/XSLT/Elements/processing-instruction) -- [xsl:sort](/ja/docs/Web/XSLT/Elements/sort) _(対応済み)_ -- [xsl:strip-space](/ja/docs/Web/XSLT/Elements/strip-space) _(対応済み)_ -- [xsl:stylesheet](/ja/docs/Web/XSLT/Elements/stylesheet) _(一部対応済み)_ -- [xsl:template](/ja/docs/Web/XSLT/Elements/template) _(対応済み)_ -- [xsl:text](/ja/docs/Web/XSLT/Elements/text) _(一部対応済み)_ -- [xsl:transform](/ja/docs/Web/XSLT/Elements/transform) _(対応済み)_ -- [xsl:value-of](/ja/docs/Web/XSLT/Elements/value-of) _(一部対応済み)_ -- [xsl:variable](/ja/docs/Web/XSLT/Elements/variable) _(対応済み)_ -- [xsl:when](/ja/docs/Web/XSLT/Elements/when) _(対応済み)_ -- [xsl:with-param](/ja/docs/Web/XSLT/Elements/with-param) _(対応済み)_ - -### [軸](/ja/docs/XPath/Axes) - -- [ancestor](/ja/docs/XPath/Axes/ancestor) -- [ancestor-or-self](/ja/docs/XPath/Axes/ancestor-or-self) -- [attribute](/ja/docs/XPath/Axes/attribute) -- [child](/ja/docs/XPath/Axes/child) -- [descendant](/ja/docs/XPath/Axes/descendant) -- [descendant-or-self](/ja/docs/XPath/Axes/descendant-or-self) -- [following](/ja/docs/XPath/Axes/following) -- [following-sibling](/ja/docs/XPath/Axes/following-sibling) -- [namespace](/ja/docs/XPath/Axes/namespace) _(未対応)_ -- [parent](/ja/docs/XPath/Axes/parent) -- [preceding](/ja/docs/XPath/Axes/preceding) -- [preceding-sibling](/ja/docs/XPath/Axes/preceding-sibling) -- [self](/ja/docs/XPath/Axes/self) - -### [関数](/ja/docs/XPath/Functions) - -- [boolean()](/ja/docs/XPath/Functions/boolean) _(対応済み)_ -- [ceiling()](/ja/docs/XPath/Functions/ceiling) _(対応済み)_ -- [concat()](/ja/docs/XPath/Functions/concat) _(対応済み)_ -- [contains()](/ja/docs/XPath/Functions/contains) _(対応済み)_ -- [count()](/ja/docs/XPath/Functions/count) _(対応済み)_ -- [current()](/ja/docs/XPath/Functions/current) _(対応済み)_ -- [document()](/ja/docs/XPath/Functions/document) _(対応済み)_ -- [element-available()](/ja/docs/XPath/Functions/element-available) _(対応済み)_ -- [false()](/ja/docs/XPath/Functions/false) _(対応済み)_ -- [floor()](/ja/docs/XPath/Functions/floor) _(対応済み)_ -- [format-number()](/ja/docs/XPath/Functions/format-number) _(対応済み)_ -- [function-available()](/ja/docs/XPath/Functions/function-available) _(対応済み)_ -- [generate-id()](/ja/docs/XPath/Functions/generate-id) _(対応済み)_ -- [id()](/ja/docs/XPath/Functions/id) _(partially 対応済み)_ -- [key()](/ja/docs/XPath/Functions/key) _(対応済み)_ -- [lang()](/ja/docs/XPath/Functions/lang) _(対応済み)_ -- [last()](/ja/docs/XPath/Functions/last) _(対応済み)_ -- [local-name()](/ja/docs/XPath/Functions/local-name) _(対応済み)_ -- [name()](/ja/docs/XPath/Functions/name) _(対応済み)_ -- [namespace-uri()](/ja/docs/XPath/Functions/namespace-uri) _(対応済み)_ -- [normalize-space()](/ja/docs/XPath/Functions/normalize-space) _(対応済み)_ -- [not()](/ja/docs/XPath/Functions/not) _(対応済み)_ -- [number()](/ja/docs/XPath/Functions/number) _(対応済み)_ -- [position()](/ja/docs/XPath/Functions/position) _(対応済み)_ -- [round()](/ja/docs/XPath/Functions/round) _(対応済み)_ -- [starts-with()](/ja/docs/XPath/Functions/starts-with) _(対応済み)_ -- [string()](/ja/docs/XPath/Functions/string) _(対応済み)_ -- [string-length()](/ja/docs/XPath/Functions/string-length) _(対応済み)_ -- [substring()](/ja/docs/XPath/Functions/substring) _(対応済み)_ -- [substring-after()](/ja/docs/XPath/Functions/substring-after) _(対応済み)_ -- [substring-before()](/ja/docs/XPath/Functions/substring-before) _(対応済み)_ -- [sum()](/ja/docs/XPath/Functions/sum) _(対応済み)_ -- [system-property()](/ja/docs/XPath/Functions/system-property) _(対応済み)_ -- [translate()](/ja/docs/XPath/Functions/translate) _(対応済み)_ -- [true()](/ja/docs/XPath/Functions/true) _(対応済み)_ -- [unparsed-entity-url()](/ja/docs/XPath/Functions/unparsed-entity-url) _(not 対応済み)_ - -## [さらなる読み物](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading) - -- [書籍](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#Books) -- [オンライン](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#Online) - - - [The World Wide Web Consortium](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#The_World_Wide_Web_Consortium) - - [Portals](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#Portals) - - [Articles](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#Articles) - - [Tutorials/Examples](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#Tutorials.2FExamples) - - [Mailing Lists/Newsgroups](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#Mailing_Lists.2FNewsgroups) - -## [リソース](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/Resources) - -## [索引](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/Index) +### 要素 + +[要素](/ja/docs/Web/XSLT/Element) + +- [xsl:apply-imports](/ja/docs/Web/XSLT/Element/apply-imports) _(対応済み)_ +- [xsl:apply-templates](/ja/docs/Web/XSLT/Element/apply-templates) _(対応済み)_ +- [xsl:attribute](/ja/docs/Web/XSLT/Element/attribute) _(対応済み)_ +- [xsl:attribute-set](/ja/docs/Web/XSLT/Element/attribute-set) _(対応済み)_ +- [xsl:call-template](/ja/docs/Web/XSLT/Element/call-template) _(対応済み)_ +- [xsl:choose](/ja/docs/Web/XSLT/Element/choose) _(対応済み)_ +- [xsl:comment](/ja/docs/Web/XSLT/Element/comment) _(対応済み)_ +- [xsl:copy](/ja/docs/Web/XSLT/Element/copy) _(対応済み)_ +- [xsl:copy-of](/ja/docs/Web/XSLT/Element/copy-of) _(対応済み)_ +- [xsl:decimal-format](/ja/docs/Web/XSLT/Element/decimal-format) _(対応済み)_ +- [xsl:element](/ja/docs/Web/XSLT/Element/element) _(対応済み)_ +- [xsl:fallback](/ja/docs/Web/XSLT/Element/fallback) _(未対応)_ +- [xsl:for-each](/ja/docs/Web/XSLT/Element/for-each) _(対応済み)_ +- [xsl:if](/ja/docs/Web/XSLT/Element/if) _(対応済み)_ +- [xsl:import](/ja/docs/Web/XSLT/Element/import) _(ほぼ対応済み)_ +- [xsl:include](/ja/docs/Web/XSLT/Element/include) _(対応済み)_ +- [xsl:key](/ja/docs/Web/XSLT/Element/key) _(対応済み)_ +- [xsl:message](/ja/docs/Web/XSLT/Element/message) _(対応済み)_ +- [xsl:namespace-alias](/ja/docs/Web/XSLT/Element/namespace-alias) _(未対応)_ +- [xsl:number](/ja/docs/Web/XSLT/Element/number) _(一部対応済み)_ +- [xsl:otherwise](/ja/docs/Web/XSLT/Element/otherwise) _(対応済み)_ +- [xsl:output](/ja/docs/Web/XSLT/Element/output) _(一部対応済み)_ +- [xsl:param](/ja/docs/Web/XSLT/Element/param) _(対応済み)_ +- [xsl:preserve-space](/ja/docs/Web/XSLT/Element/preserve-space) _(対応済み)_ +- [xsl:processing-instruction](/ja/docs/Web/XSLT/Element/processing-instruction) +- [xsl:sort](/ja/docs/Web/XSLT/Element/sort) _(対応済み)_ +- [xsl:strip-space](/ja/docs/Web/XSLT/Element/strip-space) _(対応済み)_ +- [xsl:stylesheet](/ja/docs/Web/XSLT/Element/stylesheet) _(一部対応済み)_ +- [xsl:template](/ja/docs/Web/XSLT/Element/template) _(対応済み)_ +- [xsl:text](/ja/docs/Web/XSLT/Element/text) _(一部対応済み)_ +- [xsl:transform](/ja/docs/Web/XSLT/Element/transform) _(対応済み)_ +- [xsl:value-of](/ja/docs/Web/XSLT/Element/value-of) _(一部対応済み)_ +- [xsl:variable](/ja/docs/Web/XSLT/Element/variable) _(対応済み)_ +- [xsl:when](/ja/docs/Web/XSLT/Element/when) _(対応済み)_ +- [xsl:with-param](/ja/docs/Web/XSLT/Element/with-param) _(対応済み)_ + +### 軸 + +[軸](/ja/docs/Web/XPath/Axes) + +- [ancestor](/ja/docs/Web/XPath/Axes/ancestor) +- [ancestor-or-self](/ja/docs/Web/XPath/Axes/ancestor-or-self) +- [attribute](/ja/docs/Web/XPath/Axes/attribute) +- [child](/ja/docs/Web/XPath/Axes/child) +- [descendant](/ja/docs/Web/XPath/Axes/descendant) +- [descendant-or-self](/ja/docs/Web/XPath/Axes/descendant-or-self) +- [following](/ja/docs/Web/XPath/Axes/following) +- [following-sibling](/ja/docs/Web/XPath/Axes/following-sibling) +- [namespace](/ja/docs/Web/XPath/Axes/namespace) _(未対応)_ +- [parent](/ja/docs/Web/XPath/Axes/parent) +- [preceding](/ja/docs/Web/XPath/Axes/preceding) +- [preceding-sibling](/ja/docs/Web/XPath/Axes/preceding-sibling) +- [self](/ja/docs/Web/XPath/Axes/self) + +### 関数 + +[関数](/ja/docs/Web/XPath/Functions) + +- [boolean()](/ja/docs/Web/XPath/Functions/boolean) _(対応済み)_ +- [ceiling()](/ja/docs/Web/XPath/Functions/ceiling) _(対応済み)_ +- [concat()](/ja/docs/Web/XPath/Functions/concat) _(対応済み)_ +- [contains()](/ja/docs/Web/XPath/Functions/contains) _(対応済み)_ +- [count()](/ja/docs/Web/XPath/Functions/count) _(対応済み)_ +- [current()](/ja/docs/Web/XPath/Functions/current) _(対応済み)_ +- [document()](/ja/docs/Web/XPath/Functions/document) _(対応済み)_ +- [element-available()](/ja/docs/Web/XPath/Functions/element-available) _(対応済み)_ +- [false()](/ja/docs/Web/XPath/Functions/false) _(対応済み)_ +- [floor()](/ja/docs/Web/XPath/Functions/floor) _(対応済み)_ +- [format-number()](/ja/docs/Web/XPath/Functions/format-number) _(対応済み)_ +- [function-available()](/ja/docs/Web/XPath/Functions/function-available) _(対応済み)_ +- [generate-id()](/ja/docs/Web/XPath/Functions/generate-id) _(対応済み)_ +- [id()](/ja/docs/Web/XPath/Functions/id) _(partially 対応済み)_ +- [key()](/ja/docs/Web/XPath/Functions/key) _(対応済み)_ +- [lang()](/ja/docs/Web/XPath/Functions/lang) _(対応済み)_ +- [last()](/ja/docs/Web/XPath/Functions/last) _(対応済み)_ +- [local-name()](/ja/docs/Web/XPath/Functions/local-name) _(対応済み)_ +- [name()](/ja/docs/Web/XPath/Functions/name) _(対応済み)_ +- [namespace-uri()](/ja/docs/Web/XPath/Functions/namespace-uri) _(対応済み)_ +- [normalize-space()](/ja/docs/Web/XPath/Functions/normalize-space) _(対応済み)_ +- [not()](/ja/docs/Web/XPath/Functions/not) _(対応済み)_ +- [number()](/ja/docs/Web/XPath/Functions/number) _(対応済み)_ +- [position()](/ja/docs/Web/XPath/Functions/position) _(対応済み)_ +- [round()](/ja/docs/Web/XPath/Functions/round) _(対応済み)_ +- [starts-with()](/ja/docs/Web/XPath/Functions/starts-with) _(対応済み)_ +- [string()](/ja/docs/Web/XPath/Functions/string) _(対応済み)_ +- [string-length()](/ja/docs/Web/XPath/Functions/string-length) _(対応済み)_ +- [substring()](/ja/docs/Web/XPath/Functions/substring) _(対応済み)_ +- [substring-after()](/ja/docs/Web/XPath/Functions/substring-after) _(対応済み)_ +- [substring-before()](/ja/docs/Web/XPath/Functions/substring-before) _(対応済み)_ +- [sum()](/ja/docs/Web/XPath/Functions/sum) _(対応済み)_ +- [system-property()](/ja/docs/Web/XPath/Functions/system-property) _(対応済み)_ +- [translate()](/ja/docs/Web/XPath/Functions/translate) _(対応済み)_ +- [true()](/ja/docs/Web/XPath/Functions/true) _(対応済み)_ +- [unparsed-entity-url()](/ja/docs/Web/XPath/Functions/unparsed-entity-url) _(not 対応済み)_ + +## さらなる読み物 + +[さらなる読み物](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading) + +- [書籍](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#書籍) +- [デジタル](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#デジタル) + + - [ウェブサイト](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#ウェブサイト) + - [記事](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#記事) + - [チュートリアル/例](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#チュートリアル/例) + - [その他](/ja/docs/Web/XSLT/Transforming_XML_with_XSLT/For_Further_Reading#その他) ## 原典情報