XPathNavigator GetAttribute String

  • Thread starter Thread starter DN
  • Start date Start date
D

DN

This works:

nav.GetAttribute("@ATTRIBUTE","");

This doesn't:

string strTemp = "@ATTRIBUTE";
nav.GetAttribute(strTemp,"");

Anybody know a way around this?
 
Those two you posted are equivalent. What you probably meant is that another
is with @ (at) and another isnt? Anyway, GetAttribute takes the local name
of the attribute and @ is not needed in the name. e.g
nav.GetAttribute("attribute_name",""). Does the attribute belong to some
namespace?

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

This works:

nav.GetAttribute("@ATTRIBUTE","");

This doesn't:

string strTemp = "@ATTRIBUTE";
nav.GetAttribute(strTemp,"");

Anybody know a way around this?
 
Thanks Teemu... (as I shake my head in shame)....I think it's time for me to
get some sleep.
DN
 
Back
Top