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

RE: href problem...using CDATA needed?

Subject: RE: href problem...using CDATA needed?
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Mon, 16 Jun 2003 10:46:30 -0400
using cdata in attribute
[Wendell Piez]

> At 04:24 PM 6/13/2003, TomP wrote:
> >In your template, it seems very unusual to have an apply-templates
> >instruction within the body of an anchor element.  An anchor 
> is supposed
> >to contain only inline elements - it is not clear why you would need
> >apply-templates. If it is going to return structured information, an
> >anchor element is the wrong place for it.  If it is going to return a
> >bit of text like a label, chances are you can do it with just
> >xsl:value-of.
> 
> I disagree with Tom here. I prefer to use xsl:apply-templates 
> by default 
> all the way down, and only go to xsl:value-of (or something 
> else) as the 
> motivated exception.
> 

I would go part of the way with Wendell here.  My hyperlinks usually
need just two things -

1) A simple text label
2) Attributes in the anchor element,  the href of course, and sometimes
a target and a title attribute as well.

For attribute values, I like using attribute value templates because
they are easy to read and write.  For the text label, I like to use
value of because using an additional template is harder to read (because
it has more surrounding boilerplate and because it is in another place).

 As an intermediate approach, when an attribute value would be more
complex, I sometimes use a variable, then insert the variable using an
{AVT}.  But that is my limit - if I have to get more complicated with
the anchor, I fully agree with Wendell that it is well to create a
template for the purpose.

Cheers,

Tom P

 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.