By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,870 Members | 1,236 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,870 IT Pros & Developers. It's quick & easy.

Write to error log using redirect:write

P: n/a
Hi,

I am using xalan. In my stylesheet I have the following snippet to write
to std out when a specific error occurs.

<xsl:template name="class_error">
<xsl:param name="class"/>
<xsl:param name="attribute"/>
<xsl:param name="error_msg"/>
<xsl:message terminate="no">
Class:<xsl:value-of select="$class"/>
Attribute:<xsl:value-of select="$attribute"/>
Error:<xsl:value-of select="$error_msg"/>
</xsl:message>
</xsl:template>

I want to collcet all these class errors in a file. I have tested to
create an error.log in my outputdirectory using
<xsl:template name="class_error">
<xsl:param name="class"/>
<xsl:param name="attribute"/>
<xsl:param name="error_msg"/>
<redirect:write file="{$output.dir}/{$error.log}" append="true">
Class:<xsl:value-of select="$class"/>
Attribute:<xsl:value-of select="$attribute"/>
Error:<xsl:value-of select="$error_msg"/>
</redirect:write>
<redirect:close file="{$output.dir}/{$error.log}"/>
<xsl:message terminate="no">
Class:<xsl:value-of select="$class"/>
Attribute:<xsl:value-of select="$attribute"/>
Error:<xsl:value-of select="$error_msg"/>
</xsl:message>

</xsl:template>

But there is not error.log file created there. What am I missing or is
there a better way to do it?

cheers,

//mikael
Sep 11 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Petterson Mikael wrote:
> <redirect:write file="{$output.dir}/{$error.log}" append="true">
But there is not error.log file created there. What am I missing or is
there a better way to do it?
Stupid question, just to get it out of the way: You didn't show us what
you set those variables to. Are they initialized correctly and in scope
at this point in the stylesheet?
--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
Sep 11 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.