[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: `High-level' format specifications with XSL?

Subject: Re: `High-level' format specifications with XSL?
From: Kai Grossjohann <grossjohann@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: 07 Jul 1998 18:28:28 +0200
html 1.0 tag
>>>>> Paul Grosso <paul@xxxxxxxxxxxxx> writes:

  > I probably worded things poorly above.  The key point I was trying
  > to make is that XML by itself has no presentational semantics, and
  > the point of a stylesheet is precisely to allow the association of
  > presentation (and perhaps other) semantics with arbitrary XML.  So
  > saying you want a stylesheet language that doesn't require you to
  > specify presentational semantics is an oxymoron.

I know that.  What I wanted to get at is that it is possible to
specify presentational semantics on different levels of abstraction.
At the lowest level of abstraction you would have to say `put a green
pixel here and a red one there' (this is also known as raster
graphics, I guess).  At a somewhat higher level of abstraction you
would say `put a Times Roman ten point upright A here and a Times
Roman ten point upright b there.'  That's what you do in a DVI file
(as produced by TeX).  At a still higher level, you say `put a Times
Roman ten point paragraph here, left justified with a left margin of
3pt and a right margin of 5pt on a 42pt line width and a line spacing
of ...'  You get the idea.  This is what you do in XML (stylesheet
part thereof), it seems.

At a *still* higher level, you say `put a section heading here'.  This
is the level I'd like to use.

  > If by "Web browser" you mean something that has built-in
  > processing for the HTML tag set, then you aren't really wanting a
  > stylesheet language.  You want some way to map your XML into
  > HTML--perhaps augmented by CSS and/or some script--that the
  > browser will handle.

Well, I hope I mentioned XSL in my original post without specifying
whether I wanted the stylesheet part or the transformational part...
Anyway, at the time I wrote that I didn't really know that this
distinction from DSSSL carried over to XSL, too.

Yes, it seems I want to transform XML to HTML.

  > And it just so happens that the transformation capabilities of XSL
  > may be able to help here.

Good.  But just how would it do that?  Remember that I'm currently
using xslj (by Henry or Harry Thomson, the thing that converts XSL to
extended DSSSL for processing with jade).  How would I write a foo.xsl
file which causes xslj to produce a foo.dsl file which in turn causes
jade to transform XSL to HTML?

I think I tried the obvious (to me) approach: I wrote rules like the

|   <rule> 
|     <target-element type="projecttitle">
|     </target-element>
|     <H1> 
|       <children/>
|     </H1>
|   </rule>

This didn't work, though.  It produced errors like this:

| xslj:project.xsl:29:7:E: element "H1" undefined                  
| xslj:project.xsl:29:4:W: unknown flow-object spec or macro       
| xslj:project.xsl:35:8:E: end tag for "rule" which is not finished

Now, I know that I must've done something very stupid.  But what was
it?  How can I use XSL (xslj) to do XML-to-HTML conversions?

>>>>> Kai wrote:

  > One additional aspect that comes to mind for on-screen presentation is
  > that different users like different fonts in their Web browsers.  I
  > don't want to make them use the fonts I like, I want them to be able
  > to choose theirs.  And I want to make them be able to choose whether
  > they like their headings green or blue or bold or italic or underlined
  > or ... you get the idea.  And I want the users to be able to choose
  > their spacing, too!  And the justification of the text, and so on.

>>>>> Paul replies:

  > I'm not sure where "the users" come into your scenario.  Are they
  > producing the XML, writing style or transformation specs, viewing
  > the results in a browser, or all of the above?  How is it that you
  > expect the users to choose fonts and spacing and so on?

I wrote project-foo.xml, project.xsl and produced project.dsl (with
xslj from project.xsl) and project-foo.html (with jade from
project.dsl and project-foo.xml).  The `users' are the people looking
at project-foo.html with a Web browser (Netscape, say).

These people can choose fonts and spacing by choosing a Web browser.
Lynx produces strikingly different output than Netscape and Mosaic,
for instance.  Also, Netscape allows you to select a font (type and
size).  (Don't know about spacing, though.)

  > In this transformation mode, what you end up seeing in a browser
  > has almost nothing to do with the "capabilities" of XSL, since the
  > XSL transformation spec is just specifying an arbitrary
  > transformation process.  If you don't like what you see as a
  > result, that is due either to the fact that the specified
  > transformation isn't generating what is necessary or the browser
  > isn't displaying it as you hoped.

Well, I wanted to generate the following:

| <HTML><BODY>  
|   <H1>Project Foo</H1>
|   <P>...with a really short description.</P>
| </BODY></HTML>

But I couldn't generate this using xslj because it wouldn't let me
specify the H1 tag in the output.

Please note: in the above I have used very simple-minded examples,
married very strictly to the HTML 1.0 tag set and the semantics of
that as implemented by the initial versions of Mosaic and Netscape.

Please don't let that lead you into thinking that I am that

I recognize that the HTML 1.0 tag set isn't the is-all and be-all of
formatting output for on-screen presentation.  Instead, what I am
trying to say is that there are different levels of abstraction which
one can use to specify one's output.  And I want to use a level of
abstraction which is higher than the one provided by
XSL-with-HTML-flow-objects (as I understand it).  I don't want to
specify things like whether headings should be bold or underlined.  I
want to specify I want a heading, and what a heading looks like should
be defined by someone else.  In the case of HTML 1.0 that someone else
is the implementor of the HTML viewer (or Web browser, or whatever).
In the case of LaTeX, that someone else is the implementor of the .sty
or .cls file.

I do think, however, that it would be convenient if I could just use
the HTML tag set, as there are already some very popular programs
which do nicely looking on-screen presentation of these documents, and
user-configurable, too!  (Remember that Preferences dialog?)

I want it tomorrow.

You ate somebody? -- Just a leg. -- That's terrible! -- Not with mustard.
(Terry Pratchett: Interesting Times)

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.