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

Re: XSL Contextual formatting of links

Subject: Re: XSL Contextual formatting of links
From: "cking" <cking@xxxxxxxxxx>
Date: Mon, 9 Aug 2004 18:25:50 +0200
html contextual links
BTW, it's a pity too that the stylesheet only works in IE:
With a few small modifications, it would also work in Netscape/Mozilla (maybe other browsers too):

1. add the default (html) namespace to the xsl:stylesheet element:

  <xsl:stylesheet version="1.0"
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

2. replace your xsl:output by:
  <xsl:output
    method="xml"
    version="1.0"
    encoding="iso-8859-1"  ---(or the encoding you want to use)
    indent="yes"
    doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
    />

3. In the root template, wrap a html/body element around the table:
  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title><xsl:value-of select="title"/></title>
      </head>
      <body>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          ....
        </table>
      </body>
    </html>
  </xsl:template>

I used the "XHTML 1.0 Strict" doctype here, in which case you will also have to
change some attributes (eg. <table style="width:100%;"... instead of
<table width="100%"...)
Or, if you prefer, you could use XHTML Transitional

Best regards
Anton Triest


From: "Paul Hiles" 
> I've been struggling to add hyperlinks into a particular area
> (related-items)
> on a page. If you check out the following page:
> http://www.erimus.com/temp/xml/003_page_sample.xml
> you'll see that the "description/list/items" now contain hyperlinks.
> 
> Just one niggly bug remains.. I'm trying to prevent duplication of the link
> and its text value! At the moment, if I start the list item with a link then
> you will see the plain text from the link, as well as the link itself
> immediately to its right. I'm sure there's a conditional statement I can add
> to the XSL stylesheet to ensure these instances are correctly rendered, but
> I'm not sure what they are. Can anyone help me out with this?

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.