Groups | Blog | Home
all groups > dotnet xml > june 2004 >

dotnet xml : XPathNodeIterator.Current.GetAttribute


John A Grandy
6/30/2004 9:16:09 PM

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 ?

John A Grandy
7/1/2004 7:35:49 AM
what if i'm just loading out of a self-created xml doc in the local file
system ?

[quoted text, click to view]

Oleg Tkachenko [MVP]
7/1/2004 1:23:10 PM
[quoted text, click to view]

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]
Oleg Tkachenko [MVP]
7/1/2004 6:06:00 PM
[quoted text, click to view]

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]
AddThis Social Bookmark Button