xsl-list
[Top] [All Lists]

Re: Variable construction: Afterthought...

2005-09-21 08:15:55

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[(_at_)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
________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>