This is a bug which will be fixed in the next version of the .NET Framework.
Thanks for providing this bug report.
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Alistair Bayley" <AlistairBayley@discussions.microsoft.com> wrote in
message news:7C7ED1C6-94CB-48D4-A849-C609060E2031@microsoft.com...
[quoted text, click to view] > Is there some reason I haven't received a response to this problem? Have I
> violated some rule of newsgroup etiquette, or is my post malformed?
According
> to the MSDN subscriptions guide I have, I can post "unlimited .NET product
> and technology questions ... and receive a guaranteed response from
Microsoft
> Support Professionals within two business days".
>
>
> "Alistair Bayley" wrote:
>
> > (.Net framework version 1.1.4322)
> >
> > The following XSL test case is rejected by System.Xml.Xsl.XslTransform,
with an XsltException: "($dummy)+0 is an invalid XPath expression." If you
remove the parentheses then it is happy. This appears to be an error; see
http://www.w3.org/TR/xpath#NT-Expr. The path through the grammar is quite
long; if you start with the Expr rule, it (eventually) leads back to
PrimaryExpr, which indicates that ($variable) is allowed.
[quoted text, click to view] > >
> >
http://www.w3.org/TR/xpath#NT-Expr > >
http://www.w3.org/TR/xpath#NT-OrExpr > >
http://www.w3.org/TR/xpath#NT-AndExpr > >
http://www.w3.org/TR/xpath#NT-EqualityExpr > >
http://www.w3.org/TR/xpath#NT-RelationalExpr > >
http://www.w3.org/TR/xpath#NT-AdditiveExpr > >
http://www.w3.org/TR/xpath#NT-MultiplicativeExpr > >
http://www.w3.org/TR/xpath#NT-UnaryExpr > >
http://www.w3.org/TR/xpath#NT-UnionExpr > >
http://www.w3.org/TR/xpath#NT-PathExpr > >
http://www.w3.org/TR/xpath#NT-FilterExpr > >
http://www.w3.org/TR/xpath#NT-PrimaryExpr > > -- at this point we can choose parentheses "( Expr )" or
VariableReference:
> >
http://www.w3.org/TR/xpath#NT-VariableReference > >
> >
> > Is this fixed in a newer version of the framework? If so, where can I
get the fix?
> >
> > Thanks,
> > Alistair.
> >
> >
> > -------------------------------------------
> > test case (run it over any XML document; mine is just "<a/>")
> > -------------------------------------------
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet xmlns:xsl="
http://www.w3.org/1999/XSL/Transform" version="1.0">
> > <xsl:output method="xml" indent="yes"/>
> >
> > <xsl:variable name="dummy">
> > <xsl:value-of select="132"/>
> > </xsl:variable>
> >
> > <xsl:template match="/">
> > <myitem>
> > <xsl:attribute name="number">
> > <xsl:value-of select="($dummy)"/>
> > </xsl:attribute>
> > </myitem>
> > </xsl:template>
> >
> > </xsl:stylesheet>
> >