xsl-list
[Top] [All Lists]

Re: [xsl] Type error with variable as=xs:string using xsl:choose

2006-09-07 02:40:54


  <xsl:text>images/</xsl:text>
  <xsl:value-of select="substring-after($xsrc,'/images/images/')" />

makes a sequence of length 2, a text node and a string, as you have the
as= attribute these are not merged into an implict document node (at
which point they would be merged into a single text node)
so you get a type error from xsl:string which requires a single item.

Easiest is to use
<xsl:variable name="normsrc" as="xs:string">
<xsl:value-of>
<xsl:choose>
...
</xsl:choose>
</xsl:value-of>
</xsl:variable>

value-of scoops up anything in the content and makes a single text node
which then gets coerced to a string because of thee as= attribute.



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