[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: How to create active hyperlinks from xml file

Subject: Re: How to create active hyperlinks from xml file
From: "Joe McDonald" <joe@xxxxxxxxxxxxxxx>
Date: Mon, 17 Jul 2000 13:41:53 -0400
hyperlinks in xml
Your solution works fine.
I am trying to make one stylesheet that I can use for multiple xml files
that contain hyperlinks.  The following is as close as I can get.  The xml
file returns the text for the link but not an actual hyperlink.  What am I
doing wrong?  I just cannot get the hyperlink to work at all.  In the
stylesheet I have your example that works fine for <webadd>.  I am a
<newbie/> and am sorry for the length but I have tried everything and
nothing seems to work.  I would really appreciate any help.  Thank you.  Joe

Here is the xml file:

<?xml version="1.0"?>

<?xml-stylesheet type="text/xsl" href="shops.xsl"?>
<main>
 <listing>
  <category>
  Auto Dealers
  </category>
 <company>

  <name>E-Z Credit Motors
  </name>
  <address>19465 Sumpter Rd.
  Belleville, MI 48111
  </address>
  <phone>(734) 697-2682
  </phone>

  <xlink:simple
    xmlns:xlink="http://www.w3.org/XML/XLink/0.9"
    href="mailto:joe@xxxxxxxxxxxxxxx";>
    <email> joe
  </email></xlink:simple>

  <webadd>click here
  </webadd>
 </company>
 <company>
  <name>Gib's Auto Sales
  </name>
  <address>49412 Michigan Ave.
  Belleville, MI 48111
  </address>
  <phone>(734) 432-9666
  </phone>
  <email/>
  <webadd1>gib</webadd1>
 </company>
 <company>
  <name>Atchinson Ford Sales Inc</name>

  <address>9800 Belleville Rd.
  Belleville, MI 48111</address>

  <phone>(734) 697-9161</phone>

  <email/>
  <webadd/>
 </company>

</listing>
</main>

And here is the xsl file:

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
   <xsl:template match="/">

 <html>
 <head><title>Belleville Online Business Listing</title>
 </head>
 <body>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
   <tr>
    <td>
    <div align="center">
    <img src="belleville.gif"/>
    <br/>
    </div>
    </td>
   </tr>

   <tr>
    <div align="center"><td>
     <table width="100%" cellpadding="2" cellspacing="2" border="1">
      <tr><xsl:for-each select="main/listing">
      <td class="category" colspan="5" align="center">
      <xsl:value-of select="category"/>
      </td>
      </xsl:for-each>
      </tr>
      <tr>
      <td align="center" class="list">
      Name</td>
      <td align="center" class="list">
      Address</td>
      <td align="center" class="list">
      Phone</td>
      <td align="center" class="list">
      Email</td><td align="center" class="list">
      Web Address</td>
      </tr>
      <xsl:for-each select="main/listing/company">
      <tr>
      <td align="center" class="ind">
       <xsl:value-of select="name"/>
      </td>
      <td align="center" class="ind">
       <xsl:value-of select="address"/>
      </td>
      <td align="center" class="ind">
       <xsl:value-of select="phone"/>
      </td>
<!--this is where I cannot get this to work.  I get "joe" on my webpage but
it is not a hyperlink
      <td align="center" class="ind">
      <xsl:value-of select="xlink:simple"/>
      </td>
//-->
      <td align="center" class="ind">
      <a href="index.xml"><xsl:value-of select="webadd"/></a>
      <a href="http://www.joeinternet.net"><xsl:value-of
select="webadd1"/></a>
      </td>
      </tr></xsl:for-each>
     </table>
   </td></div>
   </tr>
  </table>
 </body>
 </html>
</xsl:template>
</xsl:stylesheet>

----- Original Message -----
From: "Kay Michael" <Michael.Kay@xxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxx>
Sent: Monday, July 17, 2000 10:20 AM
Subject: RE: How to create active hyperlinks from xml file


> > In theory the following should work:
> > <a href="{url}><xsl:value-of select="{url}"/></a>
>
> Read:
> <a href="{url}"><xsl:value-of select="url"/></a>
>
> The select attribute is already an XPath expression, so it doesn't need
(and
> doesn't allow) the curly brackets.
>
> Mike Kay
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.