On 01.May.2002 -- 09:38 PM, Torsten Curdt wrote: > ---------- Forwarded message ---------- > From: Jens Lorenz <[EMAIL PROTECTED]> > > From: "Torsten Curdt" <[EMAIL PROTECTED]> > > > > 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. > >
Like I said before, I don't think it's possible as it makes a number of assumptions about logicsheets that are unlikely to be valid. For example, take the sendmail logicsheet: <sendmail:body> Hello, this is a message send through cocoon. </sendmail:body> Now, insert line numbers: <sendmail:body> <xsp:logic>/* 500 */</xsp:logic> Hello, <xsp:logic>/* 501 */</xsp:logic> this is a message <xsp:logic>/* 502 */</xsp:logic> send through cocoon. <xsp:logic>/* 503 */</xsp:logic> </sendmail:body> <xsp:logic>/* 504 */</xsp:logic> Will result in message: "/* 500 */ Hello, /* 501 */ this is a message"... Other logicsheets might just strip large ranges of line numbers. Chris. -- C h r i s t i a n H a u l [EMAIL PROTECTED] fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]