473,803 Members | 3,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XPathNavigator GetAttribute String

DN
This works:

nav.GetAttribut e("@ATTRIBUTE", "");

This doesn't:

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

Anybody know a way around this?

Nov 18 '05 #1
2 7632
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.GetAttribut e("attribute_na me",""). Does the attribute belong to some
namespace?

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

"DN" <as*****@hotmai l.com> wrote in message
news:%2******** *********@tk2ms ftngp13.phx.gbl ...
This works:

nav.GetAttribut e("@ATTRIBUTE", "");

This doesn't:

string strTemp = "@ATTRIBUTE ";
nav.GetAttribut e(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****@aspalli ance.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.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.GetAttribut e("attribute_na me",""). Does the attribute belong to some
namespace?

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

"DN" <as*****@hotmai l.com> wrote in message
news:%2******** *********@tk2ms ftngp13.phx.gbl ...
This works:

nav.GetAttribut e("@ATTRIBUTE", "");

This doesn't:

string strTemp = "@ATTRIBUTE ";
nav.GetAttribut e(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
3223
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. Xml Doc: Dropdown.xml XML Schema: Dropdown.xsd Here is my XML Document...
7
4089
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 other words, I initially create an XPathNavigator for my entire xml document. To get an XPathNavigator object who's root is a given node in the original xml document, there is a unique xpath that will return that node. The unique xpath could have,...
2
2898
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 object with no problem, but what I cannot seem to do is get at the actual XML string itself. For accountability, tracking, auditing, and logging, I need to save the XML as an XML file in an archive folder, but there doesn't seem to be any way of...
3
3479
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 the moment this doen't work. The test line I put in (string s = ControlAttributes.string s = ControlAttributes.GetAttribute ("Text");
13
3237
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 string value of an
11
6469
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); XPathNavigator nav = docNav.CreateNavigator(); XmlDocument doc = new XmlDocument(); doc.LoadXml("<DocumentData></DocumentData>"); XmlElement elem = doc.CreateElement(currentNodeName);
2
5852
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 properties" The reason this confuses me is that getAttribute("rel") returns a string, so it should have all the properties and methods of a string, right?? What am I missing here? - chris
2
4543
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. I can iterate the document and get my XmlType and XmlBaseType values just fine. However, as soon as I call SetValue to write to an attribute, the
4
2883
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 course leads to the DOM Element Interface's getAttribute method: <URL: http://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-666EE0F9 > The DOM 2 Core specification says that getAttribute should return the value of an attribute as a string, however...
0
9700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9564
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10292
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9121
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.