xsl-list
[Top] [All Lists]

Re: [xsl] Looking for a concise way of specifying an conditional attribute in output

2011-05-06 04:25:11
On Fri, May 6, 2011 at 4:51 AM, David Carlisle 
<davidc(_at_)nag(_dot_)co(_dot_)uk> wrote:
On 06/05/2011 07:40, Dave Pawson wrote:
How about renaming it to 'xsl:string-value-of' which might be
more accurate? Lot more typing though

But that would make it sound even more like it creates a string, which it
doesn't, it creates a text node (and even if it were a better name,

Good point, David.  I chose my words poorly when I said "the result
will be a string", since the result of xsl:value-of is always a text
node, which is all the more reason why I think xsl:text should be
given the features currently possessed by xsl:value-of so it can take
its place as the preferred means of creating dynamic text nodes (by
which I mean text nodes whose content is determined at run-time) as
well as the static text nodes it is already capable of.

it is rarely the case that when there is confusion between two names, adding
a third name helps).

Indeed.  The more I've thought about it, the more I've wondered why
there was ever a need for xsl:value-of, rather than just having
xsl:text be the way to create text nodes, static or dynamic.

On the static vs. dynamic note, since I'm in the "wouldn't it be nice"
mode, I'd also be interested to see XSLT expand the range of places
where attribute value template syntax can be used, as I find it to be
a particularly nice, concise syntax for combining static and dynamic
pieces.  Perhaps allow a "value" attribute anywhere you can currently
use "select", with the value interpreted as an AVT?

-Brandon :)

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--