xsl-list
[Top] [All Lists]

Re: [xsl] xsl:sequence

2006-08-10 09:10:52

is pretty bad practice 
sometimes you start to use it but then (as I posted earlier) find you have
<br/> or <img/. or something where you want to do something smarter so
need to change to use apply-templates. I'm not sure if that makes it bad
practice.

The concept of the "string value" of an element being the
concatenation of its character data runs throughout xslt, including
places where the apply-templates option isn't avaliable, for example if
you go
<xsl:sort select="an/element"/>

then this string value of the element is used as the sort key,
similarly if you go
/an/element[.='foo']
it is this string value that is compared with 'foo'.

Trying to program in XSLT without ever using the string value of an
element would be hard I think, and xsl:value-of is just defined to
return a text node with the string value of the selected node (or nodes
in XSLT2).

Or does the 'without doing a lot of work that the system has already done' 
argument still hold?

whether the system is already holding the string value, or whether it
has to recursively calculate it when requested is of course an
implementation detail that will depend on the implementation.
I'll leave implementation details to those on the list who've implemented
it, I don't want Michael to call me naive twice in one thread:-(

David


--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>