Contrary to when style information is hard-coded into the content, separation of style from content allows for the same data to be presented in different ways. This enables:
reuse of fragments of data: the same content should look different in different contexts
multiple output formats: different media (paper, online), different sizes (manuals, reports), different classes of output devices (workstations, hand-held devices)
styles tailored to the reader's preference (e.g., accessibility): print size, color, simplified layout for audio readers
standardized styles: corporate stylesheets can be applied to the content at any time
freedom from style issues for content authors: technical writers needn't be concerned with layout issues because the correct style can be applied later
A stylesheet specifies the presentation of XML information using two basic categories of techniques:
An optional transformation of the input document into another structure
A description of how to present the transformed information (i.e., a specification of what properties to associate to each of the various parts of the transformed information)
Transformation capabilities include:
generation of constant text
suppression of content
moving text (e.g., exchanging the order of the first and last name)
duplicating text (e.g., copying titles to make a table of contents)
sorting
more complex transformations that "compute" new information in terms of the existing information
Description of how to present the (possibly transformed) data includes three levels of formatting information:
Specification of the general screen or page (or even audio) layout
Assignment of the transformed content into basic "content container types" (e.g., lists, paragraphs, inline text)
Specification of formatting properties (spacing, margins, alignment, fonts, etc.) for each resulting "container"