473,387 Members | 1,722 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,387 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 1868
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: Együd 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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.