473,810 Members | 2,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please ... example code due on looping though specific nodes

I am quite new to XML and posted a request for example code yesterday.
Unfortunately, I did not do a very good job in explaining what I was
looking for. Here is an example of a small piece of the file:

<Scoreboard>
<Events>
<Event ID="001212" Name="EventName 1" />
<Event ID="001213" Name="EventName 2" />
<Event ID="001214" Name="EventName 3" />
<Event ID="001215" Name="EventName 4" />
</Events>
<EventTypes>
<EventType ID="01" SingleGame="tru e" Name="EventName 1" />
<EventType ID="02" SingleGame="tru e" Name="EventName 2" />
<EventType ID="03" SingleGame="tru e" Name="EventName 3" />
<EventType ID="04" SingleGame="tru e" Name="EventName 4" />
<EventType ID="05" SingleGame="tru e" Name="EventName 5" />
<EventType ID="06" SingleGame="tru e" Name="EventName 6" />
<EventType ID="07" SingleGame="tru e" Name="EventName 7" />
</EventTypes>
<Teams>
<Team ID="11" City="City1" Name="Name1" City="City1"
Nickname="nickn ame1" Conference="Con ference1">
<Player ID="91" />
<Player ID="190" />
<Player ID="77" />
<Player ID="133" />
<Player ID="144" />
<Player ID="195" />
<Player ID="220" />
<Player ID="231" />
<Player ID="214" />
<Team ID="13" City="City2" Name="Name2" City="City2"
Nickname="nickn ame2" Conference="Con ference1">
<Player ID="91" />
<Player ID="190" />
<Player ID="77" />
<Player ID="133" />
<Player ID="144" />
<Player ID="195" />
<Player ID="220" />
<Player ID="231" />
<Player ID="214" />
</Team>
</Teams>
<Match ID="999" StatusType="6" IsChallengeEnab led="false"
VenueID="NBB" SchedDate="2006-07-30" SchedTime="13:0 0"
ElapsedTime="02 :01" Winner="H" Attendance="" Final="Y">
<ChairUmpires >
<ChairUmpire Num="1" Name="" />
<ChairUmpire Num="2" Name="" />
</ChairUmpires>
<Teams>
<Team ID="1" Type="H" ChallengesMade= "5" ChallengesWon=" 3">
<Player ID="162" Coach="N" />
<Player ID="92" Coach="N" />
<Player ID="127" Coach="N" />
<Player ID="183" Coach="N" />
<Player ID="58" Coach="Y" />
<Stats FSPts="77" FSPtsWon="53" SSPts="21" SSPtsWon="11"
FSAces="2" SSAces="2" DF="2" TeamBrkPts="16" TeamBrkPtsWon=" 6"
TotPtsWon="110" TeamDeucePts="6 " TeamDeucePtsWon ="1" GamesPlayed="35 "
GamesWon="21" />
</Team>
</Match>
</Scoreboard>

How could I loop through a specific node, such as "Scoreboard/Teams"
and pull out all the information for ONLY that specific node? Once
that is done I would like to be able to move to another node such as
"Match/Teams" and loop through only that node and get all the info. I
would not need to loop through every node in the file, just specific
ones.

As I mentioned, this is just a small sample of the file, it is more
complex than this, but if I could get to this stage I could figure the
rest out. All this info must be put into a database.

Please if anyone has an example on how to do this, I would really
appreciate it. I am in urgent need of getting this done immediately.

Thanks,
Steve

Jun 3 '07
67 2692
"Mr. Arnold" <MR. Ar****@Arnold.c omwrote in message
news:Op******** ******@TK2MSFTN GP05.phx.gbl...
There you go again trying put your spin on what I was saying. You simply
need to mind your own business and stay out of mine.
Seems like good advice for everyone - <plonk>
--
http://www.markrae.net

Jun 3 '07 #11

"gator" <gl****@gmail.c omwrote in message
news:11******** **************@ g4g2000hsf.goog legroups.com...
On Jun 3, 5:17 pm, "Mr. Arnold" <MR. Arn...@Arnold.c omwrote:
>There you go again trying put your spin on what I was saying. You simply
need to mind your own business and stay out of mine.

What is wrong with you? If you don't like my question ... don't
answer it. You told that guy to mind his own business, why don't you
take your advice and stay out of mine.
You made a top post here. It's not like I sought you out down in some
thread. And it's apparent that you're lazy and need someone to hold your
hand, when you should simply go find it yourself. It's not that hard. :)

Jun 3 '07 #12
On Jun 3, 4:34 pm, "Mr. Arnold" <MR. Arn...@Arnold.c omwrote:
<snipped>
Please if anyone has an example on how to do this, I would really
appreciate it. I am in urgent need of getting this done immediately.

You mean to sit there and say that you cannot go out to Google and find
examples on how to do this and put two and two together?

You mean to say that you have to post to a NG and be crutched along, because
you're too lazy to go find an example of this yourself? :)


Uh ... when you think about it, couldn't this be said to ANY person
who EVER posted a question on this or ANY other news group???? Do you
do this to every thread or am I the lucky one who you posted to???
Why are you even here ... go away and bother someone else.

- Steve
Jun 3 '07 #13
Uh ... when you think about it, couldn't this be said to ANY person
who EVER posted a question on this or ANY other news group???? Do you
do this to every thread or am I the lucky one who you posted to???
Why are you even here ... go away and bother someone else.
No one is bothering you. I am just telling it like it is. If you want
examples of what you're trying to do, the wheel has already been invented.
But you have to take it upon yourself to go find it and not be lazy.
Jun 3 '07 #14
On Jun 3, 5:58 pm, "Mr. Arnold" <MR. Arn...@Arnold.c omwrote:
Uh ... when you think about it, couldn't this be said to ANY person
who EVER posted a question on this or ANY other news group???? Do you
do this to every thread or am I the lucky one who you posted to???
Why are you even here ... go away and bother someone else.

No one is bothering you. I am just telling it like it is. If you want
examples of what you're trying to do, the wheel has already been invented.
But you have to take it upon yourself to go find it and not be lazy.
Thanks for the "advice", but I am done with you ... you may go away
now.

- Steve
Jun 3 '07 #15
>
Thanks for the "advice", but I am done with you ... you may go away
now.
I am done with you too. I hope you get your project done. I am sure you
will, but you are
struggling that's a fact, show some kind of guts and go find a solution,
putting two and two together. :)
Jun 3 '07 #16
Mr. Arnold wrote:
There you go again trying put your spin on what I was saying. You simply
need to mind your own business and stay out of mine.
Why ?

Your behavior is or should be a problem for all participants in
this newsgroup.

You are free to not reply to questions where you think the poster
has not tried solving the problem himself/herself.

You are also free to tell the poster that he/she can find
answers to the question via Google (GIYF).

But name calling for posting a question that are clearly
on topic and as far as I can see no different from many
other questions is not nice.

And you will have to live with criticism from other
that feel embarrassed on behalf of the NG.

Arne
Jun 3 '07 #17

"Arne Vajhøj" <ar**@vajhoej.d kwrote in message
news:46******** *************** @news.sunsite.d k...
Mr. Arnold wrote:
>There you go again trying put your spin on what I was saying. You simply
need to mind your own business and stay out of mine.

Why ?

Your behavior is or should be a problem for all participants in
this newsgroup.
There is nothing you can do about it.
>
You are free to not reply to questions where you think the poster
has not tried solving the problem himself/herself.
I am going to give he or she a push if I feel the need.
>
You are also free to tell the poster that he/she can find
answers to the question via Google (GIYF).
I already know that.
>
But name calling for posting a question that are clearly
on topic and as far as I can see no different from many
other questions is not nice.
If I was doing some kind of name calling, you would know it. I don't think
you know what name calling means.
>
And you will have to live with criticism from other
that feel embarrassed on behalf of the NG.
Yeah know, I don't care what others think. It means nothing to me. I stay
out of other people's business, down in the threads. You make a top post,
then that's another story altogether.
Jun 3 '07 #18
<"Mr. Arnold" <MR. Ar****@Arnold.c om>wrote:

<snip>
And you will have to live with criticism from other
that feel embarrassed on behalf of the NG.

Yeah know, I don't care what others think. It means nothing to me.
<snip>

I think you'll find you *will* care if you have a question that *you*
want answering and no-one is willing to help because of the attitude
you've been displaying in this thread and others. I know that *I'd*
certainly rather spend time trying to help someone who has a history of
being polite than someone who is often rude and unwilling to
acknowledge mistakes. I don't have enough time to answer every
question, so I have to apply some criteria to work out which ones to
spend effort on. Politeness is one of those criteria. Maybe that's just
me, but I strongly suspect it isn't.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Jun 3 '07 #19
On Jun 3, 7:02 pm, Jon Skeet [C# MVP] <s...@pobox.com wrote:
<"Mr. Arnold" <MR. Arn...@Arnold.c om>wrote:

<snip>
And you will have to live with criticism from other
that feel embarrassed on behalf of the NG.
Yeah know, I don't care what others think. It means nothing to me.

<snip>

I think you'll find you *will* care if you have a question that *you*
want answering and no-one is willing to help because of the attitude
you've been displaying in this thread and others. I know that *I'd*
certainly rather spend time trying to help someone who has a history of
being polite than someone who is often rude and unwilling to
acknowledge mistakes. I don't have enough time to answer every
question, so I have to apply some criteria to work out which ones to
spend effort on. Politeness is one of those criteria. Maybe that's just
me, but I strongly suspect it isn't.

--
Jon Skeet - <s...@pobox.com >http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hey guys,

I've found part of the answer to my question (thanks to several on
this thread) but I am unsure of how to finish. Here is the code I
have now:
XmlDocument doc = new XmlDocument();
doc.Load(sXMLFi le);

string s = "";

XmlNodeList list = doc.SelectNodes ("Scoreboard/Events");

foreach (XmlNode node in list)
{
s += "Title: " + node["EventType"].Attributes["ID"].Value ;
}
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This gives me the first instance of the attribute "ID", which is a
good start, but how do I loop through the whole node "EventType" and
retreive the whole list of attributes?

Thanks in advance,
- Steve
Jun 3 '07 #20

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

Similar topics

1
2612
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for topics to include in a course on object-orientation that I'm going to conduct. (I will later summarize all the replies and discussion, for the
2
2850
by: csx | last post by:
Hi all, I'm trying to count the number of leafnodes for a particular node. What im trying to do is make a function, that taking the tree structure: key row desc parent 1 1 A 0 2 2 B 1 3 2 C 1 4 3 D 3
2
6498
by: Claire Reed | last post by:
Dear All, I am repeatedly encountering a problem whilst looping through XML Nodes and I am unsure as to what is going on and how I can get around it. I load the following XML document into an XmlDocument object using LoadXml: <?xml version="1.0" encoding="UTF-8"?>
4
1313
by: Shapper | last post by:
Hello, I have a XML file that includes the node <item>: .... <title>...</title> <url>...</url> <item> <title>title 01</title> <description>description 01</description> </item>
2
2597
by: pmcguire67 | last post by:
There has been a lot of discussion lately about extending the treeview control to allow finding a node by key rather than by index. Everyone seems to agree that a hashtable is needed to accomplish this. Also, there is a KB article (http://support.microsoft.com/default.aspx?scid=kb;en-us;311318) purporting to show you how to extend the treenode to include a key. This article seems to be nearly useless to me, as (despite adding a...
12
291
by: **Developer** | last post by:
Dim tvn As TreeNode For Each tvn In rootNode.Nodes ....SNIP rootNode.Nodes.Remove(tvn) Next
1
9667
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej and I was wondering if anyone here would be able to give me some tips for young players such as myself, for learning the language. Is this the best Newsgroup for support with JAVA?
9
1919
by: TF | last post by:
Hello all, I made a ASP.NET 2.0 site that shows possible "recipes" for paint colors stored in an access dbase. Basically, 1000 colors are stored with specific RGB values in separate columns. A user sees all the colors listed on the page with hyperlinks that open the "mixes" page. The mixes page goes through each record, compares it with all other records in a ratio up to "maxratio". If it finds a ratio that matches the redvalue of...
6
2282
by: fido19 | last post by:
Once upon a time, there lived a chimpanzee called Luycha Bandor (aka Playboy Chimp). Luycha was unhappily married to Bunty Mona, a short but cute little lady chimp. Luycha was tall and handsome – he was feeling uncomfortable taking Bunty to public places along with him. People would stare at them all the while. At one point, Luycha could not stand it anymore and he decided to do some justice to his name. He started looking for a new hope in...
0
9722
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
10378
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10391
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
9200
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...
1
7664
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
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
5550
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
5690
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4333
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.