XSLT allows you to create formatting structures which interpret and modify the existing XML elements. Learn about the syntax of XSLT elements, how the namespace attribute differs depending on the browser in use, and how to transform original XML elements.
An Introduction to XSLT - Block Level Elements (Page 6 of 6 )
Content is organized in the stylesheet as descendants of either the fo:flow or fo:static content elements, and appear in the resulting document as block level containers, rectangular areas preceded and followed by line breaks. Example of block-level elements include:
- fo:block - fo:list - fo:list-item
The basic syntax of block-level elements is as follows:
Think of these block-level containers as the same as the <div> tag in HTML. The block-level containers all have a similar set of properties with which you can control how they appear in the resulting document; there are font properties, margin and padding properties, alignments, columns, backgrounds and borders. They are set in the following way:
<fo:block font-size="12pt">
An example of an extremely basic XSL (XSL-FO) document is:
Save this file again with the filename news3.xml. Now open news3.xml and it should simply say 'DevShed Rocks!' The original content of news.xml is not displayed, but as you can use XSLT to do this, it doesn't really matter. There are many properties and attributes that can be set to these elements, far too many to list them all here. I hope that I have given you enough information to make use of XSLT and to understand the basics of XSL (the formatting language).
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.