You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Bill Parkinson <bi...@yahoo.com> on 2000/05/05 04:36:20 UTC

xsl file pathnames on the server

All,

Here is my dilemma, I wish to have one set of style sheets for
controlling most of my pages on a server.

My original thought was to place all stylesheets in an xsl
directory.

ex:  *htdocroot*/xsl/mystyle.xsl

Then in each XML page I could have a standard PI to refer to the
style sheet
<?xml-stylesheet href="/xsl/mystyle.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>

The idea being that no matter what the URI location of the XML
source document the same PI's would apply.  (The idea is to make
like as easy as possible for content authors.)

However it seems that the href in the xml-sytlesheet PI is
always just appended to the URI path of the reuqested XML source
document.

For example if

*htdocroot*/a/b/c/home.xml

contained the above sytle PI's cocoon will create a path name
for the stylesheet of 

*htdocroot*/a/b/c//xsl/mystyle.xsl


One possible workaround is to place the as many ../ 's in each
PI as needed. But this makes life harder for content creators,
and is a source of errors.

Has anyone had this same trouble?  Any solutions I have not
considered?  Perhaps 1.7.3 works differently?

Thanks,
Bill Parkinson


__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Re: xsl file pathnames on the server

Posted by Stefano Mazzocchi <st...@apache.org>.
Ulrich Mayring wrote:
> 
> Bill Parkinson wrote:
> >
> > All,
> >
> > Here is my dilemma, I wish to have one set of style sheets for
> > controlling most of my pages on a server.
> 
> This is an old problem, stylesheet URIs cannot be relative URIs, because
> anything starting with a "/" will be interpreted by cocoon as a file and
> appended to the current directory. What you can write is
> "http://myhost.mydomain.tld/xsl/myxsl.xsl"
> 
> This works, but as soon as you start moving files to a different server
> or even rename your server, you'll have to manually change it again.
> 
> I proposed to Stefano to interpret anything as a URI and he put it on
> the to-do list. I just checked the to-do list and the issue is not there
> anymore, so I guess the change is committed and will appear in 1.7.3

Yes, I fixed a bug but I'm not sure it does what you guys want.

Anyway, I was able to have both absolute and relative stylesheets. But
note, they are absolute in respect of the disk, not the URI resources.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Missed us in Orlando? Make it up with ApacheCON Europe in London!
------------------------- http://ApacheCon.Com ---------------------



Re: xsl file pathnames on the server

Posted by Ulrich Mayring <ul...@denic.de>.
Bill Parkinson wrote:
> 
> All,
> 
> Here is my dilemma, I wish to have one set of style sheets for
> controlling most of my pages on a server.

This is an old problem, stylesheet URIs cannot be relative URIs, because
anything starting with a "/" will be interpreted by cocoon as a file and
appended to the current directory. What you can write is
"http://myhost.mydomain.tld/xsl/myxsl.xsl"

This works, but as soon as you start moving files to a different server
or even rename your server, you'll have to manually change it again.

I proposed to Stefano to interpret anything as a URI and he put it on
the to-do list. I just checked the to-do list and the issue is not there
anymore, so I guess the change is committed and will appear in 1.7.3

Ulrich

-- 
Ulrich Mayring
DENIC eG, Systementwicklung