Re: [xsl] Output XML doc with XSL doc name in comment

Subject: Re: [xsl] Output XML doc with XSL doc name in comment
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 08 May 2002 17:56:41 -0400

At 01:58 PM 5/8/2002, you wrote:
> It isn't obvious that the XML it is processing has a name. Both the
> source XML and the stylesheet might come from standard input
> stream, or
> from a stream of sax events or....

Dear David C.,
Even given what you have said, isn't it true that I must call up a
file name whether it be from the command line, or with xsl:import or
xsl:include, etc.?

No ... David describes situations where, for example, your XML could be pipelined in from some other application, etc. That is, while (this year) the vast majority of XSLT processes may be invoked using file names as handles on XML documents in a file system, this doesn't always have to be the case, so the processor shouldn't assume it.

It's no more a rule that input should always come from a file than that output should always be written to a file. Output could go straight into display, never have a file name. Maybe that display has some editing capability. Maybe you then hit a button and the new document you just wrote is transformed somehow. No file.

Actually, XML/XSLT is OS-neutral, and some OSes don't even have "files" (so XML uses URIs, building on top of the SGML notion of "system identifiers").

  And if so, then why not capture those ?.xsl names
for the comment either at their location or globally? Again, SAXON
has the name/path anyway.

This is exactly why Mike K. usually says "pass it in as a parameter". This is easy enough to do with a shell script (which is what you're doing with your NoteTab thingie, isn't it?).

<saxon:systemID select="document('')"/>

Someone else who's used it can confirm this, but my guess is this'll give you, in Saxon, the filename of the stylesheet (if it has one).


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. 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:

Current Thread