clickable HTML links in XML/XSL page?
Page 1 of 1
Steve-O 2004




Posts: 2851

PostPosted: Thu, 19th Apr 2012 23:10    Post subject: clickable HTML links in XML/XSL page?
Can you have a clickable hyperlink on a XML page styled with XSL ? I have a list of car dealerships with links to the dealers homepage but cant seem to make them clickable on my XML page.

This is my last Web based question for a long time lol Smile


George W Bush -

'...more and more of our imports are coming from overseas.'
Back to top
Steve-O 2004




Posts: 2851

PostPosted: Thu, 19th Apr 2012 23:17    Post subject:
this is my XSL page code to display the XML Data -

Code:
    <xsl:for-each select="dealerships/bikes/*">
       
        <div style="background-color:orange;color:black;padding:4px; max-width:720px; margin-left:35px; border:thin solid black; margin-top:20px;">
        <span style="font-weight:bold; text-align:center; font-family:calibri; font-size:13pt; "><xsl:value-of select="name"/>
      - <xsl:value-of select="contact"/></span>
        </div>
       
        <div style="margin-left:35px;margin-bottom:1em;font-size:13pt; font-family:calibri; max-width:720px; background-color:white; border:thin solid black; padding:4px;">
        <xsl:value-of select="description"/>
        <xsl:value-of select="website"/>
        </div>
   
        </xsl:for-each>
   


This is my sample XML data -


Code:

<dealerships>   
     <bikes>   
               <carlisle>
                <name>Suzuki</name>
                <description>KC Superbikes is the number one place for new and used Suzuki's and all your servicing needs</description>
                <contact>01228 525024</contact>
                         <website>http://www.kcsuperbikes.co.uk/suzuki</website>
          </carlisle>
      </bikes>
</dealerships>


can I make that web link clickable? (The one in the XML under website)


George W Bush -

'...more and more of our imports are coming from overseas.'
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Thu, 19th Apr 2012 23:48    Post subject:
Yeah well, what about carlisle? you don't go into it anywhere Smile


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Steve-O 2004




Posts: 2851

PostPosted: Thu, 19th Apr 2012 23:58    Post subject:
PumpAction wrote:
Yeah well, what about carlisle? you don't go into it anywhere Smile


This is just a sample snip of my XML Wink

the carlisle tag is seperating all the carlisle deaerships from other locations eg penrith etc Smile

The XML page works exaclty how I want it just would like to be able to click the website link Very Happy

oh and bikes is seperating the bike dealerships from car dealerships Wink

thanks


George W Bush -

'...more and more of our imports are coming from overseas.'
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Fri, 20th Apr 2012 00:00    Post subject:
of course:
<a href="{website}"><xsl:value-of select="website"/></a>


btw you would never distingush them this way Smile

You'd name the xml tag <dealership location="carlisle"> Smile

And your code would look like this
<xsl:for-each select="dealerships/bikes/dealership">

It's pretty messed up anyway, just go on dude grinhurt


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Steve-O 2004




Posts: 2851

PostPosted: Fri, 20th Apr 2012 01:52    Post subject:
lol it might be a mess but it works and that all I care about LOL Very Happy

Will try that thanks


George W Bush -

'...more and more of our imports are coming from overseas.'
Back to top
Steve-O 2004




Posts: 2851

PostPosted: Sat, 21st Apr 2012 23:23    Post subject:
sorry to be a complete arse but where exactly do I put that code Razz could you edit my example code to show where to put it?

Thanks Very Happy


George W Bush -

'...more and more of our imports are coming from overseas.'
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Sun, 22nd Apr 2012 00:12    Post subject:
Quote:

<xsl:for-each select="dealerships/bikes/*">

<div style="background-color:orange;color:black;padding:4px; max-width:720px; margin-left:35px; border:thin solid black; margin-top:20px;">
<span style="font-weight:bold; text-align:center; font-family:calibri; font-size:13pt; "><xsl:value-of select="name"/>
- <xsl:value-of select="contact"/></span>
</div>

<div style="margin-left:35px;margin-bottom:1em;font-size:13pt; font-family:calibri; max-width:720px; background-color:white; border:thin solid black; padding:4px;">
<xsl:value-of select="description"/>

<a href="{website}"><xsl:value-of select="website"/></a>
</div>

</xsl:for-each>


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Steve-O 2004




Posts: 2851

PostPosted: Sun, 22nd Apr 2012 03:26    Post subject:
PumpAction wrote:
Quote:

<xsl:for-each select="dealerships/bikes/*">

<div style="background-color:orange;color:black;padding:4px; max-width:720px; margin-left:35px; border:thin solid black; margin-top:20px;">
<span style="font-weight:bold; text-align:center; font-family:calibri; font-size:13pt; "><xsl:value-of select="name"/>
- <xsl:value-of select="contact"/></span>
</div>

<div style="margin-left:35px;margin-bottom:1em;font-size:13pt; font-family:calibri; max-width:720px; background-color:white; border:thin solid black; padding:4px;">
<xsl:value-of select="description"/>

<a href="{website}"><xsl:value-of select="website"/></a>
</div>

</xsl:for-each>


Excellent, Thanks alot Very Happy Very Happy Very Happy Im happy now Very Happy Very Happy Very Happy


George W Bush -

'...more and more of our imports are coming from overseas.'
Back to top
PumpAction
[Schmadmin]



Posts: 26759

PostPosted: Sun, 22nd Apr 2012 13:21    Post subject:
No problem Smile


=> NFOrce GIF plugin <= - Ryzen 3800X, 16GB DDR4-3200, Sapphire 5700XT Pulse
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group