473,237 Members | 1,171 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,237 software developers and data experts.

xpathnodeiterator.getattribute

i have XpathNodeIterator iterator. and i have some "od" attributes

when i took that nodes with that attribute i dont get anything when i call
iterator.Current.GetAttribute("od", "")

people please help, i cant do it anymore. this xml parser will kill me

thanks!
Jun 1 '08 #1
3 6474
gigs <gi**@hi.t-com.hrwrote:
i have XpathNodeIterator iterator. and i have some "od" attributes

when i took that nodes with that attribute i dont get anything when i call
iterator.Current.GetAttribute("od", "")

people please help, i cant do it anymore. this xml parser will kill me
Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.

--
Jon Skeet - <sk***@pobox.com>
Web site: http://www.pobox.com/~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com
Jun 1 '08 #2
Jon Skeet [C# MVP] wrote:
gigs <gi**@hi.t-com.hrwrote:
>i have XpathNodeIterator iterator. and i have some "od" attributes

when i took that nodes with that attribute i dont get anything when i call
iterator.Current.GetAttribute("od", "")

people please help, i cant do it anymore. this xml parser will kill me

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
thanks for replay, but i did it.
Jun 1 '08 #3
gigs wrote:
i have XpathNodeIterator iterator. and i have some "od" attributes

when i took that nodes with that attribute i dont get anything when i
call iterator.Current.GetAttribute("od", "")
Well you will have to provide more details if you want specific help.

Here is a working sample, the XML document is

<?xml version="1.0" encoding="utf-8" ?>
<root>
<foo od="1"/>
<foo od="2"/>
</root>

and the C# code

XPathDocument doc = new XPathDocument(@"..\..\XMLFile2.xml");
XPathNavigator nav = doc.CreateNavigator();
foreach (XPathNavigator nav2 in nav.Select("root/foo"))
{
Console.WriteLine("od: {0}", nav2.GetAttribute("od", ""));
}

which outputs

od: 1
od: 2

If you want help on your specific problem then you need to provide the
XML you have and the exact code you have, all reduced to a minimum but
complete enough to allow us to reproduce the problem.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jun 1 '08 #4

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

Similar topics

1
by: panik | last post by:
Hi, say I have an xml file with an X number of nodes I want to loop through (to, for example, display each node as a HyperLink in an asp.net webpage). Which of both is best practice: 1. Loop...
0
by: Ilian Nilsson | last post by:
Hi Al If I try to use the following code lines in an recursive (recurse down in Xml tree) manner the XPathNodeIterator gets reset in it's parent method call, which will end up in that all nodes...
2
by: avnrao via .NET 247 | last post by:
Hi, please clarify this doubt about XPathNodeIterator..the following XSLT uses this.. my doubt is, by looking at the XSLT, i thought the output to be Book1..but the actual output is...
3
by: John A Grandy | last post by:
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...
3
by: KJ | last post by:
It is true that there is no way to get the outerXml of XPathNodeIterator.Current? Please say it isn't so.
2
by: Volkan | last post by:
Hi, I'm trying to compare two XML documents and i'm using XPath queries to select nodes. XPathNavigator's Select method runs fast enough and returns an XPathNodeIterator object. When i try to...
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...
3
by: gigs | last post by:
i have XpathNodeIterator iterator. and i have some "od" attributes when i took that nodes with that attribute i dont get anything when i call iterator.Current.GetAttribute("od", "") people...
6
by: Kindler Chase | last post by:
I'm trying to iterate through a set of nodes and then edit/delete specific attributes using XPathNodeIterator. Adding attributes is no problem. My first question is how do I delete an attribute...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.