469,356 Members | 1,873 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

XPathNodeIterator.Current.GetAttribute


XPathNodeIterator.Current.GetAttribute(localName As String, namespaceURI As
String)

i believe that localName should be set equal to the name of the attribute.

but what should namespaceURI be set equal to ?
Nov 12 '05 #1
3 9977
John A Grandy wrote:
XPathNodeIterator.Current.GetAttribute(localName As String, namespaceURI As
String)

i believe that localName should be set equal to the name of the attribute.

but what should namespaceURI be set equal to ?


To namespace URI if the attribute belongs to a namespace. E.g.

<foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="foo.xsd">bar</foo>

Here to get xsi:noNamespaceSchemaLocation attribute value you can use

string schema = ni.Current.GetAttribute("noNamespaceSchemaLocation ",
"http://www.w3.org/2001/XMLSchema-instance");
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2
what if i'm just loading out of a self-created xml doc in the local file
system ?

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:OR**************@TK2MSFTNGP12.phx.gbl...
John A Grandy wrote:
XPathNodeIterator.Current.GetAttribute(localName As String, namespaceURI As String)

i believe that localName should be set equal to the name of the attribute.
but what should namespaceURI be set equal to ?


To namespace URI if the attribute belongs to a namespace. E.g.

<foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="foo.xsd">bar</foo>

Here to get xsi:noNamespaceSchemaLocation attribute value you can use

string schema = ni.Current.GetAttribute("noNamespaceSchemaLocation ",
"http://www.w3.org/2001/XMLSchema-instance");
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com

Nov 12 '05 #3
John A Grandy wrote:
what if i'm just loading out of a self-created xml doc in the local file
system ?


And what?

You mean you don't know attribute name and namespace? Then use
MoveToFirstAttribute() and MoveToNextAttribute() methods to navigate
through attributes.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Ilian Nilsson | last post: by
2 posts views Thread by avnrao via .NET 247 | last post: by
2 posts views Thread by Emmanuel | last post: by
4 posts views Thread by Jamie da Silva | last post: by
3 posts views Thread by KJ | last post: by
reply views Thread by David | last post: by
3 posts views Thread by gigs | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.