"Don" <doduong12141214@hotmail.com> wrote in message news:O2zQahQ%23EHA.3840@tk2msftngp13.phx.gbl...[color=blue]
> I am able to select '//document/Info/ID' from the XML. Adding the
> namespace is where I get a problem(see XML below).[/color]
To make your XPath work with namespaces you must create an
XmlNamespaceManager and pass that as an argument to Select-
Nodes( ), there's an overload of that method that accepts an Xml-
NamespaceManager for this purpose.
Additionally, since you have declared default namespaces, you
must associate a prefix with the namespaces in the XPath query.
It's a practical matter -- b/c you can't type an empty string as a
namespace prefix in an XPath expression.
For example, in VB.NET,
' Given xmlDoc is an XmlDocument containing your XML.
'
Dim nsMan As XmlNamespaceManager = _
New XmlNamespaceManager( xmlDoc.NameTable)
nsMan.AddNamespace( "ns1", "http://web/DataSubSystemWebService/Services")
Dim nodes As XmlNodeList
nodes = xmlDoc.SelectNodes( "//document/Info/ns1:ID", nsMan)
'
' Enumerate over nodes with For Each or other loop to
' process each resulting XmlNode, if any.
See also the following article, I know you've overcome this before, :-)
http://groups-beta.google.com/group/...b?dmode=source
Derek Harmon