Petals SE XSLT

Improve log & xsl error detection accuracy

Details

  • Type: Improvement Request Improvement Request
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 2.4
  • Fix Version/s: 2.4
  • Component/s: None
  • Security Level: Public
  • Description:
    Hide

    Nowadays, when a XSL stylesheet comes buggy, we just get a TransformException without any details. Arjen Kraneveld has developped a class that solves this issue for some other projects using XSL transformations. The actual logger is attached to this issue, and should be initialized like this :

    TransformerFactory tFactory = TransformerFactory.newInstance();
    tFactory.setErrorListener(new LoggerErrorListener());

    et

    Transformer transformer = tFactory.newTransformer(new StreamSource(new File(xslURI)));
    transformer.setErrorListener(new LoggerErrorListener());

    Show
    Nowadays, when a XSL stylesheet comes buggy, we just get a TransformException without any details. Arjen Kraneveld has developped a class that solves this issue for some other projects using XSL transformations. The actual logger is attached to this issue, and should be initialized like this : TransformerFactory tFactory = TransformerFactory.newInstance(); tFactory.setErrorListener(new LoggerErrorListener()); et Transformer transformer = tFactory.newTransformer(new StreamSource(new File(xslURI))); transformer.setErrorListener(new LoggerErrorListener());
  • Environment:
    SE-XSLT
  1. LoggerErrorListener.java
    (2 kB)
    Charles Casadei
    Thu, 29 Jul 2010 - 14:41:01 +0200

Activity

Hide
Vincent Zurczak added a comment - Thu, 29 Jul 2010 - 15:25:32 +0200

The attached class is quite simple and needs to be updated for Petals.
I don't think we may have license issues with this.

=> The improvement request is accepted.

Show
Vincent Zurczak added a comment - Thu, 29 Jul 2010 - 15:25:32 +0200 The attached class is quite simple and needs to be updated for Petals. I don't think we may have license issues with this. => The improvement request is accepted.
Hide
Vincent Zurczak added a comment - Thu, 29 Jul 2010 - 15:35:25 +0200 - edited

Commit # 15453
Resolve and log line number when errors are encountered.

I will wait for your feedback about this before closing the bug.
My test with the SU you sent me was not conclusive. The error listener is called, but the line was not resolved with the error I got.
I will wait for your confirmation that some line numbers are correctly resolved.

Show
Vincent Zurczak added a comment - Thu, 29 Jul 2010 - 15:35:25 +0200 - edited Commit # 15453 Resolve and log line number when errors are encountered. I will wait for your feedback about this before closing the bug. My test with the SU you sent me was not conclusive. The error listener is called, but the line was not resolved with the error I got. I will wait for your confirmation that some line numbers are correctly resolved.
Hide
Charles Casadei added a comment - Thu, 29 Jul 2010 - 16:10:16 +0200

Did you get a more detailed error message ?

Show
Charles Casadei added a comment - Thu, 29 Jul 2010 - 16:10:16 +0200 Did you get a more detailed error message ?
Hide
Charles Casadei added a comment - Thu, 29 Jul 2010 - 16:18:44 +0200 - edited

I've just been told that this feature depends on the parser used.
Moreover, if you tried with the SU I sent you yesterday, it might be normal that you didn't get a proper exception, because Xalan is unable to resolve a class.

Show
Charles Casadei added a comment - Thu, 29 Jul 2010 - 16:18:44 +0200 - edited I've just been told that this feature depends on the parser used. Moreover, if you tried with the SU I sent you yesterday, it might be normal that you didn't get a proper exception, because Xalan is unable to resolve a class.
Hide
Christophe DENEUX added a comment - Thu, 29 Jul 2010 - 16:49:05 +0200

Can you set the attribute 'Fix version/s'

Show
Christophe DENEUX added a comment - Thu, 29 Jul 2010 - 16:49:05 +0200 Can you set the attribute 'Fix version/s'

People

Dates

  • Created:
    Thu, 29 Jul 2010 - 14:39:15 +0200
    Updated:
    Wed, 4 Aug 2010 - 16:46:07 +0200
    Resolved:
    Thu, 29 Jul 2010 - 15:35:25 +0200