Re: [xslt] Variables broken in XPath?



В Сбт, 10/12/2005 в 11:57 -0500, Daniel Veillard пишет:
> > Why does libxslt 1.1.15 have trouble looking up variable references in
> > predicates, where Xalan and even earlier versions of libxslt did fine?
> > Maybe I'm missing something?
> 
>   <xsl:template match="foo[. = $a]">
> 
>  using a variable reference in a match pattern is forbidden by the spec. This
> eas fixed in the last year or so, and is now properly reported as invalid.

Point taken. However, the diagnostic could be more insightful as to
suggest that the variable usage itself is wrong. Now the message reads
like the match pattern is OK, but the processor fails to see the
variable definition. Combined with non-intuitiveness of the "variable
references are forbidden in a match" rule, and the fact that some
popular processors including libxslt itself used to overlook it, it can
lead to confusion on behalf of inexperienced users (like me).



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]