Deep XSL (2)---style sheet structure (turn)

Source: Internet
Author: User
Tags define object constant include xsl domain
Style sheet Depth xsl (2)
---style sheet structure
Translation: Sun Yizhong

In an XML file, a style sheet is represented by an element xsl:stylesheet. The XSL processor must use the XML name Domain (Namespace) mechanism [the Global XML Names] When processing source files and style sheets. All XSL-defined elements (with prefix xsl in the file) are only those that are URI-http://www.w3.org/TR/ A name field in the wd-xsl is not recognized by the XSL; XSL-defined elements are recognized only in the stylesheet, not in the source file.

The Xsl:stylesheet element has an optional property result-ns, and its value needs to have a name domain prefix. If this property is specified, all result elements must belong to the name domain defined by the prefix. If a named domain is determined as the default name domain, The result element that belongs to that field can be assigned a value with an empty string. The Result-ns property defines the name domain of the XSL Format object, and in addition to constructing the XML result tree, the XSL processor interprets it according to the semantics defined in the required file. The URI of the name field of the XSL formatted object is HTTP ://www.w3.org/tr/wd-xsl/fo. Prefix FO: Represents the Name field. Xsl:stylesheet elements can contain the following types of elements:

1. Xsl:import
2. Xsl:include
3. Xsl:id
4. Xsl:strip-space
5. Xsl:preserve-space
6. Xsl:define-macro
7. Xsl:define-attribute-set
8. Xsl:define-constant
9. Xsl:template

The following example shows the structure of a style sheet. The ellipsis indicates that the property value or content can be omitted there. The elements can appear more than once in the stylesheet or not appear.

<?xml version= "1.0"?>
<xsl:stylesheet xmlns:xsl= "Http://www.w3.org/TR/WD-xsl" >

<xsl:import href= "..."/>

<xsl:include href= "..."/>

<xsl:id attribute= "..."/>

<xsl:strip-space element= "..."/>

<xsl:preserve-space element= "..."/>

<xsl:define-macro name= "..." >
...
</xsl:define-macro>

<xsl:define-attribute-set name= "..." >
...
</xsl:define-attribute-set>

<xsl:define-constant name= "..." value= "..."/>

<xsl:template match= "..." >
...
</xsl:template>

</xsl:stylesheet>

The order in which elements appear is not specified except for Xsl:import elements and error recovery. Users can be sorted according to their own needs, and the production tools of stylesheets do not need to control the order in which elements appear.


--------------------------------------------------------------------------------


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.