472,107 Members | 1,280 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,107 software developers and data experts.

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 10037
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.