Your XML has namespaces. See
namespace. The reason for needing a prefix for the default namespace in our
default namespace. Instead elements and attributes that have a namespace
used for elements or that do not have a namespace (i.e. are in the null
namespace). "
"Robert" <rlbcomp@att.net> wrote in message
news:%23OevImGjEHA.4032@TK2MSFTNGP09.phx.gbl...
> I am having a problem selecting nodes using the XMLnodelist Selectnodes
> using XPATH when I use XML SPY is successfully queries but when is use
> VB.net it comes up with nothing.
>
> Here is my code
>
> Dim nodess As XmlNode
> nodess = myNode.SelectSingleNode("//Web[@Url=
> 'http://localhost']")
> If nodess Is Nothing Then
> SQLrw.Delete()
> End If
> nodess = Nothing
>
> The myNode Properites
> --------------------------------------------------------------------------
----------------------
> {System.Xml.XmlElement}
> [System.Xml.XmlElement]: {System.Xml.XmlElement}
> Attributes: {System.Xml.XmlAttributeCollection}
> BaseURI: ""
> ChildNodes: {System.Xml.XmlChildNodes}
> FirstChild: {System.Xml.XmlElement}
> HasChildNodes: True
> InnerText: ""
> InnerXml: "<Web Title=" WSS Beta Site" Url="http://localhost"
> xmlns="
http://schemas.microsoft.com/sharepoint/soap/" /><Web Title="AD
> Migration Project" Url="http://localhost/ADMIG"
> xmlns="
http://schemas.microsoft.com/sharepoint/soap/" /><Web
> Title="Architecture & Planning" Url="http://localhost/cm/Archi
> tecture" xmlns="
http://schemas.microsoft.com/sharepoint/soap/" />>
> IsReadOnly: False
> Item: <cannot view indexed property>
> LastChild: {System.Xml.XmlElement}
> LocalName: "Webs"
> Name: "Webs"
> NamespaceURI: "
http://schemas.microsoft.com/sharepoint/soap/" > NextSibling: Nothing
> NodeType: Element
> OuterXml: "<Webs
> xmlns="
http://schemas.microsoft.com/sharepoint/soap/"><Web Title=" WSS
> Beta Site" Url="http://localhost" /><Web Title="AD Migration Project"
> Url="http://localhost/ADMIG" /><Web Title="Architecture & Planning"
> Url="http://localhost/cm/Architecture" />
> OwnerDocument: {System.Xml.XmlDocument}
> ParentNode: Nothing
> Prefix: ""
> PreviousSibling: Nothing
> Value: Nothing
> ----------------------------------------------------------
>
> Thanks