Re: [xsl] Putting a param into <link />

Subject: Re: [xsl] Putting a param into <link />
From: Marco Guazzone <sguazt@xxxxxxxxxxx>
Date: Wed, 12 Mar 2003 11:34:47 +0100 (CET)
Hi Simon,
First it seems you have named a variable and a param with the same value
and it's not correct; if you really want to have a variable and a param
with a very similar name you can prefix them with a "v" and a
"p" respectively; i.e.:
<xsl:variable name="vProject" ...
<xsl:param name="pProject" ...
or you don't like java-style [ :) ] you can use
<xsl:variable name="v_project" ...
<xsl:param name="p_project" ...
[ I usually use a notation like that to remember what is a param and what
is a variable ]

Second, you have to surround the reference to $project inside the href
attribute with "{...}"; i.e.:
<link
rel="stylesheet" type="text/css" href="/{$project}/css/styles.css" />

Hope this helps you!
Regards,

--------------------------------
Marco Guazzone
Software Engineer
Kerbero S.r.L. - Gruppo TC
Viale Forlanini, 36
Garbagnate M.se (MI)
20024 - Italy
mail: marco.guazzone@xxxxxxxxxxx
www: http://www.kerbero.com
Tel. +39 02 99514.247
Fax. +39 02 99514.399
--------------------------------

On Wed, 12 Mar 2003, Simon Kelly wrote:

> Hi all,
> 
> I am trying to make all of my xsl-t's as portable as possible for the
> project I am creating, but have come up against a problem I can't find an
> answer for in the books. I want to pass the project (and base uri name) into
> all references as a parameter, but when the page is transformed into html
> the href still has $project and not the project name. (See below)  I tried
> ${project} but this just left the $ in by itself.
> 
> Any pointers would be most appreciated.
> 
> Cheers
> 
> Simon
> 
> <xsl:variable name="project" select="/root/session/projectName" />
> .......
> <xsl:param name="project" />
>         <head>
>             <!-- Title for each page -->
>             <title><xsl:value-of select="$pageTitle" /></title>
>             <!-- link for the stylesheet that will format all of our pages
> in the
>                  same manner -->
>             <link rel="stylesheet" type="text/css"
> href="/$project/css/styles.css" />
> 
> 
> Institut fuer
> Prozessdatenverarbeitung
> und Elektronik,
> Forschungszentrum Karlsruhe GmbH,
> Postfach 3640,
> D-76021 Karlsruhe,
> Germany.
> 
> Tel: (+49)/7247 82-4042
> E-mail : kelly@xxxxxxxxxx
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread