Home : Tutorials : XML Tutorial


logo.gif (8216 bytes)
 

XSL

XML as a whole includes three components:

  • language (XML)
  • linking (XLL)
  • style (XSL)

XSL (Extensible Style Language), the new style language offers more capabilities than the present Cascading Style Sheet specification for HTML, adding provisions for formatting of elements based on their position in the document, handling of generated text, the definition of formatting macros. The new style language complements XML, which is a way to make Web documents with user-defined tags. It also introduces an extensible set of formatting objects and is the first Web style sheet language that accommodates languages that flow in different directions than right to left.

Frames and tables in HTML were the only tools  to bring some layout into the web, which was quite frustrating, since this limited the control over how content appeared on Web pages. Furthermore there was always a problem of standardization between the web browsers.

For the first time Cascading style sheets (CSS) gave Web developers  more control over style and layout (supported since Netscape Communicator 4.0i and IE 4.0). Best of all, the Cascading Style Sheets, Level 1 (CSS1) specification has  been recommended as an industry standard by the World Wide Web Consortium (W3C). Style sheets work like templates--you define the style for a particular HTML element once, and then use it over and over on any number of Web pages. If you want to change how an element looks, you just change the style: the element automatically changes wherever it appears. (Before CSS, you had to change the element individually, each time it appeared.) Style sheets let Web designers quickly create more consistent pages--and more consistent sites.

But what about layout in XML? Unlike HTML, XML has no implied presentation associated with any of the elements. XML merely provides the ability to format document content, whereas XSL provides the ability to define how the formatted XML content is presented. CSS1, and now CSS2, finally provided a standardized presentation of HTML.

XSL was drafted by representatives from Microsoft, Inso and ArborText as a subset of the Document Style Semantics and Specification Language (DSSSL) developed as a complement to SGML. The DSSSL committee stated that it will work to develop revisions to DSSSL that keep it a compatible superset of XSL. DSSSL proved to be too hard; a simpler subset that applies the principles of rule-based formatting to the Web (which right now needs it more than print) makes a whole lot of sense.

  • XSL is notated with XML element types

  • XSL has DSSSL semantics without DSSSL syntax

  • XSL can specifying a transformation from one DTD (the source document) to another (for a flow-object specification document)

XSL lacks many features one might want to see in a print style sheet (multiple columns, widow & orphan control, and so forth) for example – but its rule-based approach to formatting on the fly is an exciting new development in Web publishing. It will enable an XSL-capable browser to do simple things – like rearranging elements and reformatting them accordingly – that previously could happen only on the server. And it will bring new capabilities, such as adjusting box rules to the dimensions of the type composed within the box, that are not possible in HTML today. Although it goes beyond CSS, XSL is being developed so that its style sheets can be easily translated to CSS for HTML documents.

For publishers that already use SGML, the rapid pace of XML-related development and the noticeably strong interest in it by Microsoft are welcome changes from the past decade, when SGML was relegated to a niche supported only by small software suppliers or by small pockets within larger developers. Though the first XML implementations will likely focus on data processing, not document formatting, the introduction of a Web style sheet language for XML looks promising as the foundation for richer online style presentations in the future.

Just to give you a slight idea about how XSL works, just have a look at an XSL example from the Microsoft XML pages. For further more detailed information on XSL, check the W3C XSL Specifications or check some XSL Tutorials.


back to last pagenext page

 


Home : Tutorials : XML Tutorial

 

Copyright© 1998-2004 All Rights Reserved. No portion of this site may be reproduced or redistributed without prior written permission from VistaEdge Technologies

All registered trademarks appearing on this site are the property of their respective owners. Java is a trademark or registered trademark of Sun Microsystems, Inc. in the United States and other countries. This site is not connected to Sun Microsystems, Inc. and is not sponsored by Sun Microsystems, Inc.