On Thu, 21 Feb 2008 09:32:27 -0000, an orbiting mind-control laser
made "\(O\)enone " <oenone@nowhere .comwrite:
>Dahak wrote:
>
>Have you tried using doc.SelectNodes instead of doc.SelectSingl eNode?
>
>This uses the same XPath syntax as SelectSingleNod e, but returns an
>XmlNodeList, which is basically a collection of all the matching nodes. You
>can then query the Count property to find how many nodes there were (zero,
>one or more are all possible return values here) and access the individual
>nodes using the default Item property.
>
>HTH,
>My current troubles happen when trying to deal with a node that
>may - or may not - have multiple elements. For instance, there may be
>one or more //ShipTo/Address/PostalAddress/DeliverTo elements.
>may - or may not - have multiple elements. For instance, there may be
>one or more //ShipTo/Address/PostalAddress/DeliverTo elements.
>Have you tried using doc.SelectNodes instead of doc.SelectSingl eNode?
>
>This uses the same XPath syntax as SelectSingleNod e, but returns an
>XmlNodeList, which is basically a collection of all the matching nodes. You
>can then query the Count property to find how many nodes there were (zero,
>one or more are all possible return values here) and access the individual
>nodes using the default Item property.
>
>HTH,
could be accessed.
Like I said, VB.NET/XML isn't my thing, but the instances where I
need to determine how to access the node values (0/1/many) have been
causing the program to crash on me when an accessed node has more/less
items than I am looking for.
Thanks for the tip.
-JPB
Leave a comment: