RE: xsl self-documentation on the fly (Perl?)

Subject: RE: xsl self-documentation on the fly (Perl?)
From: John Greek <John.Greek@xxxxxxxxx>
Date: Fri, 23 Jun 2000 16:24:55 -0700
David, Jeni,
Thanks again for the info.  My question is now, say you are using method #2
and are sending xsl-induced changed to stderr.  What I want to put is:

1. stylesheet used
2. template applied
3. elements, attributes worked on or changed
4. [most importantly] parent elements of that element

So if we have a xml file like:

			<author>Kaarme Obogbo</author>
			<title>Silent Earth</title>


<xsl:template name="chAuth" >
[ code that changes (first name last name) to (last name, first name) ]

we want written in the log:

1. changeAuthor.xsl
2. chAuth
3. author
!!!Crux of my question !!!
4. library:books:book:author
   [or some such tree-climbing notation showing the top node to the bottom]

Any suggestions on this?

Thanks again--

-----Original Message-----
From: David_Marston@xxxxxxxxx [mailto:David_Marston@xxxxxxxxx]
Sent: Friday, June 23, 2000 2:34 PM
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: Re: xsl self-documentation on the fly (Perl?)

Dr Jeni Tennison wrote:
>I'm also going to assume that you want to create an
>XML log file rather than plain text.

>The first thing I thought of was using saxon:output or xt:document to
>create your log, but the problem is that whenever you direct output to a
>file, it overwrites that file (you can't just append to it), which ruins
>that option as far as I can make out.

>The second option is to use xsl:message to create your log.  Unfortunately
>the messages go to stderr rather than stdout - perhaps there's a way of
>capturing them, but I'm not sure what it is (and it'll depend on what
>processor you're using and on what operating system).

>So, the final thing I can think of would be to have the log become the
>output of your stylesheet, either mixed up in your actual output (and then
>postprocessed to separate it), or not.

If you use Xalan, its "redirect" extension implements the third method
without the drawbacks of the first. My colleague Paul Dick thinks that the
second way is quite feasible if your processor isn't sending anything else
to stderr.
.................David Marston

 XSL-List info and archive:

 XSL-List info and archive:

Current Thread