Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / July 2003

Tip: Looking for answers? Try searching our database.

Simple Xpath Query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Samik Raychaudhuri - 28 Jul 2003 00:51 GMT
Hello,
I am having the following XML file:
-----
<bibRecords xmlns="http://tempuri.org/bibrecords.xsd">
   <bibRecord>
       <entryID>1</entryID>
       <tag>Shioura97</tag>
       <entrytype>Conference Proceedings</entrytype>
   </bibRecord>
</bibRecord>
------

Dim oNode As Xml.XmlNodeList
oNodes = xmldoc.SelectNodes("/bibRecords/bibRecord[entryID='1']")

The above 2 lines is returning oNodes.count=0, whereas the following line:

oNodes = xmldoc.GetElementsByTagName("bibRecord")

is returning oNodes.count=1 as expected. Seems like I am making some stupid mistake in the Xpath query, or may be missing something. Can somebody point it out?
Thanks and regards,
Signature

Samik Raychaudhuri
University of Wisconsin, Madison

To email me, replace 'K' with 'e' in the 'From' field.

Samik Raychaudhuri - 28 Jul 2003 01:21 GMT
Well, the solution is more stupid :-( I had to remove the xmlns="http://tempuri.org/bibrecords.xsd" part from first line. Anybody knows why this was the problem?
-Samik

> Hello,
> I am having the following XML file:
[quoted text clipped - 19 lines]
> somebody point it out?
> Thanks and regards,

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.