xsl-list
[Top] [All Lists]

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

2006-04-12 11:54:56
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.

Yes. Note that you get the 1.0 behavior in "backwards compatibility mode",
that is, if the stylesheet specifies version="1.0".

It's most likely to cause problems if the 1.0 stylesheet was failing to
handle multi-valued data, for example

<xsl:template match="book">
  <xsl:value-of select="author"/>
</xsl:template>

in 1.0 will give you the name of the first author; in 2.0 (when you change
the version number) it will give you the names of all the authors. In most
cases this change is probably a Good Thing; if you only want the first
author you now have to say so explicitly by writing select="author[1]".

Michael Kay
http://www.saxonica.com/




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