Subject: Re: [xsl] Required item type of value of variable $images is element(); supplied value has item type text() From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Sun, 31 Mar 2019 19:28:11 -0000 |
3. or by doing something like this: <xsl:variable name="prelim" as="item()*"> <xsl:apply-templates mode="ac:image"/> </xsl:variable> <xsl:variable name="images"as="element()*" select="$prelim/self::*"/>
On 31.03.2019 21:00, Martynas JuseviD ius martynas@xxxxxxxxxxxxx wrote:
Hi,
I have a simple snippet like this
<xsl:variable name="images" as="element()*"> <xsl:apply-templates mode="ac:image"/> </xsl:variable>
Sometimes the ac:image templates will return an <img> element, sometimes nothing.
In the case where there are no elements in the variable, I get an error
Required item type of value of variable $images is element(); supplied value has item type text()
When I output the text, it's just whitespace.
The element() cardinality is *, so why can't the processor just suppress the whitespace and treat the variable content as zero elements?
The processor is Saxon-CE BTW.
Martynas atomgraph.com
-- Gerrit Imsieke GeschC$ftsfC<hrer / Managing Director le-tex publishing services GmbH Weissenfelser Str. 84, 04229 Leipzig, Germany Phone +49 341 355356 110, Fax +49 341 355356 510 gerrit.imsieke@xxxxxxxxx, http://www.le-tex.de
Registergericht / Commercial Register: Amtsgericht Leipzig Registernummer / Registration Number: HRB 24930
GeschC$ftsfC<hrer / Managing Directors: Gerrit Imsieke, Svea Jelonek, Thomas Schmidt
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Required item type of value o, Martynas Jusevičius | Thread | Re: [xsl] Required item type of val, Michael Kay mike@xxx |
[xsl] Required item type of value o, Martynas Jusevičius | Date | Re: [xsl] Required item type of val, Michael Kay mike@xxx |
Month |