xsl-list
[Top] [All Lists]

Re: Style questions (2 questions)

2005-08-23 14:33:15
Hi Rodman,

At 05:05 PM 8/23/2005, you wrote:
Question #1: I have several stylesheets using 'key' and 'generate-id',
so I am familiar with their workings and quirks.  My question is there
a way to do anything EXCEPT equality compares w/ keys.  I have used
work arounds that sometimes make sense and sometimes feels like a hack
(kind of like trying to code sane CSS in I.E.  <g>).

I had a recent problem of transforming a string of words seperated by
spaces back into a nested structure.  E.g.

<post @tag="reference xml"      href="..." />
<post @tag="reference xml xslt" href="..." />
<post @tag="reference html"     href="..." />
<post @tag="linux"              href="..." />

reference
   xml
      xslt
   html
linux

each word is a folder w/ multiple bookmarks in them (ala. del.icio.us).

As I recursed into folders, it would have been nice to get all post(s)
that started with the current @tag.  With keys that would be fast,
without keys and w/XPath alone it was quite slow.

Please, I'm not looking for a stylesheet or a solution; I have one.
This is just a language question ... which, BTW, I'm 99% sure the
answer is you cant.

I don't think I understand the question. If you're asking "are keys useful for things besides grouping things by associated values" the answer is certainly yes. In fact the classic use case for keys isn't for grouping at all, but to support cross-referencing in general.

Question #2: I have seen answers on the list where someone mentions
XSL and XSLT seperately (and deliberately).  I thought the former was
just a shorter version of the latter.  After all, isnt the main
purpose of the language to do transformations?  Is there a difference?

This confusion is due to the historical emergence of XSLT as a component of XSL. The purpose of XSL ("Extensible Stylesheet Language") is *not* to "do transformations" -- it is (as the XSL Rec says)

Given a class of arbitrarily structured XML documents or data files, designers use an XSL stylesheet to express their intentions about how that structured content should be presented; that is, how the source content should be styled, laid out, and paginated onto some presentation medium, such as a window in a Web browser or a hand-held device, or a set of physical pages in a catalog, report, pamphlet, or book.

Besides XSLT (and XPath, a differentiated component of XSLT), XSL also includes XSL-FO. XSLT is aimed at achieving only a part -- albeit a very important part -- of the task of generating presentations of arbitrary XML, namely transformation of XML from one structure into another. XSL-FO describes a *particular* target structure for XSLT that can be used in conjunction with it (or even apart from it) to achieve the goal of formatting.

That is, to solve a problem for XSL, XSLT solves a much more general problem. Accordingly it gets used for many more things than its "classic" scenario. Such is often the way with computers -- the more general is subsumed under the more particular. One might say (at the risk of confusing everyone even worse) that XSL, a technology for formatting XML documents, is an "application" of XSLT, a technology to do transformations -- indeed, XSL is the application that XSLT was designed for.

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>