Re: Problems with XSP

2002-04-29 Thread Jens Lorenz

From: Torsten Curdt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
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


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problems with XSP

2002-04-28 Thread J.Pietschmann

Torsten Curdt wrote:
 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;

Saxon has an extension function to retrieve the line
number of the context node (saxon:lineNumber()). Maybe
Xalan has an equivalent.


J.Pietschmann



-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problems with XSP

2002-04-26 Thread Torsten Curdt

On Fri, 26 Apr 2002, Vadim Gritsenko wrote:
  From: Graaf, Edgar de (fin) [mailto:[EMAIL PROTECTED]]
 
  Great...
 
  when I code XSP and when I make some error in the logic I get (of
 course) an
  error. An error contains a line number. Now I have to go to the work
  directory and look at the generated java file to find the error. Isn't
 it
  possible to display the line number of the error in the XSP?

 Suggest how it is possible.

I have thought about this a while ago, too. We should be able to extract
that from the exception stacktrace. It should also be even possible to
display that line's sourcecode (preferable with some surrounding lines).

But I wasn't sure if this is really worth the work...
...is there a need for it?
--
Torsten


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problems with XSP

2002-04-26 Thread Torsten Curdt

  I have thought about this a while ago, too. We should be able to
 extract
  that from the exception stacktrace.

 Line number in Java source is already shown, correctly. The question is
 how to map this to XSP source line numbers.

well, addtionally we need the full classpath of the failed class itself
from the stacktrace. then we need to lookup the java source code filename
from the ProgrammGenerator. unfortunately that's not yet possible AFAICS.
but as a workaround we might translate back the class into a path and use
the workdir of the ProgrammGenerator as root, add the path and we should
have the generated file path from the repository...

What do you think?
--
Torsten


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problems with XSP

2002-04-26 Thread Christian Haul

On 26.Apr.2002 -- 03:59 PM, Torsten Curdt wrote:
   I have thought about this a while ago, too. We should be able to
  extract
   that from the exception stacktrace.
 
  Line number in Java source is already shown, correctly. The question is
  how to map this to XSP source line numbers.
 
 well, addtionally we need the full classpath of the failed class itself
 from the stacktrace. then we need to lookup the java source code filename
 from the ProgrammGenerator. unfortunately that's not yet possible AFAICS.
 but as a workaround we might translate back the class into a path and use
 the workdir of the ProgrammGenerator as root, add the path and we should
 have the generated file path from the repository...

OK, that would make it easier to see the source (if I understand
correctly, that is). But I believe the original problem is infeasible
since we don't know what transformations happened on the way to the
final XSP (all taglibs but XSP done).

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.

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

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problems with XSP

2002-04-26 Thread Christian Haul

On 26.Apr.2002 -- 05:24 PM, Christian Haul wrote:
 On 26.Apr.2002 -- 03:59 PM, Torsten Curdt wrote:
I have thought about this a while ago, too. We should be able to
   extract
that from the exception stacktrace.
  
   Line number in Java source is already shown, correctly. The question is
   how to map this to XSP source line numbers.
  
  well, addtionally we need the full classpath of the failed class itself
  from the stacktrace. then we need to lookup the java source code filename
  from the ProgrammGenerator. unfortunately that's not yet possible AFAICS.
  but as a workaround we might translate back the class into a path and use
  the workdir of the ProgrammGenerator as root, add the path and we should
  have the generated file path from the repository...
 
 OK, that would make it easier to see the source (if I understand
 correctly, that is). But I believe the original problem is infeasible
 since we don't know what transformations happened on the way to the
 final XSP (all taglibs but XSP done).
 
 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, 

Mmmh, probably won't work as it presumes that logicsheets behave well
which might not be true.

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

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problems with XSP

2002-04-26 Thread Graaf, Edgar de (fin)

Well now I have to go to the work directory and search the XSP. It would be
easy if I just can jump to the right line number...

Regards

-Oorspronkelijk bericht-
Van: Torsten Curdt [mailto:[EMAIL PROTECTED]]
Verzonden: vrijdag 26 april 2002 14:26
Aan: [EMAIL PROTECTED]
Onderwerp: RE: Problems with XSP


On Fri, 26 Apr 2002, Vadim Gritsenko wrote:
  From: Graaf, Edgar de (fin) [mailto:[EMAIL PROTECTED]]
 
  Great...
 
  when I code XSP and when I make some error in the logic I get (of
 course) an
  error. An error contains a line number. Now I have to go to the work
  directory and look at the generated java file to find the error. Isn't
 it
  possible to display the line number of the error in the XSP?

 Suggest how it is possible.

I have thought about this a while ago, too. We should be able to extract
that from the exception stacktrace. It should also be even possible to
display that line's sourcecode (preferable with some surrounding lines).

But I wasn't sure if this is really worth the work...
...is there a need for it?
--
Torsten


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problems with XSP

2002-04-26 Thread Torsten Curdt

I have thought about this a while ago, too. We should be able to
   extract
that from the exception stacktrace.
  
   Line number in Java source is already shown, correctly. The question is
   how to map this to XSP source line numbers.
 
  well, addtionally we need the full classpath of the failed class itself
  from the stacktrace. then we need to lookup the java source code filename
  from the ProgrammGenerator. unfortunately that's not yet possible AFAICS.
  but as a workaround we might translate back the class into a path and use
  the workdir of the ProgrammGenerator as root, add the path and we should
  have the generated file path from the repository...

 OK, that would make it easier to see the source (if I understand
 correctly, that is). But I believe the original problem is infeasible
 since we don't know what transformations happened on the way to the
 final XSP (all taglibs but XSP done).

true... that's why I am not sure if it is really worth the work.
fact is: it will only really be useful if the error does not come from a
logicsheet. otherwise you would present code to the user/developer he
has probably never seen before. it might be easier to track things
though... I am really torn apart :-/

Some comments from XSP *users* would be fine...

 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


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problems with XSP

2002-04-25 Thread cyril vidal



I've checked the Tomcat work 
directory, and there's just compteur_xsp.java.
So compteur.xsp must not be correct. 
The code is the following:
?xml 
version="1.0"?xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core"xsp:logicstatic 
private int counter = 0;

private synchronized int 
count(){return counter++;}/xsp:logic

pagep J'ai été 
visitée xsp:exprcount()/xsp:expr fois. 
/p/page/xsp:page

Someone could tell me where's the 
error, please?
Best,
Cyril.

  - Original Message - 
  From: 
  Graaf, Edgar de (fin) 
  To: '[EMAIL PROTECTED]' 
  
  Sent: Wednesday, April 24, 2002 11:22 
  AM
  Subject: RE: Problems with XSP
  
  Your 
  XSP was not compiled because it contains some error. Then you don't have a 
  class and get a ClassNotFoundException.
  
  Search in the Tomcat work directory for compteur. Do 
  you only find compteur_xsp.java? Or also 
  compteur_xsp.class?
  
  Regards
  
  Edgar
  
-Oorspronkelijk bericht-Van: cyril vidal 
[mailto:[EMAIL PROTECTED]]Verzonden: dinsdag 23 april 2002 
21:55Aan: [EMAIL PROTECTED]Onderwerp: 
Problems with XSP
HY!

Iwould liketo execute 
a very simple XSP sample. Here is my sitemap:

map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0" 
map:components map:generators 
default="file" map:generator name="file" 
src="org.apache.cocoon.generation.FileGenerator"/ 
map:generator name="serverpages" 
src="org.apache.cocoon.generation.ServerPagesGenerator"//map:generators

map:transformers 
default="xslt" map:transformer name="xslt" 
src="org.apache.cocoon.transformation.TraxTransformer"//map:transformers

map:readers 
default="resource" map:reader name="resource" 
src="org.apache.cocoon.reading.ResourceReader"//map:readers

map:serializers 
default="html" map:serializer name="xml" 
mime-type="text/xml" 
src="org.apache.cocoon.serialization.XMLSerializer"/ 
map:serializer name="html" mime-type="text/html" 
src="org.apache.cocoon.serialization.HTMLSerializer"/ 
map:serializer name="svg2png" 
src="org.apache.cocoon.serialization.SVGSerializer" 
mime-type="image/png"/ map:serializer name="fo2pdf" 
src="org.apache.cocoon.serialization.FOPSerializer" 
mime-type="application/pdf"//map:serializers

map:matchers 
default="wildcard" map:matcher name="wildcard" 
src="org.apache.cocoon.matching.WildcardURIMatcher"//map:matchers

/map:components

map:pipelines 
map:pipeline map:match 
pattern="index.html" 
map:read src="static/index.html" 
mime-type="text/html"/ 
/map:match /map:pipeline

 
map:pipeline map:match 
pattern="CinemaFO.pdf" 
map:generate 
src="static/CinemaFO.xml"/ 
map:transform 
src="transforms/CinemaFO.xsl"/ 
map:serialize type="fo2pdf"/ 
/map:match /map:pipeline

map:pipeline map:match 
pattern="compteur.xsp" 
map:generate type="serverpages" 
src="transforms/compteur.xsp"/ 
map:transform 
src="transforms/page-html.xsl"/ 
map:serialize/ /map:match 
/map:pipeline

/map:pipelines 
/map:sitemap

Unfortunately, when I execute the 
file compteur.xsp, I get the following error message:

type 
fatal
message Language Exception
description 
org.apache.cocoon.ProcessingException: Language Exception: 
org.apache.cocoon.components.language.LanguageException: Could not load 
class for program 'org\apache\cocoon\www\transforms\compteur_xsp' due to a 
java.lang.ClassNotFoundException: 
org.apache.cocoon.www.transforms.compteur_xsp
sender org.apache.cocoon.servlet.CocoonServlet
source Cocoon servlet
request-uri/essai/compteur.xsp

path-infocompteur.xspSomeone could help me, please?Thanks,Cyril.


RE: Problems with XSP

2002-04-25 Thread Vadim Gritsenko

1. Check XSP namespace. It is not correct.
2. Is this valid UTF-8? Or ISO-8859-1? Specify encoding in ?xml?
instruction.


Vadim

-Original Message-
From: cyril vidal [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, April 25, 2002 2:41 PM
To: [EMAIL PROTECTED]
Subject: Re: Problems with XSP

I've checked the Tomcat work directory, and there's just
compteur_xsp.java.
So compteur.xsp must not be correct. The  code is the following:
?xml version=1.0?
xsp:page language=java
xmlns:xsp=http://www.apache.org/1999/XSP/Core;
xsp:logic
static private int counter = 0;
 
private synchronized int count(){
return counter++;
}
/xsp:logic
 
page
p J'ai été visitée xsp:exprcount()/xsp:expr fois. /p
/page
/xsp:page
 
Someone could tell me where's the error, please?
Best,
Cyril.
- Original Message - 
From: Graaf, Edgar de (fin) 
To: '[EMAIL PROTECTED]' 
Sent: Wednesday, April 24, 2002 11:22 AM
Subject: RE: Problems with XSP

Your XSP was not compiled because it contains some error. Then you don't
have a class and get a ClassNotFoundException.
 
Search in the Tomcat work directory for compteur. Do you only find
compteur_xsp.java? Or also compteur_xsp.class?
 
Regards
 
Edgar
-Oorspronkelijk bericht-
Van: cyril vidal [mailto:[EMAIL PROTECTED]]
Verzonden: dinsdag 23 april 2002 21:55
Aan: [EMAIL PROTECTED]
Onderwerp: Problems with XSP
HY!
 
I would like to execute a very simple XSP sample. Here is my sitemap:
 
map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0;
  map:components
    map:generators default=file
  map:generator name=file
src=org.apache.cocoon.generation.FileGenerator/
  map:generator name=serverpages
src=org.apache.cocoon.generation.ServerPagesGenerator/
/map:generators
 
map:transformers default=xslt
  map:transformer  name=xslt
src=org.apache.cocoon.transformation.TraxTransformer/
/map:transformers
 
map:readers default=resource
  map:reader name=resource
src=org.apache.cocoon.reading.ResourceReader/
/map:readers
 
map:serializers default=html
  map:serializer name=xml mime-type=text/xml
src=org.apache.cocoon.serialization.XMLSerializer/
  map:serializer name=html mime-type=text/html
src=org.apache.cocoon.serialization.HTMLSerializer/
  map:serializer name=svg2png
src=org.apache.cocoon.serialization.SVGSerializer
mime-type=image/png/
  map:serializer name=fo2pdf
src=org.apache.cocoon.serialization.FOPSerializer
mime-type=application/pdf/
/map:serializers
 
map:matchers default=wildcard
  map:matcher name=wildcard
src=org.apache.cocoon.matching.WildcardURIMatcher/
/map:matchers
 
/map:components
 
map:pipelines
  map:pipeline
 map:match pattern=index.html
    map:read src=static/index.html mime-type=text/html/
 /map:match
  /map:pipeline
 
  map:pipeline
    map:match pattern=CinemaFO.pdf
  map:generate src=static/CinemaFO.xml/
  map:transform src=transforms/CinemaFO.xsl/
   map:serialize type=fo2pdf/
    /map:match
  /map:pipeline
 
map:pipeline
    map:match pattern=compteur.xsp
  map:generate type=serverpages src=transforms/compteur.xsp/
  map:transform src=transforms/page-html.xsl/
   map:serialize/
    /map:match
  /map:pipeline
 
/map:pipelines
   
/map:sitemap
 
Unfortunately, when I execute the file compteur.xsp, I get the following
error message:
type fatal
message Language Exception
description org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Could not load
class for program 'org\apache\cocoon\www\transforms\compteur_xsp' due to
a java.lang.ClassNotFoundException:
org.apache.cocoon.www.transforms.compteur_xsp
sender org.apache.cocoon.servlet.CocoonServlet
source Cocoon servlet
request-uri
/essai/compteur.xsp
path-info
compteur.xsp
Someone could help me, please?
Thanks,
Cyril.


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Problems with XSP

2002-04-25 Thread cyril vidal

Thanks Vadim!
It's now OK...


- Original Message -
From: Vadim Gritsenko [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, April 25, 2002 11:14 PM
Subject: RE: Problems with XSP


 From: cyril vidal [mailto:[EMAIL PROTECTED]]

 I've put away the language attribute on the namespace.
 So I have:
 ?xml version=1.0 encoding=iso-8859-1?
 xsp:page xmlns:xsp=http://www.apache.org/1999/XSP/Core;

You still have wrong namespace.

From hello.xsp:


xsp:page language=java
  xmlns:xsp=http://apache.org/xsp;

  page
...
  /page

/xsp:page


Vadim

 xsp:logic
 static private int counter = 0;

 private synchronized int count(){
 return counter++;
 }
 /xsp:logic

 page
 p J'ai été visitée xsp:exprcount()/xsp:expr fois. /p
 /page
 /xsp:page

 but it still doesn't work...

 - Original Message -
 From: Vadim Gritsenko [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, April 25, 2002 9:52 PM
 Subject: RE: Problems with XSP


 1. Check XSP namespace. It is not correct.
 2. Is this valid UTF-8? Or ISO-8859-1? Specify encoding in ?xml?
 instruction.


 Vadim

 -Original Message-
 From: cyril vidal [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 25, 2002 2:41 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Problems with XSP

 I've checked the Tomcat work directory, and there's just
 compteur_xsp.java.
 So compteur.xsp must not be correct. The code is the following:
 ?xml version=1.0?
 xsp:page language=java
 xmlns:xsp=http://www.apache.org/1999/XSP/Core;
 xsp:logic
 static private int counter = 0;

 private synchronized int count(){
 return counter++;
 }
 /xsp:logic

 page
 p J'ai été visitée xsp:exprcount()/xsp:expr fois. /p
 /page
 /xsp:page

 Someone could tell me where's the error, please?
 Best,
 Cyril.
 - Original Message -
 From: Graaf, Edgar de (fin)
 To: '[EMAIL PROTECTED]'
 Sent: Wednesday, April 24, 2002 11:22 AM
 Subject: RE: Problems with XSP

 Your XSP was not compiled because it contains some error. Then you
don't
 have a class and get a ClassNotFoundException.

 Search in the Tomcat work directory for compteur. Do you only find
 compteur_xsp.java? Or also compteur_xsp.class?

 Regards

 Edgar
 -Oorspronkelijk bericht-
 Van: cyril vidal [mailto:[EMAIL PROTECTED]]
 Verzonden: dinsdag 23 april 2002 21:55
 Aan: [EMAIL PROTECTED]
 Onderwerp: Problems with XSP
 HY!

 I would like to execute a very simple XSP sample. Here is my sitemap:

 map:sitemap xmlns:map=http://apache.org/cocoon/sitemap/1.0;
 map:components
 map:generators default=file
 map:generator name=file
 src=org.apache.cocoon.generation.FileGenerator/
 map:generator name=serverpages
 src=org.apache.cocoon.generation.ServerPagesGenerator/
 /map:generators

 map:transformers default=xslt
 map:transformer name=xslt
 src=org.apache.cocoon.transformation.TraxTransformer/
 /map:transformers

 map:readers default=resource
 map:reader name=resource
 src=org.apache.cocoon.reading.ResourceReader/
 /map:readers

 map:serializers default=html
 map:serializer name=xml mime-type=text/xml
 src=org.apache.cocoon.serialization.XMLSerializer/
 map:serializer name=html mime-type=text/html
 src=org.apache.cocoon.serialization.HTMLSerializer/
 map:serializer name=svg2png
 src=org.apache.cocoon.serialization.SVGSerializer
 mime-type=image/png/
 map:serializer name=fo2pdf
 src=org.apache.cocoon.serialization.FOPSerializer
 mime-type=application/pdf/
 /map:serializers

 map:matchers default=wildcard
 map:matcher name=wildcard
 src=org.apache.cocoon.matching.WildcardURIMatcher/
 /map:matchers

 /map:components

 map:pipelines
 map:pipeline
 map:match pattern=index.html
 map:read src=static/index.html mime-type=text/html/
 /map:match
 /map:pipeline

 map:pipeline
 map:match pattern=CinemaFO.pdf
 map:generate src=static/CinemaFO.xml/
 map:transform src=transforms/CinemaFO.xsl/
 map:serialize type=fo2pdf/
 /map:match
 /map:pipeline

 map:pipeline
 map:match pattern=compteur.xsp
 map:generate type=serverpages src=transforms/compteur.xsp/
 map:transform src=transforms/page-html.xsl/
 map:serialize/
 /map:match
 /map:pipeline

 /map:pipelines

 /map:sitemap

 Unfortunately, when I execute the file compteur.xsp, I get the
following
 error message:
 type fatal
 message Language Exception
 description org.apache.cocoon.ProcessingException: Language Exception:
 org.apache.cocoon.components.language.LanguageException: Could not
load
 class for program 'org\apache\cocoon\www\transforms\compteur_xsp' due
to
 a java.lang.ClassNotFoundException:
 org.apache.cocoon.www.transforms.compteur_xsp
 sender org.apache.cocoon.servlet.CocoonServlet
 source Cocoon servlet
 request-uri
 /essai/compteur.xsp
 path-info
 compteur.xsp
 Someone could help me, please?
 Thanks,
 Cyril.


 -
 Please check that your question has not already been answered in the
 FAQ before posting. http://xml.apache.org/cocoon/faqs.html

 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e

Re: Problems with XSP

2002-04-24 Thread Christian Haul

On 23.Apr.2002 -- 09:54 PM, cyril vidal wrote:
 map:match pattern=compteur.xsp
   map:generate type=serverpages src=transforms/compteur.xsp/

You're sure you've got the right path to your file?

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

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Problems with XSP

2002-04-24 Thread Graaf, Edgar de (fin)



Your 
XSP was not compiled because it contains some error. Then you don't have a class 
and get a ClassNotFoundException.

Search 
in the Tomcat work directory for compteur. Do you only find compteur_xsp.java? 
Or also compteur_xsp.class?

Regards

Edgar

  -Oorspronkelijk bericht-Van: cyril vidal 
  [mailto:[EMAIL PROTECTED]]Verzonden: dinsdag 23 april 2002 
  21:55Aan: [EMAIL PROTECTED]Onderwerp: Problems 
  with XSP
  HY!
  
  Iwould liketo execute a 
  very simple XSP sample. Here is my sitemap:
  
  map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0" 
  map:components map:generators 
  default="file" map:generator name="file" 
  src="org.apache.cocoon.generation.FileGenerator"/ 
  map:generator name="serverpages" 
  src="org.apache.cocoon.generation.ServerPagesGenerator"//map:generators
  
  map:transformers 
  default="xslt" map:transformer name="xslt" 
  src="org.apache.cocoon.transformation.TraxTransformer"//map:transformers
  
  map:readers 
  default="resource" map:reader name="resource" 
  src="org.apache.cocoon.reading.ResourceReader"//map:readers
  
  map:serializers 
  default="html" map:serializer name="xml" 
  mime-type="text/xml" 
  src="org.apache.cocoon.serialization.XMLSerializer"/ 
  map:serializer name="html" mime-type="text/html" 
  src="org.apache.cocoon.serialization.HTMLSerializer"/ 
  map:serializer name="svg2png" 
  src="org.apache.cocoon.serialization.SVGSerializer" 
  mime-type="image/png"/ map:serializer name="fo2pdf" 
  src="org.apache.cocoon.serialization.FOPSerializer" 
  mime-type="application/pdf"//map:serializers
  
  map:matchers 
  default="wildcard" map:matcher name="wildcard" 
  src="org.apache.cocoon.matching.WildcardURIMatcher"//map:matchers
  
  /map:components
  
  map:pipelines 
  map:pipeline map:match 
  pattern="index.html" 
  map:read src="static/index.html" 
  mime-type="text/html"/ 
  /map:match /map:pipeline
  
   
  map:pipeline map:match 
  pattern="CinemaFO.pdf" map:generate 
  src="static/CinemaFO.xml"/ 
  map:transform 
  src="transforms/CinemaFO.xsl"/ 
  map:serialize type="fo2pdf"/ 
  /map:match /map:pipeline
  
  map:pipeline map:match 
  pattern="compteur.xsp" map:generate 
  type="serverpages" 
  src="transforms/compteur.xsp"/ 
  map:transform 
  src="transforms/page-html.xsl"/ 
  map:serialize/ /map:match 
  /map:pipeline
  
  /map:pipelines 
  /map:sitemap
  
  Unfortunately, when I execute the 
  file compteur.xsp, I get the following error message:
  
  type 
  fatal
  message 
  Language Exception
  description 
  org.apache.cocoon.ProcessingException: Language Exception: 
  org.apache.cocoon.components.language.LanguageException: Could not load class 
  for program 'org\apache\cocoon\www\transforms\compteur_xsp' due to a 
  java.lang.ClassNotFoundException: 
  org.apache.cocoon.www.transforms.compteur_xsp
  sender 
  org.apache.cocoon.servlet.CocoonServlet
  source 
  Cocoon servlet
  request-uri/essai/compteur.xsp
  
  path-infocompteur.xspSomeone could help me, please?Thanks,Cyril.


Re: Problems with XSP when upgrading 1.8.2 - 2.0.2

2002-04-20 Thread Nanda Mounasamy
Title: Re: Problems with XSP when upgrading 1.8.2 - 2.0.2





I got only half of your mail in black berry. There should be an api to convert sax to dom and read dom into sax api. I will let you know soon.

--
Sent from my BlackBerry Wireless Handheld (www.BlackBerry.net)





RE: Problems with XSP when upgrading 1.8.2 - 2.0.2

2002-04-19 Thread Vadim Gritsenko

Try sending plain text email. It might help - not everybody reads HTML.

Vadim

-Original Message-
From: William Bagby [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 19, 2002 11:42 AM
To: Cocoon Users Mailing List (E-mail)
Subject: Problems with XSP when upgrading 1.8.2 - 2.0.2

Sending again, as I haven't received a response, and I'm at my wits'
end, I've been unable to find answers anywhere... 
-Original Message- 
From: William Bagby 
Sent: Friday, April 12, 2002 10:52 AM 
To: Cocoon Users Mailing List (E-mail) 
Subject: Problems with XSP when upgrading 1.8.2 - 2.0.2 

Forwarding this again, I think I sent to first one as HTML, which I
think the list doesn't recognize. 
 
I have looked in the mailing lists, to no avail, please forgive me if
these questions have been answered already 
  
I have upgraded Cocoon 1.8.2 to Cocoon 2.0.2. Here's my setup: 
  
Cocoon 2.0.2 
Weblogic 6.0sp2 
Solaris 2.6 (Sparc) 
  
I have successfully installed C2, all the samples work, etc. but I am
having a problem getting my logicsheets to work. I am having 2 separate
problems:
  
Problem 1: Transition from DOM to SAX 
In my logicsheets I have a number of places where I dynamically insert
an XML document, then use the DOM API to access values of specific
nodes. I have come to realize that since C2 uses SAX, I can no longer do
this. Here's an example:
  
String name = Joe; 
NodeList ca = document.getElementsByTagName( employee ); 
if ( ca != null ) { 
    Element element = null; 
    String myAttr = ; 
    int length = ca.getLength(); 
    for (int j = 0; j lt; length; j++) { 
    element = (Element) ca.item(j); 
    myAttr = element.getAttribute( name ); 
    if ( !myAttr.equals( name ) ) continue; 
    myValue = element.getAttribute( value ); 
    break; 
    } 
} 
  
So if I have the following XML fragment: 
  
employee name=John value=23/ 
employee name=Jack value=34/ 
employee name=Joe value=45/ 
employee name=Joanne value=56/ 
employee name=Jimmy value=67/ 
  
I want the value 45.  How would I do this with SAX? 
  
Problem 2: request and response using C2 specific implementation, rather
than javax.servlet.http.HttpRequest and javax.servlet.http.HttpResponse
I use some EJB's which have methods that take the built-in XSP variables
'request' and 'response' as params. It does not work now. Is there a way
to cast org.apache.cocoon.environment.Request as
javax.servlet.http.HttpRequest (and likewise for Response), or is there
a better way to do it? I would like to avoid having to modify the EJBs,
which at this point would be a Hurculean task.
  
Sorry if these don't seem to be Cocoon 2 questions, but I was thinking
maybe some of you have similar problems. 
  
Thanks in advance... 
  
William Bagby. 
  
  
  


-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: problems with xsp date

2001-06-13 Thread lisa . vangelder

Thanks Jan, that worked.

I'm new to xsp as you've probably guessed!

Lisa


-Original Message-
From: Uyttenhove Jan [mailto:[EMAIL PROTECTED]]
Sent: 13 June 2001 10:45
To: '[EMAIL PROTECTED]'
Subject: RE: problems with xsp date


Lisa,

first, java.util.Date is included, but java.util.Calendar isn't.
Try to include it by adding :
  xsp:structure
   xsp:includejava.util.Calendar/xsp:include
  /xsp:structure

second, you should put your xsp:logic block inside your time block

So, try this:

  xsp:structure
   xsp:includejava.util.Calendar/xsp:include
  /xsp:structure
time
  xsp:logic
  Calendar now = Calendar.getInstance();
  now.setTime( new Date() );
  float hourAngle = (float) now.get( Calendar.HOUR   ) / 12 * 360; 
  float minAngle  = (float) now.get( Calendar.MINUTE ) / 60 * 360;
/xsp:logic
  hourxsp:exprhourAngle/xsp:expr/hour
minutexsp:exprminAngle/xsp:expr/minute
/time

You can always check the Java code generated by the xsp, this sometimes
helps to understand the error.

Jan


Jan Uyttenhove
- Software Engineer -
The E-corporation
http://www.the-ecorp.com 


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 13, 2001 11:28
To: [EMAIL PROTECTED]
Subject: problems with xsp date


Hi all

I'm trying to create a simple XSP page that gets the current hour and minute
and passes it on to a stylesheet. The cocoon docs say XSP automatically
generates import statements for the most commonly used Java libraries
(including java.util.Date).

However when I try run the page I get an error: Type expected.
now.setTime(new Date());

Has anybody got any ideas?

Here is the relevant part of the page:

xsp:logic
   Calendar now = Calendar.getInstance();
now.setTime( new Date() );
float hourAngle = (float) now.get( Calendar.HOUR   ) / 12 * 360; 
float minAngle  = (float) now.get( Calendar.MINUTE ) / 60 * 360;
  /xsp:logic

time

hourxsp:exprhourAngle/xsp:expr/hour
   minutexsp:exprminAngle/xsp:expr/minute

/time

thanks in advance!

Lisa

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.html

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]