Project

Profile

Help

for-each-group error points to template

Added by Anonymous about 15 years ago

Legacy ID: #7377274 Legacy Poster: Greg Knittl (gknittl)

A compile time error message for for-each-group points to the line for the enclosing template instead. Testcase: (errorbadline.xsl) <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0"> <!-- originally hit this in a nested for-each-group using select="current-grouping-key()" by mistake instead of select="current-group()" so it wasn't quite so pathological --> <xsl:template name="main"> <xsl:for-each-group select="1" group-by="@date"> <td/> </xsl:for-each-group> </xsl:template> </xsl:stylesheet> Invocation: java net.sf.saxon.Transform -it main -t "errorbadline.xsl" Output: Saxon 9.1.0.6J from Saxonica Java version 1.6.0_07 Error at xsl:template on line 8 column 29 of errorbadline.xsl: XPTY0020: Axis step attribute::attribute(date, xs:anyAtomicType) cannot be used here: the context item is an atomic value Failed to compile stylesheet. 1 error detected. greg@greg-desktop:/media/CARD1/project/errorbadline$ ./err Saxon 9.1.0.6J from Saxonica Java version 1.6.0_07 Error at xsl:template on line 8 column 29 of errorbadline.xsl: XPTY0020: Axis step attribute::attribute(date, xs:anyAtomicType) cannot be used here: the context item is an atomic value Failed to compile stylesheet. 1 error detected.


Replies (1)

RE: for-each-group error points to template - Added by Anonymous about 15 years ago

Legacy ID: #7378065 Legacy Poster: Michael Kay (mhkay)

Thanks for reporting this. The diagnostics for this example have been improved in the 9.2 development branch. Michael Kay

    (1-1/1)

    Please register to reply