473,395 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 1870
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: neblackcat | last post by:
Would anyone like to comment on the following idea? I was just going to offer it as a new PEP until it was suggested that I post it here for comment & consideration against PEP 308. I'm far...
5
by: malcolm | last post by:
Example, suppose you have these 2 tables (NOTE: My example is totally different, but I'm simply trying to setup the a simpler version, so excuse the bad design; not the point here) CarsSold {...
3
by: Jemy | last post by:
Hi all, I need to do a keyword search against database table (MSSQL 2000) on particular field/column, say the keyword: "sql server 2000". The search should return without any order restrictions, so...
3
by: Colin Toal | last post by:
Hi all, I'm starting to learn XSLT - and have what I think is a very basic question: I have a stylesheet like this: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet...
8
by: Penny | last post by:
Hi all, My browser throws this Select Case block back at me pointing out a syntax error on the line: 'Case < 251', between the word 'Case' and the '<' symbol. *************************** ...
3
by: Cindy | last post by:
OK, I have the following table: create table citations_by_level ( aid smallint, wid smallint, v_level varchar(50), w_level varchar(50), x_level varchar(50), y_level varchar(50),
2
by: Daniel | last post by:
how to make sure a xsl document has valid xsl syntax? i tried loading it into an xml document but that doesnt show syntax errors inside attributes such as "foo/bar" vs "bar\foo"
7
by: mark | last post by:
Access 2000: I creating a report that has a record source built by the user who selects the WHERE values. An example is: SELECT * FROM CHARGELOG WHERE STDATE Between #10/27/2003# And...
4
by: Egyd Csaba | last post by:
Hi All, I'd like to "compress" the following two filter expressions into one - assuming that it makes sense regarding query execution performance. .... where (adate LIKE "2004.01.10 __:30" or...
7
by: wk6pack | last post by:
Hi, How do I check datatable.select(filter) in the following: for each dtrow in datatable.select(filter) .... next I've also tried:
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.