[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Putting a param into <link />

Subject: Re: Putting a param into <link />
From: Marco Guazzone <sguazt@xxxxxxxxxxx>
Date: Wed, 12 Mar 2003 11:34:47 +0100 (CET)
use a variable in href
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.