Thanks, but I'm using Xalan with the command-line utility ...

So, how can I configure Xalan (or Xerces) to print only my
message, without stylesheet informations ?

Thanks a lot.



> Hi André,
>
> You could write your own error listener such as the following:
>
>         public class MyErrorListener implements ErrorListener {
>                 public void warning(TransformerException
exception) throws
> TransformerException {
>
System.err.println(exception.getMessage());
>                 }
>
>                 public void error(TransformerException
exception) throws
> TransformerException {
>  System.err.println(exception.getMessageAndLocation());
>                 }
>
>                 public void fatalError(TransformerException
exception)
> throws TransformerException {
>  System.err.println(exception.getMessageAndLocation());
>                 }
>         }
>
> To set the error listener on the transformer use the method:
> Transformer.setErrorListener(ErrorListener)
>
> Thanks.
>
> Erin Harris
>
>
>
>
>
> André Mercadier <[EMAIL PROTECTED]>
> 28/10/2006 04:22 AM
>
> To
> <xalan-j-users@xml.apache.org>
> cc
>
> Subject
> How to avoid <xsl:message> instruction prints stylesheet
file informations
> ?
>
>
>
>
>
>
> Hello,
>
> I'm using Xalan 2.7.0 with Xerces 2.7.1 on a MS-DOS
environment with the
> command line utility to perform XSLT transformations (java
> org.apache.xalan.xslt.Process -IN foo.xml -XSL foo.xsl -OUT
foo.out -PARAM
> param value).
>
> My foo.xsl stylesheet contains several <xsl:message>STEP
xxx</xsl:message>
> to trace the steps it reaches, but the printed message is
not only "STEP
> xxx" but :
>
> "file:///c:/my_very_complex_directory/foo.xsl ; Line x;
Column y; STEP xxx
> ".
>
> Is it possible to avoid the stylesheet file informations
(which don't
> interest users), keeping only the message in the
<xsl:message> tag ?
>
> Thanks a lot.
>



Accédez au courrier électronique de La Poste
sur www.laposte.net ou sur 3615 LAPOSTENET (0,34€ TTC /mn)
1 Giga de stockage gratuit – Antispam et antivirus intégrés



Reply via email to