[CONTACT]

[ABOUT]

[POLICY]

[ADVERTISE]

DOCTYPE HTML PUBLIC DTD HTML

Found at: ftp.icm.edu.pl:70/packages/normos/w3c/NOTE-XSL-and-CSS

<!DOCTYPE  HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<HEAD>
<TITLE>Using XSL and CSS together</TITLE>
<STYLE TYPE="text/css">
@import url(http://www.w3.org/StyleSheets/TR/W3C-NOTE.css);
</STYLE>
</HEAD>

		
<BODY>

		
<DIV CLASS="head" ALIGN="center">

		
<DIV ALIGN="right">
  <P><A HREF="http://www.w3.org/">
    <IMG ALIGN="left" ALT="W3C" BORDER="0" SRC="http://www.w3.org/Icons/WWW/w3c_home">
  </A>
  <STRONG>NOTE-XSL-and-CSS-19980911</STRONG></P>
</DIV>

		
<BR CLEAR="left">

		
<H1>Using XSL and CSS together</H1>

		
<H3>W3C Note, 11 September 1998</H3>

		
</DIV>

		

		
<DL>
<DT>This version</DT>
<DD>
<A HREF="1998/NOTE-XSL-and-CSS-19980911" W3MIRHREF="http://www.w3.org/TR/1998/NOTE-XSL-and-CSS-19980911">
http://www.w3.org/TR/1998/NOTE-XSL-and-CSS-19980911</A>
</DD>

		
<DT>Latest version</DT>
<DD>
<A HREF="NOTE-XSL-and-CSS" W3MIRHREF="http://www.w3.org/TR/NOTE-XSL-and-CSS">
http://www.w3.org/TR/NOTE-XSL-and-CSS</A>
</DD>

		

		

		
<DT>Authors</DT>
<DD>
H&aring;kon Lie (<A HREF="mailto:/howcome@w3.org">howcome@w3.org</A>),
Bert Bos (<A HREF="mailto:/bert@w3.org">bert@w3.org</A>)
</DD>
</DL>

		
<P>
<SMALL><A HREF="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</A> &copy;
1998 <A HREF="http://www.w3.org/">W3C</A>
(<A HREF="http://www.lcs.mit.edu/">MIT</A>,
<A HREF="http://www.inria.fr/">INRIA</A>,
<A HREF="http://www.keio.ac.jp/">Keio</A>), All Rights Reserved. W3C
<A HREF="http://www.w3.org/Consortium/Legal/ipr-notice#Legal%20Disclaimer">liability,</A>
<A HREF="http://www.w3.org/Consortium/Legal/ipr-notice#W3C%20Trademarks">trademark</A>,
<A HREF="http://www.w3.org/Consortium/Legal/copyright-documents">document use </A>and
<A HREF="http://www.w3.org/Consortium/Legal/copyright-software">software licensing </A>rules
apply. Your interactions with this site are in accordance with our
<A HREF="http://www.w3.org/Consortium/Legal/privacy-statement#Public">public</A> and
<A HREF="http://www.w3.org/Consortium/Legal/privacy-statement#Members">Member</A> privacy
statements.</SMALL>

		

		
<H2>Status of this document</H2>

		
<P CLASS="first">This document is a NOTE made available by the W3
Consortium for discussion purposes. This indicates no endorsement of its
content, nor that the Consortium has, is, or will be allocating any
resources to the issues addressed by the NOTE.

		
<P>The note is published in the hope that it may provide
a useful viewpoint for understanding the relation between various Web
specifications.

		
<P>Comments should be sent to the authors. 

		

		
<H2><A NAME="pgfId=1000031"></A> Abstract</H2>

		
<P CLASS="first"><A NAME="pgfId=1000035"></A> This W3C Note describes
how <A HREF="#ref-XSL" W3MIRHREF="http://www.w3.org/TR/NOTE-XSL-and-CSS#ref-XSL">XSL [1]</A> and <A HREF="#ref-CSS" W3MIRHREF="http://www.w3.org/TR/NOTE-XSL-and-CSS#ref-CSS">CSS [2]</A>
can be used together. In particular, it
discusses how XSL can be used as a bridge between complex XML-based
documents and the CSS formatting model. It gives an outline of a
system for displaying documents in XML-based formats as
human-readable, or human-audible, text. To use the CSS properties in
the language of XSL, it is necessary to invent an XML-based syntax,
compatible with XSL, to represent CSS's properties. No new CSS
properties, or other formatting semantics, are defined in this
document.</P>

		

		
<H2><A NAME="pgfId=1000025"></A> Introduction</H2>

		
<P CLASS="first"><A NAME="pgfId=1000040"></A> <A HREF="http://www.w3.org/Style/CSS">CSS</A> is a powerful and easy to use formatting
language. The two levels defined to date, CSS1 and CSS2, offer a
wealth of formatting
properties, and the next level promises to add even more. CSS is
implemented by many programs and the experience from those
implementations is being fed back into the development of more
advanced formatting properties.</P>

		
<P><A NAME="pgfId=1007817"></A> CSS, however, is <EM CLASS="Emphasis">only</EM> a formatting language: it attaches
style properties to the elements of a source document. It lacks
facilities
commonly found in report generators, mail-merge programs, etc., for
massaging a set of data into a human-readable format. It assumes that
process has been done by an external program. In effect, that is how
much of the information on the Web today is produced: information from
a database at the server side is extracted and put into an HTML
template, which is sent to a client (browser) and formatted and
displayed.</P>

		
<P><A NAME="pgfId=1007823"></A> With the advent of <A HREF="http://www.w3.org/XML">XML</A>, the expectation is that in many cases the
original data, rather than the HTML representation of it, will be sent
to the client. This gives the client a richer data-set to work with,
but data transformations may be necessary. <A HREF="http://www.w3.org/Style/XSL">XSL</A> will be able to perform these
transformations.</P>

		
<P><A NAME="pgfId=1000050"></A>We can see several ways of
using XSL and CSS together:</P>

		
<OL>

		
<LI><A NAME="pgfId=1007830"></A> Using XSL on the
server to transform XML data into HTML documents with CSS style
sheets. This has the benefit of being backwards compatible with a
large installed base of User Agents. In the short term, this is likely
to be the most common combination of XSL and CSS. Due to the
well-known semantics of HTML, this is also the best way to ensure that
information in lesser-known XML formats is accessible (<EM CLASS="Foreign-word">e.g.,</EM> to people using different output media).

		
<LI>Using XSL on the server to transform XML data into
XML documents with CSS style sheets. XML, unlike HTML, comes with no
formatting conventions and will always need a style sheet to be
displayed. This method requires new functionality in User
Agents. Unless there are XSL sheets provided for
different media, this may lead to accessibility problems.

		
<LI>Using XSL to generate HTML/CSS on the client
side. The content is passed through HTML/CSS to take advantage of
current implementations, but is never made available in this form.
This method requires new functionality in User Agents.

		
<LI><A NAME="pgfId=1007841"></A> Transform directly
to "CSS formatting objects". Compared to the previous method, this
method is more direct as the content isn't converted to/from HTML. It
requires new functionality in User Agents. Unless there are XSL sheets
provided for different media, this may lead to accessibility
problems.

		
</OL>

		
<P CLASS="first">This note only concerns itself with the last method.
This document shows how the set of "CSS objects" might be defined.</P>

		
<H2><A NAME="pgfId=1000052"></A> XSL basics</H2>

		
<P CLASS="first"><A NAME="pgfId=1000056"></A> The XSL language is
still under development. At the time of writing, it is a W3C Working
Draft. All syntax shown here is therefore tentative,
and only meant to introduce the concepts.</P>

		
<P><A NAME="pgfId=1007771"></A> The bulk of an XSL sheet
is a series of pattern-action rules. The patterns are similar to CSS's
<A HREF="REC-CSS2/selector" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/selector">selectors</A> (in function, not
necessarily in syntax), but the action part may
create an arbitrary number of "objects." The action part of the rule
is called the "template" in XSL, and a template and a pattern together
are referred to as a "template rule."</P>

		
<P><A NAME="pgfId=1007850"></A> An author of an XSL sheet
selects a suitable set of objects for his task. The set of objects
could be anything for which a specification exists that defines their
syntax inside XSL templates; below we show how that specification
might look for CSS. The objects need not be formatting objects: they
could, <EM CLASS="Foreign-word">e.g.</EM>, be objects that create <A HREF="REC-SMIL" W3MIRHREF="http://www.w3.org/TR/REC-SMIL">SMIL</A> elements or <A HREF="http://www.w3.org/MetaData/RDF">RDF</A> elements. In principle, when an XML
syntax for a
data-format already exists, it should be fairly easy to derive an XSL
template format from that.</P>

		
<P>An XSL sheet looks like an XML document with a mixture
of two kinds of elements: those defined by XSL and those defined by
the object language.

		
<P><A NAME="pgfId=1000057"></A> The result of applying
all matching patterns to a document recursively is a tree of objects.
The resulting tree of objects is then interpreted, top-down, according
to the definition of each object. If they are (hypothetical) HTML
objects, they will produce an HTML document, probably one HTML element
for each HTML object. If they are, as in this note, CSS objects, they
will produce a certain rendering on screen or in some other medium.

		
<P><A NAME="pgfId=1000060"></A> To give a simple
example, the template rule below shows how one XML element
("partnumber") expands to a series of CSS objects, with the content of
the XML element expanded inside it. "Process-children" indicates the
place where the content of partnumber should be put. The elements
"template" and "process-children" are defined by XSL; "chunk" is a CSS
object (defined by this note). The non-XSL elements must be prefixed
with a short string that ends in a colon, to distinguish them from XSL
keywords; in this note we've used "css:".</P>

		
<PRE CLASS="XML">&lt;template match="partnumber">
  &lt;css:chunk display="block"
            font-weight="bold"
            margin-top="20px">
    &lt;css:chunk display="inline"
              color="red">
      Part number:&lt;css:space/>
    &lt;/css:chunk>
    &lt;css:chunk color="green">
      &lt;process-children/>
    &lt;/css:chunk>
  &lt;/css:chunk> &lt;!-- end of block -->
&lt;/template></PRE>

		
<P CLASS="first">CSS also supports aural renderings. A similar
template that produces CSS objects for audio output might be:

		
<PRE CLASS="XML">&lt;template match="partnumber">
  &lt;css:chunk speak="normal"
            voice-family="female"
            cue-before="partnumber-jingle.au"
            pause-after="15ms">
    Part number:
    &lt;process-children/>
  &lt;/css:chunk>
&lt;/template></PRE>

		
<P CLASS="Body1">These examples only serve to give the flavor of
XSL. XSL supports much more powerful transformations than these two
examples show.

		
<H3><A NAME="pgfId=1007733"></A> Declaring the CSS
objects</H3>

		
<P CLASS="first"><A NAME="pgfId=1007737"></A> As explained above, XSL
is designed to be used with different sets of objects. The <SPAN CLASS="Attribute">result-ns</SPAN> attribute at the top of the XSL
sheet declares the short string that is used as the prefix (we've
chosen "css" in this note, but we could have used "fo", or "r", or
anything else), and another attribute then binds the prefix to the
definition of the objects:</P>

		
<PRE CLASS="XML">&lt;stylesheet
    result-ns="css"
    xmlns:css="http://www.w3.org/TR/XSL-for-CSS">
  ... rest of sheet, with CSS objects...
&lt;/stylesheet></PRE>

		
<P CLASS="first">Note: as explained earlier, the syntax of XSL is
still being developed. Although there will be ways to write selectors
(patterns) and templates, and declare the set of objects, the syntax
will not be frozen until XSL is issued as W3C Recommendation.

		
<H2><A NAME="pgfId=1007759"></A> Principles for creating the
CSS objects</H2>

		
<P CLASS="first"><A NAME="pgfId=1007871"></A> CSS doesn't have an XML
syntax, which makes defining its XSL template syntax slightly harder
than it would be for, <EM CLASS="Foreign-word">e.g.</EM>, <A HREF="REC-SMIL" W3MIRHREF="http://www.w3.org/TR/REC-SMIL">SMIL</A> or <A HREF="REC-MathML" W3MIRHREF="http://www.w3.org/TR/REC-MathML">MathML</A>.
Below are a few principles for the conversion, and some examples of
the result.</P>

		
<P><A NAME="pgfId=1007878"></A> CSS has properties like
<A HREF="REC-CSS2/fonts#font-shorthand" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/fonts#font-shorthand"><STRONG CLASS="Property">font</STRONG></A> and <A HREF="REC-CSS2/box#border-shorthand-properties" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/box#border-shorthand-properties"><STRONG CLASS="Property">border</STRONG></A>, but also <A HREF="http://www.w3.org/TR/REC-CSS2/fonts#font-size-props"><STRONG CLASS="Property">
font-size</STRONG></A> and <A HREF="REC-CSS2/box#border-shorthand-properties" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/box#border-shorthand-properties"><STRONG CLASS="Property"> border-top</STRONG></A>, which allow small aspects
of a font or border to be specified. The CSS objects for XSL could either
maintain this redundancy, or allow only one way to set a property. To
minimize the number of surprises for people using the CSS objects,
allowing both the shorthand and the individual properties is probably
advisable.</P> 

		
<P><A NAME="pgfId=1007881"></A> CSS properties become XML
attributes in the XSL syntax. Some CSS properties (<A HREF="REC-CSS2/fonts#font-family-prop" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/fonts#font-family-prop"><STRONG CLASS="Property">font-family</STRONG></A>, <A HREF="REC-CSS2/generate#content" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/generate#content"><STRONG CLASS="Property">
content</STRONG></A>) accept both quoted strings and keywords. In the
XSL syntax that would become <CODE CLASS="XML">font-family="'Times
Roman', serif"</CODE>, which invites errors. Some possible ways to
avoid double quoting are given below.</P>

		
<P><A NAME="pgfId=1002710"></A> The main CSS object is
called <CODE CLASS="Element">chunk</CODE>. A chunk has properties and
usually some text content and/or embedded objects (often other
chunks). If the output medium is visual, a chunk typically produces a
single box, although it may also produce multiple boxes, if its
'display' property is 'inline', or no boxes at all, if 'display' is
'none'.

		
<P>Some auxiliary objects may be necessary, either
variants of chunks with extra functionality (<EM CLASS="Foreign-word">e.g.</EM>, <CODE CLASS="Element">anchor</CODE>),
or objects to get around restrictions on XSL syntax (<EM CLASS="Foreign-word">e.g.</EM>, <CODE CLASS="Element">switch</CODE>).
A <CODE CLASS="Element">chunk</CODE> is reminiscent of the {...}-block
of a normal CSS rule. For example:</P>

		
<PRE CLASS="CSS">{
  font-size: 10px;
  color: #FB9;
  text-indent: 1em
}</PRE>

		
<P>would become:</P>

		
<PRE CLASS="XML">&lt;css:chunk
  font-size="10px"
  color="#FB9"
  text-indent="1em"></PRE>

		

		
<H3><A NAME="pgfId=1000084"></A> Pseudo-classes</H3>

		
<P CLASS="first"><A NAME="pgfId=1008593"></A> <A HREF="http://www.w3.org/TR/REC-CSS2/selector#pseudo-elements">Pseudo-classes</A> in CSS
serve to select elements based on information other than what can be
learned from the source document. Examples are ":active," ":visited,"
and ":hover." One way to handle them is with a switch object that
contains chunks for all possible states, and let the renderer switch
between the chunks, based on the truth of some condition attached to
them. For example:</P>

		
<PRE CLASS="XML">&lt;css:switch text-decoration="underline"
            background="red"
            font-style="italic">
  &lt;css:chunk condition="active | hover"
              color="...">...&lt;/>
  &lt;css:chunk condition="visited"
              color="...">...&lt;/>
&lt;/css:switch></PRE>

		
<P CLASS="first"><A NAME="pgfId=1008624"></A> The <CODE CLASS="Element">switch</CODE> object contains the properties common to
the alternatives, and each alternative has a <SPAN CLASS="Attribute">condition</SPAN> attribute that contains the
condition under which this chunk is displayed. (If there is more than
one URL, a condition like "visited" also needs a way to indicate <EM CLASS="Emphasis">which</EM> URL is visited.)</P>

		
<P><A NAME="pgfId=1008631"></A> Note that the <A HREF="REC-CSS2/selector#first-child" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/selector#first-child">"first-child"
pseudo-class</A> is handled by XSL's patterns directly.</P>

		

		
<H3><A NAME="pgfId=1000089"></A> Pseudo-elements</H3>

		
<P CLASS="first"><A NAME="pgfId=1008632"></A> <A HREF="http://www.w3.org/TR/REC-CSS2/selector#pseudo-elements">Pseudo-elements</A> in
CSS refer to parts of a displayed element, for which there is no (or
cannot be) mark-up in the source document. <A HREF="REC-CSS2/generate#before-after-content" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/generate#before-after-content">":Before" and
":after"</A> are used to insert new elements where the source didn't
have any, and <A HREF="REC-CSS2/selector#first-letter" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/selector#first-letter">":first-letter"</A> and <A HREF="http://www.w3.org/TR/REC-CSS2/selector#first-line-pseudo">":first-line"</A> refer
to the first letter/line of a block box as actually displayed on the
screen.</P>

		
<P><A NAME="pgfId=1008635"></A> Since XSL templates allow
an arbitrary number of objects to be created, the ":before" and
":after" are automatically catered for. The ":first-letter" and
":first-line" probably need something like the switch object above.
For example:</P> 

		
<PRE CLASS="XML">&lt;css:compound font="12pt Times"
              line-height="1.2"
              text-align="left">
  &lt;css:first-line font-variant="small-caps"
                  color="green"/>
  &lt;process-children/>
&lt;/css:compound></PRE>

		
<P CLASS="first"><A NAME="pgfId=1008643"></A> The <CODE CLASS="Element">compound</CODE> object is like a normal <CODE CLASS="Element">chunk</CODE>, but it may have two special children,
<CODE CLASS="Element">first-line</CODE> and <CODE CLASS="Element">first-letter</CODE>, that hold the properties of the
pseudo-elements.</P>

		
<H3><A NAME="pgfId=1000030"></A> Page box</H3>

		
<P CLASS="first"><A NAME="pgfId=1008654"></A> For paged media, CSS2
allows the characteristics of the pages to be described with @-rules.
Since XSL has no place for global declarations (at least not in the
August 1998 draft), the best place to put
them is probably near the root of the generated object tree. An <A HREF="REC-CSS2/page#page-box" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/page#page-box">@page-rule</A> might translate to a
<CODE CLASS="Element">page</CODE> object:</P>

		
<PRE CLASS="XML">&lt;template match="/">
  &lt;css:page size="landscape"
            margin="1.5in 1in"
            marks="crop"/>
  &lt;css:page name="left"
            .../>
  &lt;css:page name="rotated"
            .../>
&lt;/template></PRE>

		
<H3><A NAME="pgfId=1000100"></A> Media types</H3>

		
<P CLASS="first"><A NAME="pgfId=1000108"></A> Selection of output <A HREF="REC-CSS2/media" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/media">medium</A> could be handled outside of XSL,
like it is for CSS level&nbsp;1. That means that to write an XSL sheet
for two media, say print and screen, one has to write two sheets. They
could still import a sheet with common rules.</P>

		
<H3><A NAME="pgfId=1008650"></A> Web-fonts</H3>

		
<P CLASS="first"><A NAME="pgfId=1008663"></A> Another @-rule in CSS is
the one for defining <A HREF="REC-CSS2/fonts#font-selection" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/fonts#font-selection">Web-fonts</A>. These, again,
should probably become objects that are attached close to the root of
the object tree:</P>

		
<PRE CLASS="XML">&lt;template match="/">
  &lt;css:font font-family="Pantani"
            panose1="4726402695"
            font-style="all" />
&lt;/template></PRE>

		
<H3><A NAME="pgfId=1000109"></A> Replaced elements</H3>

		
<P CLASS="first"><A NAME="pgfId=1000113"></A> <A HREF="REC-CSS2/conform#q1" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/conform#q1">Replaced elements</A> could be handled
with a <CODE CLASS="Element">replaced</CODE> object, which has the
combined attributes of the <CODE CLASS="Element">chunk</CODE> and the
<A HREF="REC-html40" W3MIRHREF="http://www.w3.org/TR/REC-html40"><CODE CLASS="Element">object</CODE></A>
element from HTML:</P>

		
<PRE CLASS="XML">&lt;css:replaced src="/Icons/w3c_home.png"
              type="image/png"
              params="..."
              border="solid red"
              .../></PRE>

		
<H3><A NAME="pgfId=1008707"></A> Interactive elements</H3>

		
<P CLASS="first"><A NAME="pgfId=1008711"></A> Hyperlink source anchors
and form elements have not only style, but also a behavior when a user
activates them. In CSS that behavior doesn't need to be specified,
since the displayed boxes on the screen have a direct link to elements
in the source, and those elements come with their own semantics.
Because of the transformation that takes place in XSL templates, that
back-link is not available, and the transformation needs to carry any
behavior information forward from the source elements to the generated
objects. How this can best be done is still an open issue. Introducing
objects like <CODE CLASS="Element">anchor</CODE> (like <CODE CLASS="Element">chunk</CODE>, but with an extra <CODE CLASS="Attribute">href</CODE> attribute), and <CODE CLASS="Element">form, input,</CODE> etc. may be a solution.</P>

		
<H3><A NAME="pgfId=1008714"></A> Counters &amp; the content
property</H3>

		
<P CLASS="first"><A NAME="pgfId=1008718"></A> To make the syntax
slightly easier to read, it may be possible to make <A HREF="REC-CSS2/generate#counters" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/generate#counters">counters</A> into <CODE CLASS="Element">counter</CODE> objects. XSL allows literal text to be
inserted in the templates directly, obviating the need for the <A HREF="REC-CSS2/generate#content" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/generate#content">content</A> property.

		
<P>There are several possibilities for defining
whitespace handling inside templates. The easiest seems to be to
define that whitespace in templates is not significant, except as
separator between words. Another way to express this is to say that
whitespace is collapsed: leading and trailing whitespace is removed,
and any other sequences of whitespace characters replaced by a single
space. To get extra spaces, or newlines or tabs, they have to be
inserted explicitly. Below we will use <CODE CLASS="Element">space</CODE> to insert a space and <CODE CLASS="Element">newline</CODE> to insert a hard line break. XSL will
probably provide a generic <CODE CLASS="Element">text</CODE> object
for that (somewhat similar to the <CODE CLASS="Element">pre</CODE> of
HTML), in which case <CODE CLASS="Element">space</CODE> and <CODE CLASS="Element">newline</CODE> can be defined as XSL macros.</P>

		
<PRE CLASS="XML">&lt;template match="fig">
  &lt;css:chunk text-align="center">
    Figure
    &lt;css:space/>
    &lt;css:counter name="figno" style="upper-alpha"
                 font-weight="bold"
                 color="blue" />
    &lt;css:newline/>
    &lt;process-children/>
  &lt;/css:chunk>
&lt;/template></PRE>

		
<P CLASS="first">XSL provides a predefined object that inserts the
value of an attribute. Using that, the attr(...) function of CSS would
be replaced by</P>

		
<PRE CLASS="XML">&lt;value-of expr="attribute(...)" /></PRE>

		

		
<H3><A NAME="pgfId=1008734"></A>Other string-valued
properties</H3>

		
<P CLASS="first"><A NAME="pgfId=1008738"></A> <A HREF="REC-CSS2/fonts#font-family-prop" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/fonts#font-family-prop"><STRONG CLASS="Property">Font-family</STRONG></A> is another property that
uses a mixture of quoted strings and keywords. It could be split into
two. That would make the inheritance model different, but avoid quotes
inside quotes:</P>

		
<PRE CLASS="XML">&lt;css:chunk font-family="Helvetica, gill sans"
            generic-font-family="sans-serif">...&lt;/></PRE>

		
<P><STRONG><SPAN CLASS="Property"><A HREF="REC-CSS2/text#propdef-text-align" W3MIRHREF="http://www.w3.org/TR/REC-CSS2/text#propdef-text-align">text-align</A></SPAN></STRONG>
also accepts strings; a similar split might be possible.</P>

		

		
<H3><A NAME="pgfId=1002738"></A> Specialized objects</H3>

		
<P CLASS="first"><A NAME="pgfId=1002742"></A> It may be lead to more
easily readable sheets if a small number of convenience objects, in
the form of "subclasses" or "curried" versions of <CODE CLASS="Element">chunk</CODE>, is added. Obvious candidates are <CODE CLASS="Element">hr</CODE> (horizontal rule, a <CODE CLASS="Element">chunk</CODE> with certain border properties preset),
<CODE CLASS="Element">block</CODE> (a <CODE CLASS="Element">chunk</CODE> with 'display' preset to 'block'), and
<CODE CLASS="Element">inline</CODE> (analogous for 'inline').</P>

		

		
<P>Here is an example of a template rule that uses those derived
objects. It formats <CODE CLASS="Element">para</CODE> elements from
the source document as CSS block elements with a red pilcrow sign at
the end.</P>

		
<PRE CLASS="XML">&lt;template match="para">
  &lt;css:block margin-top="1.2em">
    &lt;process-children />
    &lt;css:inline color="#F00">&para;&lt;/css:inline>
  &lt;/css:block>
&lt;/template></PRE>

		

		
<H2>Acknowledgments</H2>

		
<P>The authors wish to thank Tim Berners-Lee, James Clark, Martin D&uuml;rst,
Chris Lilley, Vincent Quint and Steve Zilles for their comments to
this Note. Still, any views expressed in this Note are solely those of
the authors.</P>

		

		
<H2>References</H2>

		
<DL>
<DT><A NAME="ref-XSL">[1]</A>

		
<DD>Extensible Style Language, XSL, is under
development within W3C. Current plans indicate that XSL will become a
W3C Proposed Recommendation in the middle of 1999. This note is based
on the 18 August 1998 draft (<A HREF="1998/WD-xsl-19980818" W3MIRHREF="http://www.w3.org/TR/1998/WD-xsl-19980818">http://www.w3.org/TR/1998/WD-xsl-19980818</A>)

		
<DT><A NAME="ref-CSS">[2]</A>

		
<DD>Cascading Style Sheets, CSS, is defined in two W3C
Recommendations, Level 1 (<A HREF="REC-CSS1" W3MIRHREF="http://www.w3.org/TR/REC-CSS1">http://www.w3.org/TR/REC-CSS1</A>)
and Level 2 (<A HREF="REC-CSS2" W3MIRHREF="http://www.w3.org/TR/REC-CSS2">http://www.w3.org/TR/REC-CSS2</A>).

		
<!-- 
<dt><A NAME="ref-namespaces">[3]</A>

		
<DD>XML Namespaces is under development within W3C. This note uses the 
draft of 2 August 1998 (<A HREF="1998/WD-xml-names-19980802" W3MIRHREF="http://www.w3.org/TR/1998/WD-xml-names-19980802">http://www.w3.org/TR/1998/WD-xml-names-19980802</A>) 
-->

		
</DL>

		
<!--  Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-declaration:"~/SGML/HTML4.decl"
sgml-default-doctype-name:"html"
sgml-minimize-attributes:t
sgml-nofill-elements:("pre" "style" "br")
sgml-live-element-indicator:t
End:
-->
</BODY>
</HTML>

		

		
.

NEW PAGES:

[ODDNUGGET]

[GOPHER]