There's no prefix on the Report element so it's in the default namespace.
The default namespace is indicated via an xmlns 'attribute' (with no prefix)
on the element or one of its parents. So in this case it's:
xmlns="Data_Feed"
That's what you'd see if you examined xDoc.DocumentElement.NamespaceURI in
the debugger.
The other namespace declaration has a prefix attached, xmlns

1, so that
only pertains to nodes with a p1 prefix such as the p1:schemaLocation
attribute.
As an aside using p1 as a prefix is perfectly legal but a little unusual,
most examples using the schema instance namespace,
http://www.w3.org/2001/XMLSchema-instance, use xsi as the prefix.
--
Joe Fawcett (MVP - XML)
http://joe.fawcett.name
"SeanInSeattle" <SeanInSeattle@discussions.microsoft.com> wrote in message
news:4EFC6F13-EA9D-4EF6-A512-120745D1CE28@microsoft.com...
> Ah, yes. I appreciate that. Though, which one is the URI in my example
> xml?
> Is it the p1:schemalocation value altogether, or just the "http://[...]",
> or
> is it the xmlns
1 value?
>
> Here's my code:
>
>
Code:
> try {
> XmlDocument xDoc = new XmlDocument();
> xDoc.Load(XMLDoc_URL);
> System.Xml.XmlNamespaceManager xmlnsManager = new
> System.Xml.XmlNamespaceManager(xDoc.NameTable);
> xmlnsManager.AddNamespace(strDataFeedName,
> xDoc.DocumentElement.NamespaceURI);
> foreach (System.Xml.XmlNode xnDetail in
> xDoc.DocumentElement.SelectNodes(XPathToData, xmlnsManager))
> Console.WriteLine(xnDetail.Attributes.GetNamedItem(AttrName).Value);
> }catch (Exception e) { Console.WriteLine(e.Message); return -1; }
>
>
> "Martin Honnen" wrote:
>
>> SeanInSeattle wrote:
>> > I have this xml:
>> > [xml]
>> >
>> > <Report p1:schemaLocation="Data_Feed
>> > http://server/reportserver?param1=foo¶m2=bar"
>> > Name="Data Feed"
>> > xmlns
1="http://www.w3.org/2001/XMLSchema-instance"
>> > xmlns="Data_Feed">
>> > <Data/>
>> > </Report>
>> >
>> > [/xml]
>> >
>> > And, I'm trying to read it... without success. I'm using code from
>> > this
>> > KB318545 (http://support.microsoft.com/kb/318545), but not having much
>> > luck.
>> > That its not working is probably because I don't understand how to map
>> > the
>> > info above to the parameters needed for the xmlDoc.SelectNodes(xpath)
>> > to
>> > work.
>>
>> You need an XmlNamespaceManager
>> XmlDocument doc = new XmlDocument();
>> doc.Load("file.xml");
>>
>> XmlNamespaceManager mgr = new XmlNamespaceManager(doc.NameTable);
>> mgr.AddNamespace("df", doc.DocumentElement.NamespaceURI);
>>
>> foreach (XmlElement data in doc.SelectNodes("df:Report/df
ata", mgr))
>> {
>> ...
>> }
>>
>> --
>>
>> Martin Honnen --- MVP XML
>> http://JavaScript.FAQTs.com/
>>