XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old May 29th, 2003, 11:58 PM
PommieChick PommieChick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 21 PommieChick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 55 sec
Reputation Power: 0
Unhappy concatenating special characters into a hyperlink

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


Reply With Quote
  #2  
Old May 30th, 2003, 09:38 PM
PommieChick PommieChick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 21 PommieChick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 55 sec
Reputation Power: 0
Wink

thanks - was being a bit blonde

Reply With Quote
  #3  
Old May 30th, 2003, 10:27 PM
PommieChick PommieChick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 21 PommieChick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 55 sec
Reputation Power: 0
Smile

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!

Reply With Quote
  #4  
Old June 4th, 2003, 01:01 AM
PommieChick PommieChick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 21 PommieChick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 55 sec
Reputation Power: 0
Angry

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&param1&param2'>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.

Reply With Quote
  #5  
Old June 4th, 2003, 01:09 AM
PommieChick PommieChick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 21 PommieChick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 55 sec
Reputation Power: 0
Exclamation

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

Reply With Quote
  #6  
Old June 4th, 2003, 05:48 PM
PommieChick PommieChick is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 21 PommieChick User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 55 sec
Reputation Power: 0
Lightbulb

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....

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > concatenating special characters into a hyperlink


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway