|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Hi all
I'm having issues with hyperlinks and hoping someone can prevent further hair loss I've got some hyperlinks which need to be transformed from XML into in the following html format: a href = frame1.html?displayform.html&frame2.html&DBSearchId&LinkDisplaytext the xml I've got is: <Link frame1="frame1.html" displayform="BS.html" frame2="frame2.html DBId="12345">Bodgett and Scarper Inc </ Link> I've tried the following XSL, but XMLSpy wont accept it: <xsl:value-of select="concat(@frame1, '?', @displayform, '&', @frame2, '&', @DBId, text())"/> any ideas on how I concatenate the '?' and '&' into the hyperlink? T.I.A ![]() |
|
#2
|
|||
|
|||
|
thanks - was being a bit blonde
|
|
#3
|
|||
|
|||
|
er....
this is what i ended up using for the concatenation: <xsl:value-of select="concat(@frame1, '?', @displayfile, '&', @frame2, '&', @companyid, Value)"/> which gets transformed into this html: <a href="frame1.html?BS.html&frame2.html&12345">Bodgett and Scarper Inc</a> does the job nicely! and all is well XML land...on that note, it must be time to go to the pub. cheers! |
|
#4
|
|||
|
|||
|
ok I lied
all is not well with hyperlinks I'm trying to pass a parameter via hyperlink into an HTML page, this parameter is then used to perform a database query and dynamically build a new html page. why am i posting this question in the XML forum? because i can't get XSL concatenate '&' into a hyperlink still in a normal html file my link format is: <a href='frame1.html?parent.xml&target.html¶m1¶m2'>displaytext</a> in my XML file i have a link element: <Link frame1="frame.html" parent="parent.html" target="target.html" param1="param1" param2="param2"> DisplayText</Link> my XSL reads: ... <a> <xsl:attribute name="href"> <xsl:value-of select="concat Link/@frame1,'?',Link/@parent,'&',Link/@target,'&', Link/@param1,'&',Link/@param2)"/> </xsl:attribute> <xsl:value-of select="Value"/></font> </a> ... after the XSL transformation the XHTML looks like this <td bgcolor="pink"> <a href="frame.html?parent.xml&target.html&12345&Bodget and Scarper">Bodget and Scarper</a> the link does't work however. Where am I going wrong? any insights gratefully received! Last edited by PommieChick : June 4th, 2003 at 01:06 AM. |
|
#5
|
|||
|
|||
|
oh hell...the ampersand bits have got screwed in that last message
in the XSL all the ampersands should read: quote ampersand amp semicolon quote ('amp;') this is how they come out in the final html ref as well |
|
#6
|
|||
|
|||
|
um...gotta fess up, have been VERY blonde...the XSL is fine....i just forgot to include the path to a jscript file that is run onload of the transformed XHTML page
i shall go crawl back under my rock.... ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > concatenating special characters into a hyperlink |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|