Wrox Programmer Forums
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 1st, 2010, 07:21 PM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default Logging

In the past, I have set up logging by outputting and capturing xsl:message(s). I was wondering if XSLT 2.0 offered a better way of handling this scenario. My first thought would be to use xsl:result-document with template modes to capture a log file.

<xsl:template match="/">
<xsl:apply-templates/>
<xsl:result-document href="log.txt" format="text">
<xsl:apply-templates mode="log"/>
</xsl:result-document>
</xsl:template>

Does anyone see an advantage/disadvantage to either approach (using xsl:message vs xsl:result-document)?
 
Old March 1st, 2010, 08:03 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

xsl:result-document doesn't allow you to send several documents/messages to the same destination.

xsl:message is the right approach here, provided your XSLT processor provides some way to direct the message output to your choice of logging infrastructure.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
 
Old March 2nd, 2010, 01:01 PM
Authorized User
 
Join Date: May 2007
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks! I am using Saxon and will look into my options for directing the messages to a log file.





Similar Threads
Thread Thread Starter Forum Replies Last Post
SSIS - Built-In Logging / Custom Logging ivobecker23 SQL Server 2005 0 April 21st, 2006 05:41 AM
Logging in Database piyushnu ADO.NET 0 March 27th, 2006 11:47 AM
Redirecting and Logging off. rupen Classic ASP Basics 3 June 6th, 2005 07:19 AM
Tomcat logging shantawn Apache Tomcat 2 February 25th, 2005 06:04 AM
Logging in from another place Hadware General .NET 0 December 14th, 2004 03:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.