![]() |
|
|
|||||||
![]() |
XML - Write to error log using redirect:write |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 <xsl <xsl <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 > <xsl > <xsl > <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 Petterson Mikael |
|
|
|
|
#2 |
|
Posts: 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 |
|