You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Gerard van Enk <ge...@eo.nl> on 2000/01/04 10:43:03 UTC

Problem StyleBook and Linux solved?????

Hello,

I think I discovered what caused the problem with stylebook on a Linux box.
The problem was that it didn't work 8-( . When I tried the examples in de
doc-directory I got the following errormessage:

<skip/>
[XalanProcessor] Applying XSL sheet
"sbk:/style/stylesheets/book2project.xsl"
org.apache.stylebook.CreationException: sbk:/style/resources/
(/home/gerard/xml/xml-stylebook/home/gerard/xml/xml-stylebook/styles/apachex
ml/resources)
is not a Directory
<skip/>

The problem is caused by this part of the Directory producer
(DirectoryProducer.java):

if (source.getProtocol().equals("file")) {
    // Trim the file name and open the directory
    String src=source.getFile();
    for(int x=0;x<src.length();x++) if (src.charAt(x)!='/') {
        src=src.substring(x);
        break;
    }

On a linuxbox 'src' becomes something like:
'/home/apache/xml/xml-stylebook/styles/apachexml/resources/' after the
'String src=source.getFile()'-statement. If you trim the file name it
becomes a relative path (because the '/' is removed) and you get the
errormessage when it tries to open this directory.

On a winbox src becomes somtheing like:
'/D:/apache/xml/xml-stylebook/styles/apachexml/resources/' after the 'String
src=source.getFile()'-statement. If you trim the filename everything works
just fine.

I removed the following lines from directory-producer:

    for(int x=0;x<src.length();x++) if (src.charAt(x)!='/') {
        src=src.substring(x);
        break;
    }

And......everything works, on a linux box, on a Win98 box and on a Winnt
box. I think 'File file=new File(src).getCanonicalFile();' ignores the '/'
before d:/ because after this statement file.toString() gives:
'D:\apache\xml\xml-stylebook\styles\apachexml\resources' on a Win98 box.

Is this a right solution or are there new problems introduced by this???
Maybe someone can test it, Pier???

Gerard


Re: Problem StyleBook and Linux solved?????

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Gerard van Enk wrote:
> 
> > I'll commit that to CVS, and provide a new binary for testing.
> 
> I thought you already did this yesterday?

Sometimes my mail server forgets to send mail for a fay or two!

> Are there any ideas about how Cocoon and Stylebook are going to be merged?

Have you seen the SiteMap proposal??? That's it... They will not be
properly "merged" (no codebase from both of them), but rather the ideas
and comments after 1 year (for cocoon) and 6 months (for stylebook) will
be merged into one single piece of code to handle both off-line web
sites generation (ala stylebook) and dynamic xml rendering (ala cocoon).

	Pier

RE: Problem StyleBook and Linux solved?????

Posted by Gerard van Enk <ge...@eo.nl>.
> > I removed the following lines from directory-producer:
> >
> >     for(int x=0;x<src.length();x++) if (src.charAt(x)!='/') {
> >         src=src.substring(x);
> >         break;
> >     }
> >
> > And......everything works, on a linux box, on a Win98 box and on a Winnt
> > box. I think 'File file=new File(src).getCanonicalFile();'
> ignores the '/'
> > before d:/ because after this statement file.toString() gives:
> > 'D:\apache\xml\xml-stylebook\styles\apachexml\resources' on a Win98 box.
> >
> > Is this a right solution or are there new problems introduced by this???
> > Maybe someone can test it, Pier???
>
> I'll commit that to CVS, and provide a new binary for testing.
>

I thought you already did this yesterday?

Are there any ideas about how Cocoon and Stylebook are going to be merged?

Gerard


Re: Problem StyleBook and Linux solved?????

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Gerard van Enk wrote:
> 
> Hello,
> 
> I think I discovered what caused the problem with stylebook on a Linux box.
> The problem was that it didn't work 8-( . When I tried the examples in de
> doc-directory I got the following errormessage:
> 
> <skip/>
> [XalanProcessor] Applying XSL sheet
> "sbk:/style/stylesheets/book2project.xsl"
> org.apache.stylebook.CreationException: sbk:/style/resources/
> (/home/gerard/xml/xml-stylebook/home/gerard/xml/xml-stylebook/styles/apachex
> ml/resources)
> is not a Directory
> <skip/>
> 
> The problem is caused by this part of the Directory producer
> (DirectoryProducer.java):
> 
> if (source.getProtocol().equals("file")) {
>     // Trim the file name and open the directory
>     String src=source.getFile();
>     for(int x=0;x<src.length();x++) if (src.charAt(x)!='/') {
>         src=src.substring(x);
>         break;
>     }
> 
> On a linuxbox 'src' becomes something like:
> '/home/apache/xml/xml-stylebook/styles/apachexml/resources/' after the
> 'String src=source.getFile()'-statement. If you trim the file name it
> becomes a relative path (because the '/' is removed) and you get the
> errormessage when it tries to open this directory.
> 
> On a winbox src becomes somtheing like:
> '/D:/apache/xml/xml-stylebook/styles/apachexml/resources/' after the 'String
> src=source.getFile()'-statement. If you trim the filename everything works
> just fine.
> 
> I removed the following lines from directory-producer:
> 
>     for(int x=0;x<src.length();x++) if (src.charAt(x)!='/') {
>         src=src.substring(x);
>         break;
>     }
> 
> And......everything works, on a linux box, on a Win98 box and on a Winnt
> box. I think 'File file=new File(src).getCanonicalFile();' ignores the '/'
> before d:/ because after this statement file.toString() gives:
> 'D:\apache\xml\xml-stylebook\styles\apachexml\resources' on a Win98 box.
> 
> Is this a right solution or are there new problems introduced by this???
> Maybe someone can test it, Pier???

I'll commit that to CVS, and provide a new binary for testing. 

	Pier