Deep XSL (6)---object Formatting (Goto---object formatting)

Source: Internet
Author: User
Tags object goto xmlns xsl
Object Depth XSL (6)
---object formatting
Translation: Sun Yizhong


Brief introduction

The result tree can be constructed using the objects defined in the formatted Word library to produce the results. We have already learned the basic concepts of formatting objects in the XSL overview, which is usually the name domain of an XML. Each of these element types corresponds to a class of formatted objects. The latest XSL drafts have defined some of these formatting objects. Although it is still in perfect, but we may wish to introduce its foundation and the essence to everybody.

Formatting objects and their properties

Objects that are indicated as non-core do not have to be implemented in the XSL. A formatted object that has already been defined has the following.

Layout formatting objects (Layout formatting Objects)

Page-sequence: Provides a mechanism for defining the primary sequence (sequences) and then combining the content with these master sequences.
Simple-page-master: Describes the normal layout or layout sequence (print or online status) of a Web page.
Content Flow Object (Objects)

Queue: The content that is substituted in the page sequence.
Sequence: grouping content and allowing shared inheritance properties to be allocated.
List: Make all items into a single listing.
List-item: Combines their list item labels and principals for each item in the list.
List-item-label: Saves a number or label for a list item.
List-item-body: Saves the body contents of a list item.
Block: Used to denote paragraphs, headings, descriptions, etc.
Character: The atomic unit of the formatter. Use it when you need to explicitly overload a character or string that has a specific representation font.
Rule-graphic: Can be used to draw a graphic line to divide a page into several areas.
Graphic: Save a picture or vector image. The XSL may be substituted for the inline or block level. The content of the graphic may be an internal flow or an external connection.
Score: Prominent text. Produce underline, cross through line, on marking, etc.
Boxes: Sets the background and border.
Inline-box: A prominent text or image. Creates borders and backgrounds. Controls the spacing of content.
Block-level-box: A prominent text or image. Creates borders and backgrounds. Controls the spacing of content.
Building Blocks: Instructs the formatter to construct a text object at the current position of the content stream.
Page-number: Causes the formatter to produce page numbers.
Online Flow Objects
Link: Web browser links.
Link-end-locator: A linked target or object.
 

Attached: Full XSL instance

The following is a simple but complete example of a style sheet.

<?xml version= ' 1.0 '?>
<xsl:stylesheet xmlns:xsl= "Http://www.w3.org/TR/WD-xsl"
xmlns:fo= "Http://www.w3.org/TR/WD-xsl/FO" result-ns= "fo" indent-result= "yes" >
<xsl:template match= '/' >
<fo:page-sequence font-family= "serif" >
<fo:simple-page-master name= ' scrolling '/>
<fo:queue queue-name= ' body ' >
<xsl:process-children/>
</fo:queue>
</fo:page-sequence>
</xsl:template>
<xsl:template match= "title" >
<fo:block font-weight= "Bold" >
<xsl:process-children/>
</fo:block>
</xsl:template>
<xsl:template match= "P" >
<fo:block>
<xsl:process-children/>
</fo:block>
</xsl:template>
<xsl:template match= "emph" >
<fo:sequence font-style= "Italic" >
<xsl:process-children/>
</fo:sequence>
</xsl:template>
</xsl:stylesheet>

 

The source file for the XML is

<doc>
<title>an example</title>
<p>this is a test.</p>
<p>this is <emph>another</emph> test.</p>
</doc>

 

It will produce the following results:

<fo:page-sequence xmlns:fo= "Http://www.w3.org/TR/WD-xsl/FO" font-family= "serif" >
<fo:simple-page-master name= "scrolling"/>
<fo:queue queue-name= "Body" >
<fo:block font-weight= "Bold" >an example</fo:block>
<fo:block>this is a test.</fo:block>
<fo:block>this is <fo:sequence font-style= "italic" >another</fo:sequence> test.</fo:block>
</fo:queue>
</fo:page-sequence>



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

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.