cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ovidiu Predescu <ovi...@cup.hp.com>
Subject Re: xsp error reporting [was Re: Problems with XSP (fwd) on cocoon-users]
Date Wed, 01 May 2002 20:11:06 GMT
On Wed, 1 May 2002 21:38:55 +0200 (CEST), Torsten Curdt <tcurdt@dff.st> wrote:

> What do you guys think about this:
> 
> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=101980666129006&w=2

XSLT processors have extension functions that can provide the line and
column number of the source at the time of execution. Saxon has it,
and I've done this for Xalan about a year ago. (Last time I checked
though Xalan support for this was broken :-(

In any case, to see how you can generate the line numbers in the code,
checkout the sitemap.xsl file. A lot more support code is required
though to map a runtime exception line number to the line numbers
generated by XSP and logicsheets.

Greetings,
-- 
Ovidiu Predescu <ovidiu@cup.hp.com>
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)


> ---------- Forwarded message ----------
> Date: Mon, 29 Apr 2002 09:22:27 +0200
> From: Jens Lorenz <jens.lorenz@interface-projects.de>
> Reply-To: cocoon-users@xml.apache.org
> To: cocoon-users@xml.apache.org
> Subject: Re: Problems with XSP
> 
> From: "Torsten Curdt" <tcurdt@dff.st>
> To: <cocoon-users@xml.apache.org>; <haul@dvs1.informatik.tu-darmstadt.de>
> Sent: Friday, April 26, 2002 7:32 PM
> Subject: Re: Problems with XSP
> 
> 
> > > One could, of course,
> > > first run the XSP through a transformer that adds line number
> > >    comments that are kept 'til the java file is generated,
> > >
> > > find the enclosing line number comments (well, one would suffice)
> > >
> > > output the XSP with the line highlighted that translates to the
> > > faulty java code
> > >
> > > Would be kind of overhead outside development but then, a deployed
> > > application wouldn't compile XSPs too often.
> >
> > hm.. you mean this way?
> >
> >   ...
> >   <xsp:logic>
> >      int a = 5;
> >   </xsp:logic>
> >      <my:logicsheet-tag/>
> >   <xsp:logic>
> >      b = a;
> >      c = x;
> >   </xsp:logic>
> >  ...
> >
> > transform it once to add the line numbers. (it would be cool if the XSP
> > logicsheet could already provide this. but I fear that's not possible
> with
> > XSLT)
> >   ...
> >   <xsp:logic>
> >      /* line:4 */ int a = 5;
> >   </xsp:logic>
> >      <my:logicsheet-tag/>
> >   <xsp:logic>
> >      /* line:8 */ b = a;
> >      /* line:9 */ c = x;
> >   </xsp:logic>
> >   ....
> >
> > Then apply the logicsheets which might insert or remove lines from the
> > original code:
> >
> >   ...
> >      /* line:4 */ int a = 5;
> >
> >      .....
> >
> >      /* line:8 */ b = a;
> >      /* line:9 */ c = x;
> >   ....
> >
> > Now the exception provides information about the final class line
> numbers.
> > We still would need to obtaint the information as described. but we
> could
> > then also parse the comment to get the original line number an present
> > that one in a nice exception. the malicious line highlighted with +/- 5
> > lines. if there is no line number in comments we know it was introduced
> by
> > a logicsheet and might not be very helpful to display this way.
> >
> > But as I said... quite some hours of work...
> >
> > question is: do people think this is helpful?
> >
> > people? comments please...
> > --
> > Torsten
> 
> 
> Yes. This would be definitely helpful. When I used lex/yacc their line
> directives had me always pointing to the problem in my source.
> When the logic sheets are matured, it's also unlikely, that the error
> is in the logic sheet but not in your xsp.
> 
> I had a short look into this and there are two bugreports on this at Sun
> which lead to a JSR. So this is definitely a problem, and having comments
> in the generated code, which point me to the line and file the code
> was generated from, would already help a lot.
> 
> http://developer.java.sun.com/developer/bugParade/bugs/4026902.html
> 
> http://developer.java.sun.com/developer/bugParade/bugs/4090367.html
> 
> http://jcp.org/jsr/detail/045.jsp
> 
> 
> 
> Jens
> 
> --
> 
> jens.lorenz at interface-projects dot de
> 
> interface:projects GmbH                             \\|//
> Tolkewitzer Strasse 49                              (o o)
> 01277 Dresden                               ~~~~oOOo~(_)~oOOo~~~~
> Germany

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message