PRETTY PLEASE...need answer to why "this method should result in NodeSet" error

K

KathyB

Hi,

Using the following in an asp.net procedure. I get the error "The
expression passed to this method should result in a NodeSet".

Dim xDoc As New Document()

The line causing the error is:

Dim n as XmlNode = xDoc.SelectSingleNode("//Station[@name]="Station1"]/WI/[Boards/Board[@sn="12345"][@finish]][last()]/@order")

I need to retrieve the content of the "order" attribute of the WI
element for the last "finished" board with the specified serial
number. The path works in xpathvisualizer, but I'm doing something
wrong with the NodeSet issue and/or how I'm using this in asp.net
code. Fairly new at this, so please bear with me. I've tried looking
this up but still not seeing where it's going wrong.

If there is no match, shouldn't it at least return a null nodeset?

Thanks, Kathy

p.s. sorry this is a bit of a repost but I'm held up until I can solve
this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top