xsl-list
[Top] [All Lists]

RE: href problem...using CDATA needed?

2003-06-13 14:39:13
I've gotten lots of valuable insights from Tom. I just wanted to make sure I
wasn't doing something wrong.

FINAL JEOPARDY ANSWER:

My apologies if anyone thought I was asking non-xslt questions. The {(_at_)url}
did turn out to be fine...for some reason when I went back and did a simple

<a target="_blank href="{(_at_)url}"> it worked fine!

guess I'll have to stick with tried and true...just wondering "why" as
usual.

Thanks again to everyone, subject closed.

Kathy



-----Original Message-----
From: Wendell Piez [mailto:wapiez(_at_)mulberrytech(_dot_)com]
Sent: Friday, June 13, 2003 5:06 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] href problem...using CDATA needed?


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.

This may because I deal a lot with messy documentary data that often 
includes lots of mixed content, including even mixed content in the midst 
of anchor tags and such like (they do happen). The graceful way XSLT's 
so-called "push" model deals with mixed content is among its greatest 
misunderstood and discounted strengths. (But then mixed content itself 
seems to be a deep mystery to some.)

There can also be stuff like images in there.

In fact, with newbies I like to slap their hands for using value-of without 
thinking about why. :->

(This is not to say that I don't trust Tom to do the right thing for his 
situation: I do.)

Cheers,
Wendell


___&&__&_&___&_&__&&&__&_&__&__&&____&&_&___&__&_&&_____&__&__&&_____&_&&_
     "Thus I make my own use of the telegraph, without consulting
      the directors, like the sparrows, which I perceive use it
      extensively for a perch." -- Thoreau


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



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