This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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:

books.xml 
---------
<library>
	<books>
		<book>
			<author>Kaarme Obogbo</author>
			<title>Silent Earth</title>
		</book>
	</books>
</library>

changeAuthor.xsl
------

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


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--
John 

-----Original Message-----
From: David_Marston@lotus.com [mailto:David_Marston@lotus.com]
Sent: Friday, June 23, 2000 2:34 PM
To: xsl-list@mulberrytech.com
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:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]