Re: [xsl] Variable construction: Afterthought...

Subject: Re: [xsl] Variable construction: Afterthought...
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 21 Sep 2005 16:15:55 +0100
> There is an existing document which I cannot change. In the document there
> is a line of code...

If it is an input document it's not code it's just text, as Michael
said, Yopu could leave it as ="{$helpUrl}" but it may as well be any
other string, it is not an XSLT variable reference if it is not in an
XSL file.


> I understand that the {$helpUrl} is a variable.

Not unless the file is an xslt file (I'm stil not sure from your
description whether it is or not)

> ..so I thought that
> 
> <xsl:variable name="helpUrl"
> select="http://info.uwe.ac.uk/myuwe/myMarks.asp"/>
> 
> ...would suffice.

that selects an element named myMarks.asp that is a child of an element
myuwe which is a child of an element info.uwe.ac.uk which is a
descendent of an element http: so it's a legal XPath butnot what you
intended, you need to put ' ' around a string.

then if your file containing href="{$helpUrl}"> is an xsl file that
you've imported it will expand teh variable reference automatically.

if it is an input file then you will need a template that  matches

match="a[@href='{$helpUrl}']" that generates whatever you need to
generate.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread