I'm surprised this has changed between 8.1.1 and 8.2 - I thought the =
change
was earlier.
In 1.0, string() when given a node-set silently truncates the node-set =
and
gives you the string value of the first node. In 2.0, if this is the =
effect
you want, you have to do it explicitly, perhaps thus:
<xsl:value-of=20
select=3D"concat(string(following-sibling::LearningObject[1]
/MetaData/General/Identifier/@Entry),'.xhtml')"/>=20
You can still get the 1.0 behavior if you specify version=3D"1.0" in =
your
stylesheet, but I wouldn't advise it - it's better to flush out these =
hidden
conversions so you know what's going on.
Michael Kay
http://www.saxonica.com/
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@...] On Behalf Of=20
> Maik St=FChrenberg
> Sent: 14 January 2005 09:33
> To: saxon-help@...
> Subject: [saxon] Changes in element constructor?
>=20
> Hello,
>=20
> I'm using Saxon (6.x and 7.x/8.x) for simple transformations.=20
> There seems=20
> to be a change in the element constructor in the newest=20
> version 8.2 -- or=20
> the change is in the handling of string().
> Using Saxon-B 8.1.1 everything is fine using the stylesheet=20
> below. But=20
> Saxon-B 8.2 displays the follwing error message:
>=20
> Error at element constructor <a> on line 590 of file:/lom2xhtml.xslt:
> net.sf.saxon.xpath.DynamicError: A sequence of more than=20
> one item is not=20
> allowed as the
> first argument of string()
> Transformation failed: Run-time errors were reported
>=20
> This is the corresponding line 590:
>=20
> <a class=3D"NavItem">
>=20
> The error seems to be in the next lines when string() is=20
> used. For better=20
> understanding here is the whole template (the line is marked=20
> with an arrow=20
> "->").
> Any help is appreciated.
>=20
> Cheers,
>=20
> Maik St=FChrenberg
>=20
> <xsl:template name=3D"nav_level2">
> <table width=3D"100%" class=3D"Nav">
> <tr>
> <td style=3D"width:33%" align=3D"right">
> <xsl:choose>
> <xsl:when=20
> test=3D"following-sibling::*[1][self::LearningObject]">
> -> <a class=3D"NavItem">
> <xsl:attribute name=3D"href">
> <xsl:value-of=20
> select=3D"concat(string(following-sibling::LearningObject/MetaDa
> ta/General/Identifier/@Entry),'.xhtml')"/>
> </xsl:attribute>
> <xsl:text>»</xsl:text>
> </a>
> </xsl:when>
> <xsl:when test=3D"following::*[1][self::LearningObject]">
> <a class=3D"NavItem">
> <xsl:attribute name=3D"href">
> <xsl:value-of=20
> select=3D"concat(string(following::LearningObject/MetaData/Gener
> al/Identifier/@Entry),'.xhtml')"/>
> </xsl:attribute>
> <xsl:text>»</xsl:text>
> </a>
> </xsl:when>
> </xsl:choose>
> </td>
> </tr>
> </table>
> </xsl:template>
>=20
>=20
>=20
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> saxon-help mailing list
> saxon-help@...
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>=20
|