cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Allan Erskine <a.ersk...@cs.ucl.ac.uk>
Subject Re: [C2] XSP / keywords in directory names
Date Thu, 01 Mar 2001 12:42:40 GMT
I think what Matthias meant was to have a mapping of directory names to
package names that circumvented the whole reserved words problem...his
example was clear enough....

package blah._static_;

is fine and unless I'm missing something should be easy to implement as part
of the package naming process.

- Allan

----- Original Message -----
From: "Klaasen Tom" <Tom.Klaasen@the-ecorp.com>
To: <cocoon-dev@xml.apache.org>
Sent: Thursday, March 01, 2001 12:14 PM
Subject: RE: [C2] XSP / keywords in directory names


Matthias,

This is not a Cocoon "bug", it is something that is defined in the Java
Language Specification:

on http://java.sun.com/docs/books/jls/first_edition/html/19.doc.html#52996,
we read:

PackageDeclaration:
package Name ;

Name:
SimpleName
QualifiedName

SimpleName:
Identifier

QualifiedName:
Name . Identifier

thus a packagedeclaration consists of Identifiers. On
http://java.sun.com/docs/books/jls/first_edition/html/3.doc.html#229308, we
see:

3.9 Keywords
The following character sequences, formed from ASCII letters, are reserved
for use as keywords and cannot be used as identifiers (ยง3.8): [...]

So the Java Language _specifies_ you can't use keywords as package names.

If you want to "fix" this, feel free to define a new language. Call it C##
or so ;)

tomK

> -----Original Message-----
> From: Matthias D. Herold [mailto:mhe@javisto.com]
> Sent: donderdag 1 maart 2001 12:39
> To: cocoon-dev@xml.apache.org
> Subject: Re: [C2] XSP / keywords in directory names
>
>
> Hello Davanum,
>
> if I rename the directory, it works. But I think it should also work
> with java keywords as directory name...
>
> IMO there should be a better method for mapping directories
> to package names
> (for example just adding underscores to the beginning and the
> end of each
> package name would be fine: directory /static maps to
> org.apache.cocoon._static_).
>
> I am currently not familiar enough with the code to be able
> to fix such things;
> so I'll just send bug reports  ;-)
>
>
> Regards,
>
> Matt
>
> ----- Original Message -----
> From: "Davanum Srinivas" <dims@yahoo.com>
> To: <cocoon-dev@xml.apache.org>
> Sent: Thursday, March 01, 2001 12:14 PM
> Subject: Re: [C2] XSP / keywords in directory names
>
>
> > Matthias,
> >
> > As far as i know "static" is a java keyword and hence
> should not be in the package name. So please
> > rename the directory and try again.
> >
> > Thanks,
> > dims
> >
> > --- "Matthias D. Herold" <mhe@javisto.com> wrote:
> > > Hello,
> > >
> > > I just downloaded C2 and tried to write some XSP-Pages.
> It works fine, except
> > > when I want to load an XSP-file that is in a directory
> with the name of a java
> > > keyword (for example: 'static/index.xsp').
> > >
> > > DEBUG   16895   [cocoon  ] (Thread-10): Language Exception
> > > org.apache.cocoon.components.language.LanguageException:
> Error compiling index_xsp:
> > > Line 0, column 0:
> > >
> C:\old_prog\tomcat\work\localhost_8080%2Fstatic\org\apache\coc
> oon\static\index_xsp.java:3:
> > > Identifier expected.
> > > package org.apache.cocoon.static;
> > >                           ^
> > > Line 0, column 0:
> > >
> C:\old_prog\tomcat\work\localhost_8080%2Fstatic\org\apache\coc
> oon\static\index_xsp.java:59:
> > > Superclass XSPGenerator of class index_xsp not found.
> > > public class index_xsp extends XSPGenerator {
> > >                                ^
> > >
> > > Tested on Win2000 / Sun JDK 1.3; latest Cocoon2-CVS.
> > >
> > >
> > > Regards,
> > >
> > > Matthias
> > >
> > >
> > >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > > For additional commands, email: cocoon-dev-help@xml.apache.org
> > >
> >
> >
> > =====
> > Davanum Srinivas, JNI-FAQ Manager
> > http://www.jGuru.com/faq/JNI
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email at your own domain with Yahoo! Mail.
> > http://personal.mail.yahoo.com/
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> > For additional commands, email: cocoon-dev-help@xml.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>

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



Mime
View raw message