cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sandor Spruit <san...@cs.uu.nl>
Subject Re[2]: Chaining XML->XSP->XML->XSP->etc.
Date Fri, 23 Feb 2001 09:48:23 GMT

Luca,

On Friday, February 23, 2001, 10:16:00 AM, you wrote:

Luca> Emilio,

Luca> since I face your same problem (chaining XSPs adn XMLs), do you
Luca> mind sending me your solution, as soon as you have one ?

I had roughly the same problem earlier this week. Some web searching
yielded this little tutorial:

http://www.suranyami.com/XSPtutorial/

The pictures were *very* useful to improve my understanding of what's
going on with XSP pages, XML, XSL, logicsheets, taglibs and relations
between them. In fact, I had my own solution worked out half an hour
after I'd studied these and looking at my own Cocoon installation.

I have attached two files to this e-mail:

- student-list.xml;
- student-list.xsl;

First file:

It gets processed by - see the two processing instructions at the
beginning of the file - (1) the xsp processor (2) the xslt processor,
where the stylesheet will be "student-list.xsl". The key thing to see
is, that there's another file involved: the esql tab library declared
at the top of the file, listed in your Cocoon.properties. This library
is yet another stylesheet (esql.xsl) tucked away in Cocoon files. So,
it's: student-list.xml -> esql.xsl -> student-list.xsl.

The ESQL taglibrary (stylesheet) uses Java code embedded in it to, in
this case, query a database and transform a document e.g. by inserting
extra elements. In my case, the large 'esql:connection' element gets
transformed into series of 'student', 'name', 'student-nr' tags filled
with information from a phony student database.

Second file:

This stylesheet takes the student/name/student_nr tags produced by the
first (ESQL) transformation and turns them into an HTML table. Some
basic layout information gets added to it along the way.

Hope this helps,
Cheers,
Sandor

-- 
ir A.G.L. Spruit, Utrecht University, the Netherlands
Institute of information and computing sciences
"There is a bit of magic in everything, and then some
loss to even things out" (from: Lou Reed, "Magic and Loss")
Mime
View raw message