Hi Guys
I hope this is a simple one for you.
I am basically displaying data onto my xml page using the following line of code:
<xsl:value-of select="carmanufacturer" />
An example of the resulting output would be, "Ford"
However, the "carmanufacturer" field in my table sometimes contains 2 words, for example, "Land Rover". Thus, the resulting output is, "Land Rover".
The output on my page is also hyperlinked and so the code is as follows:
<a class="type1" href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.mywebsite.co.uk/{carmanufacturer}.asp"><xsl:value-of select="carmanufacturer" /></a>
The problem I have is that for the hyperlink url I would like to replace the spaces between the 2 words with a "-". Thus my link would point to:
<!-- m --><a class="postlink" href="http://www.mywebsite.co.uk/Land-Rover.asp">http://www.mywebsite.co.uk/Land-Rover.asp</a><!-- m -->
I have tried using something like this "<xsl:value-of select="replace(carmanufacturer,' ', '-')" />" but I get the following error:
-------------error----------------
msxml3.dll error '80004005'
'replace' is not a valid XSLT or XPath function. -->replace(carmanufacturer, ' ', '-')<--
--------------error end------------
Looking at various forums they say this error occurs because I have XSLT 1.0 and not XSLT 2.0 but I am unsure what version I've got. If the code I am using should work then I assume that I have version 1.0??? However, I do not know what code I need to use to make this work.
Any ideas would be fully appreciated.
Best regards
Rod from the UK
I hope this is a simple one for you.
I am basically displaying data onto my xml page using the following line of code:
<xsl:value-of select="carmanufacturer" />
An example of the resulting output would be, "Ford"
However, the "carmanufacturer" field in my table sometimes contains 2 words, for example, "Land Rover". Thus, the resulting output is, "Land Rover".
The output on my page is also hyperlinked and so the code is as follows:
<a class="type1" href=http://www.webdeveloper.com/forum/archive/index.php/"http://www.mywebsite.co.uk/{carmanufacturer}.asp"><xsl:value-of select="carmanufacturer" /></a>
The problem I have is that for the hyperlink url I would like to replace the spaces between the 2 words with a "-". Thus my link would point to:
<!-- m --><a class="postlink" href="http://www.mywebsite.co.uk/Land-Rover.asp">http://www.mywebsite.co.uk/Land-Rover.asp</a><!-- m -->
I have tried using something like this "<xsl:value-of select="replace(carmanufacturer,' ', '-')" />" but I get the following error:
-------------error----------------
msxml3.dll error '80004005'
'replace' is not a valid XSLT or XPath function. -->replace(carmanufacturer, ' ', '-')<--
--------------error end------------
Looking at various forums they say this error occurs because I have XSLT 1.0 and not XSLT 2.0 but I am unsure what version I've got. If the code I am using should work then I assume that I have version 1.0??? However, I do not know what code I need to use to make this work.
Any ideas would be fully appreciated.
Best regards
Rod from the UK