RE: [xsl] linking to and displaying xsl templates

Subject: RE: [xsl] linking to and displaying xsl templates
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 14 Nov 2002 14:04:27 -0500
Hi Jesse,

At 01:49 PM 11/14/2002, you wrote:
Hi Wendell,

 you wrote:
 "When one of your links is traversed, what document should load?"

I'd like the template referred to in the link to load when the "Orange"
link is traversed.

Mm, apparently (judging from the more complete code sample you kindly included) you don't really want the template to load. (An XSLT template won't "load" in a browser; rather, it is part of a stylesheet that is compiled and executed by a stylesheet processor to create some kind of output.) Rather, you want the template to be executed and an HTML file, generated by that template, to load. This is a crucial distinction, and why we are asking about architectures. In fact I bet you don't care when and how the template is executed, as long as the HTML file it describes is loaded.


I suggest breaking your problem in two. First, design a solution which generates a single HTML output file for your entire XML. (Your prototype can work over a trimmed-down version if the XML is way too huge.) Include in it your table of contents, with the links pointing as you wish -- only (of course) they'll be internal links within the single HTML file you'll be generating. Check out the FAQ on generating links, or ask, if you can't see how to do this.

Only when you have this problem solved should you address how to get your processor to generate, not a single HTML file, but an entire suite of them. You'll be using extension functions (which David just named) to do this. (The extension required, which is pretty common, is due to be rolled into the standard in the next rev.) This task will pose you with a separate set of problems, such as what your output files should be named and where they will be put (something your processor has to be able to determine if it's going to do things like file generation and link construction). Again, the FAQ, your favorite XSLT manual(s), and this list can be a help. Having solved those, you'll be able to go back to your linking (which will now be broken), and fix it to work across the files.

What you're trying to do is pretty ambitious for a newbie, since it involves implementing solutions to several problems at once.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx 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



Current Thread