xsl-list
[Top] [All Lists]

Re: [xsl] rephrased: passing parameters to generic templates

2006-04-13 08:32:04
Hi,

At 04:44 AM 4/13/2006, David wrote:
> So when text nodes or values of attribute nodes
> are constructed (in 2.0), the string-conversion
> rules are not followed, but instead all values
> are spliced together (with space delimiters, it
> appears). This is something to watch out for,
> being notably different from 1.0 and potentially
> the source of silent bugs when migrating.

Although this behaviour of AVT is different in 2.0 what is the same as
1.0 is that {} is essentially a syntactic trick to allow you to use
<xsl:value-of in the value of an XML atribute. In 2.0 mode xsl:value-of
similarly now gives you the value of all items not just silently
discarding all but the first.

Understood.

Accordingly, a difference between 2.0 and 1.0 is that the statement

<xsl:value-of select="$nodes"/>

and

<xsl:value-of select="string($nodes)"/>

are effectively the same thing in 1.0, but not in 2.0. In 2.0 they'll give you the same thing only if $nodes happens to have a single node in the sequence, or none; otherwise you'll get a concatenated value in the first case and an error in the second.

Cheers,
Wendell



======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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