[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 17:47:28 +0200
paul hiles
Hi Paul,

in your content.xsl (line 63, inside <xsl:for-each select="description/list/item">):

  <p style="margin:0px;"><xsl:value-of select="node()"/><xsl:apply-templates select="link"/></p>

This will add a <p> paragraph, with (first) the value of the node, and (then) the link.
Regardless of the order in which they appear. 

I would try something like:

  <p style="margin:0px;">
    <xsl:apply-templates select="link | text()"/>
  </p>

with an extra template for "text()":

  <xsl:template match="text()">
    <xsl:value-of select="."/>
  </xsl:template>

(maybe you'll need some similar modifications in some other places, too: 
there are many select="node()" in the stylesheet)

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