gino gino

gino gino

  • NA
  • 3
  • 0

c# vs xml

Nov 10 2005 11:16 AM
i'm sorry for my bad english.
i'm an italian student and i've a problem with the execution of a xpath expression.
i've a document named book.xml in C:\ and i don't know for what reason this code i wrote doesn't work:
------------------------------------------------------------------------------
XmlTextReader reader = new XmlTextReader(@"c:\book.xml");
XmlDocument doc = new XmlDocument();
doc.Load(reader);
XmlNodeList nodeList;
XmlElement root = doc.DocumentElement;
// nodeList = root.SelectNodes("/bookstore/book/price[text()>'9.00']"); <-- this query works
nodeList = root.SelectNodes("/bookstore/book/price[text()='11.99']"); // <-- this query doesn't work
Console.Write(nodeList.Count.ToString());
---------------------------------------------------------------------------

this is the structure of book.xml

bookstore
book
price 11.99 /price
author .. author
title .. /title
/book
...other books
/bookstore


if i can't solve this problem my work doesn't go on :(

Answers (2)