DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   XML, XSLT and XPATH (http://www.daniweb.com/forums/forum134.html)
-   -   Can't access root attribute! (http://www.daniweb.com/forums/thread149837.html)

skydiverMN Oct 7th, 2008 6:01 pm
Can't access root attribute!
 
I've read a ton of things online but i'm still unable to access the attribute within my root. My root is called "Customers" and the attribute is called "id". While I can see the text details (and everything else too) in the innerXML but I can't query it and get a value. I've tried /root@id, root@id, /@id,.... always coming up empty. Here's one of the many tries below:

        Dim xmlNav As XPathNavigator
        Dim xmlNI As XPathNodeIterator

        Dim sTemp As String

        Try
            xmlNav = xpathDoc.CreateNavigator()
            xmlNI = xmlNav.Select("root@id")

            sTemp = xmlNI.Current.GetAttribute("id", String.Empty)
        and so on....

Any help is appreciated!

Thanks!


All times are GMT -4. The time now is 4:23 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC