[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] self discovery


Subject: RE: [xsl] self discovery
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 22 Jan 2002 12:18:01 -0500

Andrew and Greg,

Sara is right, the usual workaround is to pass the filename or a meaningful fragment of it (e.g. the base name without the suffix) to the stylesheet.

Andrew, the piping of processes you envision could be achieved this way if you used an extension function designed to write output (for example Saxon's implementation of the shelved XSLT 1.1 instruction xsl:document, which writes a result tree fragment to a document) -- the processor then knows the name of the output file, because it wrote the file, and can write the name somewhere or otherwise make it known to the system.

But the intention of XSLT's designers is that such pipelining be possible without ever writing a file, but simply passing node sets (DOMs or DOM-alikes). Cocoon (Apache's XML infrastructure), I believe, supports this kind of thing out of the box.

Some of us have occasionally thought it'd be useful to have a base-uri() function, which would tell you, in effect, the file name proper to a node. At the moment it slips my mind what the use cases are. The wrinkle is that the source for an XSLT transform may not be in one file (it could be in several entities), or even in a file at all.

Cheers,
Wendell

At 05:17 AM 1/22/02, Andrew wrote:

ok.... (to make it clearer or possibly muddy it further)

Imagine:
You have an XML file, and apply xsl-1 to it.  Xsl-1 takes a node-set of the
root (or any node-set) and passes that to some script.  The script makes an
object out it, and applies xsl-2 (a different stylesheet) to that, and
displays the result.

The whole point of this is to be able to apply a second stylesheet without
ever knowing the filename of the xml - is this fantasy or a possibility??


andrew


======================================================================
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
Keywords