I'm new to XML namespaces, and I seem to be missing something obvious in this code snippet, which is trying to retrieve the feed/entry nodes from an XPathNavigator document: XmlNamespaceManager mgr = new XmlNamespaceManager(xpNav.NameTable); mgr.AddNamespace("atom", "http://www.w3.org/2005/Atom"); XPathExpression itemsExpr = xpNav.Compile("/atom:feed/ atom:entry/"); itemsExpr.SetContext(mgr); XPathNodeIterator items = xpNav.Select(itemsExpr); The error comes back... "The expression passed to this method should result in a NodeSet." -- and, indeed, the XPathNodeIterator doesn't result in any entries. I'm using .Net 1.1. I believe this might affect the final code. Thanks for any pointers. --Brent
* Brent wrote in microsoft.public.dotnet.xml: >I'm new to XML namespaces, and I seem to be missing something obvious >in this code snippet, which is trying to retrieve the feed/entry nodes >from an XPathNavigator document: > > XmlNamespaceManager mgr = new >XmlNamespaceManager(xpNav.NameTable); > mgr.AddNamespace("atom", "http://www.w3.org/2005/Atom"); > > XPathExpression itemsExpr = xpNav.Compile("/atom:feed/ >atom:entry/"); Remove the final slash. -- Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Thank you! This fix resolved my issue completely. --Brent On Jul 1, 12:35 am, Bjoern Hoehrmann wrote: > * Brent wrote in microsoft.public.dotnet.xml: > > >I'm new to XML namespaces, and I seem to be missing something obvious > >in this code snippet, which is trying to retrieve the feed/entry nodes > >from an XPathNavigator document: > > > XmlNamespaceManager mgr = new > >XmlNamespaceManager(xpNav.NameTable); > > mgr.AddNamespace("atom", "http://www.w3.org/2005/Atom"); > > > XPathExpression itemsExpr = xpNav.Compile("/atom:feed/ > >atom:entry/"); > > Remove the final slash. > -- > Björn Höhrmann · mailto:bjo...@hoehrmann.de ·http://bjoern.hoehrmann.de > Weinh. Str. 22 · Telefon: (0)621/4309674 ·http://www.bjoernsworld.de > 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 ·http://www.websitedev.de/