Page 1 of 1 |
|
|
Back to top |
|
 |
|
Posted: 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 |
|
 |
|
Posted: Thu, 19th Apr 2012 23:48 Post subject: |
|
 |
Yeah well, what about carlisle? you don't go into it anywhere 
|
|
Back to top |
|
 |
|
Posted: Thu, 19th Apr 2012 23:58 Post subject: |
|
 |
|
|
Back to top |
|
 |
|
Posted: 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
You'd name the xml tag <dealership location="carlisle">
And your code would look like this
<xsl:for-each select="dealerships/bikes/dealership">
It's pretty messed up anyway, just go on dude 
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
|
Posted: 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>
|
|
|
Back to top |
|
 |
|
Posted: Sun, 22nd Apr 2012 03:26 Post subject: |
|
 |
|
|
Back to top |
|
 |
|
Posted: Sun, 22nd Apr 2012 13:21 Post subject: |
|
 |
No problem 
|
|
Back to top |
|
 |
Page 1 of 1 |
All times are GMT + 1 Hour |