Project

Profile

Help

XTSE1015: no "select", but "order" attr.

Added by Anonymous about 17 years ago

Legacy ID: #4557289 Legacy Poster: Yves Forkl (yvesforkl)

When Saxon 8.8.0.4J processes the code below, it reports the following error: Error at xsl:sort on line ... of ...: XTSE1015: An xsl:sort element with a select attribute must be empty But that xsl:sort instance does not have a "select" attribute, just an "order" attribute. The XSLT 2.0 Spec does not explicitly forbid the presence of an "order" attribute if xsl:sort contains a sequence constructor, but it states: "Those attributes of the xsl:sort elements whose values are attribute value templates [among which the 'Order' attribute] are evaluated using the same focus as is used to evaluate the select attribute of the containing instruction [...]." Does that imply that the "order" attribute always requires a companion "select" attribute, justifying the error to be signaled? Or does the error result from unintentional behaviour of Saxon? If I must use a "select" attribute together with the "order" attribute and keep the element empty, how could I adapt the code below to this requirement? Regards, Yves <xsl:for-each select="$my_elements"> <xsl:sort order="descending"> <xsl:variable name="lengths" as="xs:integer+"> <xsl:sequence select="0"/> <xsl:analyze-string select="$current_text_node" regex="{old}"> <xsl:matching-substring> <xsl:sequence select="string-length(.)"/> </xsl:matching-substring> </xsl:analyze-string> </xsl:variable> <xsl:sequence select="max($lengths)"/> </xsl:sort> <xsl:variable name="lengths" as="xs:integer+"> <xsl:sequence select="0"/> <xsl:analyze-string select="$current_text_node" regex="{old}"> <xsl:matching-substring> <xsl:sequence select="string-length(.)"/> </xsl:matching-substring> </xsl:analyze-string> </xsl:variable> <xsl:if test="max($lengths) != 0"> <xsl:element name="substitution"> <xsl:element name="max_match_length"> <xsl:value-of select="max($lengths)"/> </xsl:element> <xsl:copy-of select="*"/> </xsl:element> </xsl:if> </xsl:for-each>


Replies (1)

RE: XTSE1015: no &quot;select&quot;, but &quot;order&quot; attr. - Added by Anonymous about 17 years ago

Legacy ID: #4557307 Legacy Poster: Yves Forkl (yvesforkl)

Removing the "order" attribute does not stop the error from occurring, so I suspect this rather to be a Saxon bug. Regards, Yves

    (1-1/1)

    Please register to reply