469,282 Members | 1,944 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

xsl:value-of select doesn't like "($variable)" expressions; bug?

(.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.

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>

Nov 12 '05 #1
2 1715
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.

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>

Nov 12 '05 #2
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" <Al************@discussions.microsoft.com> wrote in
message news:7C**********************************@microsof t.com...
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.
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>

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Jemy | last post: by
3 posts views Thread by Cindy | last post: by
4 posts views Thread by Egyd Csaba | last post: by
7 posts views Thread by wk6pack | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.