From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/xslt/elements/index.html | 53 ++++ files/zh-cn/web/xslt/index.html | 86 +++++ .../web/xslt/transforming_xml_with_xslt/index.html | 346 +++++++++++++++++++++ 3 files changed, 485 insertions(+) create mode 100644 files/zh-cn/web/xslt/elements/index.html create mode 100644 files/zh-cn/web/xslt/index.html create mode 100644 files/zh-cn/web/xslt/transforming_xml_with_xslt/index.html (limited to 'files/zh-cn/web/xslt') diff --git a/files/zh-cn/web/xslt/elements/index.html b/files/zh-cn/web/xslt/elements/index.html new file mode 100644 index 0000000000..ecc12b2d6e --- /dev/null +++ b/files/zh-cn/web/xslt/elements/index.html @@ -0,0 +1,53 @@ +--- +title: Elements +slug: Web/XSLT/Elements +tags: + - XSLT_Reference +translation_of: Web/XSLT/Element +--- +

{{ XsltRef() }} There are two types of elements discussed here: top-level elements and instructions. A top-level element must appear as the child of either <xsl:stylesheet> or <xsl:transform>. An instruction, on the other hand, is associated with a template. A stylesheet may include several templates. A third type of element, not discussed here, is the literal result element (LRE). An LRE also appears in a template. It consists of any non-instruction element that should be copied as-is to the result document, for example, an <hr> element in an HTML conversion stylesheet.

+

On a related note, any attribute in an LRE and some attributes of a limited number of XSLT elements can also include what is known as an attribute value template. An attribute value template is simply a string that includes an embedded XPath expression which is used to specify the value of an attribute. At run-time the expression is evaluated and the result of the evaluation is substituted for the XPath expression. For example, assume that a variable "image-dir" is defined as follows:

+
<xsl:variable name="image-dir">/images</xsl:variable>
+

The expression to be evaluated is placed inside curly brackets:

+
<img src="{$image-dir}/mygraphic.jpg"/>
+

This would result in the following:

+
<img src="/images/mygraphic.jpg"/>
+

The element annotations that follow include a description, a syntax listing, a list of required and optional attributes, a description of type and position, its source in the W3C Recommendation and an explanation of the degree of present Gecko support.

+ +

{{ languages( { "en": "en/XSLT/Elements", "fr": "fr/XSLT/\u00c9l\u00e9ments", "ja": "ja/XSLT/Elements", "pl": "pl/XSLT/Elementy" } ) }}

diff --git a/files/zh-cn/web/xslt/index.html b/files/zh-cn/web/xslt/index.html new file mode 100644 index 0000000000..cf491833d6 --- /dev/null +++ b/files/zh-cn/web/xslt/index.html @@ -0,0 +1,86 @@ +--- +title: XSLT +slug: Web/XSLT +tags: + - XSLT +translation_of: Web/XSLT +--- +

 

+ +
可扩展样式表语言转换(XSLT)是一种基于XML的语言,和专门的处理软件一起使用,用于XML文档转换。虽然这个处理过程被称作“转换”,但并没有改变原始文档,而是在原文档内容的基础上创建了一个新的XML文档。然后, 这个新文档会被处理器序列化(输出)为标准的XML语法或其他格式,如HTML或纯文本。XSLT最常用于不同XML模式间的数据转换,或用于将XML数据转换为网页或PDF文档。 {{ Ref("one") }}
+ + + + + + + + +
+

Documentation

+ +
+
XSLT Element Reference
+
+ +
+
Transforming XML with XSLT
+
XSLT allows a stylesheet author to transform a primary XML document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format.
+
+ +
+
Using the Mozilla JavaScript interface to XSL Transformations
+
This document describes the JavaScript interface to the XSLT processing engine in Mozilla 1.2 and up.
+
+ +
+
Specifying parameters using processing instructions
+
Firefox allows stylesheet parameters to be specified when using the <?xml-stylesheet?> processing instruction. This is done using the <?xslt-param?> PI described in this document.
+
+ +
+
XSLT & XPath Tutorial
+
The TopXML XSLT tutorial introduces you to the basics of XSLT concepts, syntax, and programming.
+
+ +
+
XSLT Tutorial
+
This W3Schools tutorial teaches the reader how to use XSLT to transform XML documents into other formats, like XHTML.
+
+ +
+
What is XSLT?
+
This extensive introduction to XSLT and XPath assumes no prior knowledge of the technologies, and guides the reader through background, context, structure, concepts and introductory terminology.
+
+ +
+
XSLT 2.0 (new)
+
+ +

View All...

+
+

Community

+ +
    +
  • View Mozilla forums...
  • +
+ +

{{ DiscussionList("dev-tech-xslt", "mozilla.dev.tech.xslt") }}

+ + + +
+
XML, XPath, XQuery
+
+
+ +
+

{{ Note("one") }} This description of XSLT is obtained from the Wikipedia XSLT article.

+ +

Categories

+ +

Interwiki Language Links

+ +

 

+ +

{{ languages( { "en": "en/XSLT", "es": "es/XSLT", "fr": "fr/XSLT", "it": "it/XSLT", "ja": "ja/XSLT", "ko": "ko/XSLT", "pl": "pl/XSLT", "pt": "pt/XSLT" } ) }}

diff --git a/files/zh-cn/web/xslt/transforming_xml_with_xslt/index.html b/files/zh-cn/web/xslt/transforming_xml_with_xslt/index.html new file mode 100644 index 0000000000..4ca6ff59ee --- /dev/null +++ b/files/zh-cn/web/xslt/transforming_xml_with_xslt/index.html @@ -0,0 +1,346 @@ +--- +title: Transforming XML with XSLT +slug: Web/XSLT/Transforming_XML_with_XSLT +tags: + - NeedsMigration + - Transforming_XML_with_XSLT + - XSLT +translation_of: Web/XSLT/Transforming_XML_with_XSLT +--- +

 

+

 

+

An Overview

+

The separation of content and presentation is a key design feature of XML. The structure of an XML document is designed to reflect and clarify important relationships among the individual aspects of the content itself, unhindered by a need to provide any indication about how this data should eventually be presented. This intelligent structuring is particularly important as more and more data transfers are automated and take place between highly heterogeneous machines linked by a network.

+

Yet eventually much of the content stored in XML documents will need to be presented to human readers. Because a browser provides a familiar and highly flexible interface, it is an ideal mechanism for delivering such presentation versions of XML content. Built from the ground up utilizing a wide variety of XML technologies, Mozilla incorporates within itself all of the mechanisms needed to process both original XML documents and the specialized stylesheets used to style and lay them out for HTML display, reducing server load with client-side processing.

+

At present, Gecko (the layout engine behind Mozilla and Firefox) supports two forms of XML stylesheets. For basic control of appearance -- fonts, colors, position, and so forth -- Gecko uses CSS, familiar from DHTML. All of CSS1 and most of CSS2 are supported. Support for the emerging CSS3 standard is under development. For further information about CSS, see Eric Meyer's CSS pages.

+

Our focus here is on the second type of stylesheet that Gecko supports: the XSLT stylesheet. XSLT stands for eXtensible Stylesheet Language/Transform and the name is apt. XSLT allows a stylesheet author to transform a primary XML document in two significant ways: manipulating and sorting the content, including a wholesale reordering of it if so desired, and transforming the content into a different format (and in the case of Mozilla, the focus is on converting it on the fly into HTML which can then be displayed by the browser).

+

XSLT/XPath reference

+

Elements

+ +

Axes

+ +

Functions

+ +

For Further Reading

+ +

Resources

+

Index

+
+

Original Document Information

+ +
+

{{ languages( { "es": "es/Transformando_XML_con_XSLT", "fr": "fr/Transformations_XML_avec_XSLT", "pl": "pl/Transformacje_XML_z_XSLT", "ko": "ko/Transforming_XML_with_XSLT" } ) }}

-- cgit v1.2.3-54-g00ecf