xsl-list
[Top] [All Lists]

Re: [xsl] Error: sequence of more than one item not allowed

2011-10-04 05:09:17
I think this is a case where your code is sufficiently wrong that I can't work out what it's trying to do, which means I can't tell you how to correct it. I think you need to explain the problem you are trying to solve - the most effective way of doing that is usually with specimen input and output.

Michael Kay
Saxonica

On 04/10/2011 10:42, Mark wrote:
Of the two nearly parallel statements below, (2) raises the error: "Sequence of more than one item not allowed as the second operand of 'eq'."

(1) groups-by the attribute ($format) and (2) by all the not ($format) attributes found in <Formats>. My thinking was that in (2) the 'group-by' would return a current-group() resolved to a single attribute by the <xsl:for-each select"current()> statement, but if so, I am clearly addressing that single attribute incorrectly. On the other hand, no error is reported when in (2) the group-by="@*[not(name(.)=$format)] resolves to a single attribute. Can I specify the <xsl:if test="$item eq ???"/> to avoid this error in (2) and still test against all of the not($format) attributes?

Thanks,
Mark

(1)
<xsl:for-each-group select="../../Stamp/Formats" group-by="@*[name(.)=$format]">
<xsl:for-each select="current-group()">
<xsl:if test="$item eq @*[name(.)=$format]"> <!--No error -->

(2)
<xsl:for-each-group select="../../Stamp/Formats" group-by="@*[not(name(.)=$format)]">
<xsl:for-each select="current-group()">
<xsl:if test="$item eq @*[not(name(.)=$format)]"> <!--  Error -->



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




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