473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

XPathNavigator GetAttribute String

DN
This works:

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

This doesn't:

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

Anybody know a way around this?

Nov 18 '05 #1
2 7619
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

"DN" <as*****@hotmail.com> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
This works:

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

This doesn't:

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

Anybody know a way around this?


Nov 18 '05 #2
DN
Thanks Teemu... (as I shake my head in shame)....I think it's time for me to
get some sleep.
DN
"Teemu Keiski" <jo****@aspalliance.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
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

"DN" <as*****@hotmail.com> wrote in message
news:%2*****************@tk2msftngp13.phx.gbl...
This works:

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

This doesn't:

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

Anybody know a way around this?

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Obe | last post by:
PLEASE HELP! I'm writing a function to populate DropDownLists from and xml file. I am having a problem getting my XPathNavigator to select any nodes when I attach a schema to my xml document. ...
7
by: David Thielen | last post by:
Hi; Is there a way from an XPathNavigator object to get an xpath string that will, when used in a Select(xpath) on the underlying base/root XPathNavigator return the same XPathNavigator? In...
2
by: JSheble | last post by:
I'm integrating with a customer application, and in their assembly, when I call a method it returns data to us as an XPathNavigator object. I can parse the various elements I need out of this...
3
by: duff | last post by:
Hiya, I'm trying to replace the commented out code below with a neater version using the IAttributeAccessor interface (so that I don't have to write 'if' statements for all control types). At...
13
by: Noa | last post by:
Hi I have a page that looks like that: <form name="kuku1" action ="anotherpage.html" > <input name="name"> <input name="kuku2"> </form> As far as i know, "getAttribute" should return a...
11
by: ericms | last post by:
Can anybody show me how to insert a CDATA section using XPathNavigator ? I have tried the follwing with no luck: XmlDocument docNav = new XmlDocument(); docNav.LoadXml(xmlString);...
2
by: christopher.secord | last post by:
I'm having a hard time understanding an error that I'm getting. In the code below, I'm trying to call substring() on an attribute of an anchor. The error I get says "getAttribute("rel") has no...
2
by: =?Utf-8?B?Tm9yZW1hYw==?= | last post by:
Hi. Using VS2005, .NET 2.0. I have an xml document that I want to go through and set the values on attributes of elements. The elements are complex types defined in my schema (xsd) files. ...
4
by: RobG | last post by:
I have always accessed attributes such as disabled using the DOM element property, however I was wondering about implementing a more generic function to get the values of attributes - which of...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.