Hello

I have no knowledge of XSLT-generated XHTML pages, but I make extensive use
of the header 'BASE' tag and my CSS files always come through, so you may
want to consider that option.


<html>

    <head>
        ...
        <base href="https://www.my-domain-name.com/my-web-app-name/";>
        <link rel="stylesheet" type="text/css" href="asset/css/my.css">
        ...
    </head>

<body>

...


Notice the trailing forward-slash in the BASE tag hyperlink reference. This
means that all other hyperlink references are stated as being relative to
that, and must NOT start with a leading forward-slash.

I specify the BASE tag using a custom tag that retrieves the base hyperlink
value from a context initialisation parameter (specified in the deployment
descriptor).

Using the BASE means that *all* my URL references are relative - and it has
not let me down yet.

Good luck!

Harry Mantheakis
London, UK



> 
> Greetings fellow Tomcat dancers,
> 
> Been losing cycles in a gumption trap, trying to hook a CSS file
> up to XSLT-generated XHTML pages. Many thanks to whomever sees
> my obvious error.
> 
> If I hardwire the full-path filename of my development environment
> into the XSLT file, all works as hoped/planned/dreamed. But all
> other techniques I've tried fail.
> 
> 
> Tomcat: 5.0.19. Webapp name: nrd.
> 
> WAR layout:
> 
> |-nrd
>   |-css/nrd.css
>   |-images/
>   |-Meta-inf/
>   |-Web-inf/
>     |-classes/
>     |-dtd/
>     |-lib/
>     |-xsl/
>     |-web.xml
> 
> web.xml:
> 
>   <web-app>
>     <servlet>
>       <servlet-name>
>         controller
>       </servlet-name>
>       <servlet-class>
>         org.apnp.nrd.ControlServlet
>       </servlet-class>
>     </servlet>
> 
>     <servlet-mapping>
>       <servlet-name>
>         controller
>       </servlet-name>
>       <url-pattern>
>         /*
>       </url-pattern>
>     </servlet-mapping>
>   </web-app>
> 
> XSLT source that works:
> 
>   <head>
>     <meta http-equiv="Content-Type"
>           content="application/xhtml+xml; charset=utf-8"/>
>   
>     <link rel="stylesheet" type="text/css"
>           href="C:\Apache\Tomcat\Tomcat50\webapps\nrd\css\nrd.css"/>
>   </head>
> 
> 
> Versions of CSS href that do not work:
> 
>           href="css/nrd.css"/>
>           href="/css/nrd.css"/>
>           href="./css/nrd.css"/>
>           href="nrd/css/nrd.css"/>
>           href="/nrd/css/nrd.css"/>
>           href="./nrd/css/nrd.css"/>
> 
> 
> I've also tried setting a global XSLT parameter:
> 
>     <xsl:param name="rootDir" select="'../docroot'"/>
> 
> and calling that:
> 
>     <link rel="stylesheet" type="text/css"
>           href="{$rootDir}css/nrd.css"/>
> 
> which results in a known unsuccesful link:
> 
>           href="/nrd/css/nrd.css"
> 
> 
> Please, if you can, tell me what obvious thing I've missed.
> 
> Thanks for any suggestions.
> 
> 
> Best wishes,
> 
> William BC Crandall
> bc.crandall [around] earthlink.net
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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

Reply via email to