The XPath expression is not valid.
If you want all the book elements in the file
/books/book
will do it.
if you want all of the name, author, and publication elements that have book as a
parent then
/books/book/name | /books/book/author | /book/books/publication
will do it.
If you want all the book elements that have at least one of a name, author, or
publication element as a child the
/books/book[name | author | publication]
will do it, which gives the same results as
/books/book[(name | author | publication)]
What nodes are you looking for in resulting XPathNodeIterator?
Dan
-----Original Message-----
From: Dinesh Upare [mailto:[EMAIL PROTECTED]]
Sent: Sat 6/22/2002 6:35 AM
To: [EMAIL PROTECTED]
Cc:
Subject: [DOTNET] XPath Query using set operators
i have a XML file. I have to read the nodes as if records in the database.
e.g. consider the file books.xml below
<books>
<book>
<name>Java</name>
<author>XYZ</author>
<publication>wrox</publication>
</book>
<book>
<name>C++ Basics</name>
<author>ABC</author>
<publication>Microsoft</publication>
</book>
.
.
.
</books>
i have to read the book node as a record so that i can idenfify its contents
correctly.
I tried with XPath Query as
" books/book/(name | author | publication)"
and used the XPathNAvigator.Select(..) method,tried by
XPathNavigator.Compile(..) method which returns the node set.
but the problem is that this query gives System.Xml.Xpath.XpathException in
the system.xml.dll. The query should return a node set.
how can i solve this problem....
If any other type of logic or query is available please give suggestions and
help.
Infact this type of query is also given as example of Xpath in MSDN.
Dinesh Upare
--
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.
¢çž·švg¬±¨±úèšØ^äÍ6«r¯zéì¹»®&Þ~º&äÍ:+²æìr¸›zÚ(¶«
ëÞ–ŠLz{h®X¬¶Æ†Ûiÿ÷b±Ë¬±×¯zZ)r‰