By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,644 Members | 1,834 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,644 IT Pros & Developers. It's quick & easy.

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

P: n/a
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="EventName1" />
<Event ID="001213" Name="EventName2" />
<Event ID="001214" Name="EventName3" />
<Event ID="001215" Name="EventName4" />
</Events>
<EventTypes>
<EventType ID="01" SingleGame="true" Name="EventName1" />
<EventType ID="02" SingleGame="true" Name="EventName2" />
<EventType ID="03" SingleGame="true" Name="EventName3" />
<EventType ID="04" SingleGame="true" Name="EventName4" />
<EventType ID="05" SingleGame="true" Name="EventName5" />
<EventType ID="06" SingleGame="true" Name="EventName6" />
<EventType ID="07" SingleGame="true" Name="EventName7" />
</EventTypes>
<Teams>
<Team ID="11" City="City1" Name="Name1" City="City1"
Nickname="nickname1" Conference="Conference1">
<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="nickname2" Conference="Conference1">
<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" IsChallengeEnabled="false"
VenueID="NBB" SchedDate="2006-07-30" SchedTime="13:00"
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 #1
Share this Question
Share on Google+
67 Replies


P: n/a
On Jun 3, 5:58 pm, gator <glb...@gmail.comwrote:
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="EventName1" />
<Event ID="001213" Name="EventName2" />
<Event ID="001214" Name="EventName3" />
<Event ID="001215" Name="EventName4" />
</Events>
<EventTypes>
<EventType ID="01" SingleGame="true" Name="EventName1" />
<EventType ID="02" SingleGame="true" Name="EventName2" />
<EventType ID="03" SingleGame="true" Name="EventName3" />
<EventType ID="04" SingleGame="true" Name="EventName4" />
<EventType ID="05" SingleGame="true" Name="EventName5" />
<EventType ID="06" SingleGame="true" Name="EventName6" />
<EventType ID="07" SingleGame="true" Name="EventName7" />
</EventTypes>
<Teams>
<Team ID="11" City="City1" Name="Name1" City="City1"
Nickname="nickname1" Conference="Conference1">
<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="nickname2" Conference="Conference1">
<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" IsChallengeEnabled="false"
VenueID="NBB" SchedDate="2006-07-30" SchedTime="13:00"
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
Hi Steve,

Try using XPathNavigator class.
http://msdn2.microsoft.com/en-us/lib...navigator.aspx

Hope this helps.
Moty

Jun 3 '07 #2

P: n/a

On Sun, 03 Jun 2007 07:58:06 -0700, gator <gl****@gmail.comwrote:
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:
.. [...]
>
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.
There is no need to start a new thread, or even to repost the sample
data. If you feel that you should elaborate or clarify the original post,
you can and should simply reply in that original thread, so that all of
the related posts stay together.

Hopefully Moty's reply addresses your question. If not, then you should
probably be more specific about what exactly is in the way here. Are you
having trouble actually reading the data, as your most recent posts
suggests? Or is there something else about the desired goal you're having
trouble implementing? If so, what exactly is it that you're trying and
not having success with?

Pete
Jun 3 '07 #3

P: n/a
On Jun 3, 9:35 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 03 Jun 2007 07:58:06 -0700, gator <glb...@gmail.comwrote:
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:

. [...]
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.

There is no need to start a new thread, or even to repost the sample
data. If you feel that you should elaborate or clarify the original post,
you can and should simply reply in that original thread, so that all of
the related posts stay together.

Hopefully Moty's reply addresses your question. If not, then you should
probably be more specific about what exactly is in the way here. Are you
having trouble actually reading the data, as your most recent posts
suggests? Or is there something else about the desired goal you're having
trouble implementing? If so, what exactly is it that you're trying and
not having success with?

Pete
Use
XmlDataDocument xmlDoc = new XmlDataDocument();
xmlDoc.Load("Sample.xml"); //or use xmlDoc.LoadXml(xmlData);//xmlData
is string
XmlNode myNode =xmlDoc.SelectSingleNode(""/mytable/myrow");//modify
path according to ur xml schema
Now you can use:
foreach (XmlNode fieldNode in myNode.ChildNodes)
{
}

I guess Moly has given the right thing for you. This'd be pretty easy
for you. Good luck!

Jun 3 '07 #4

P: n/a
<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? :)

Jun 3 '07 #5

P: n/a
On Sun, 03 Jun 2007 13:34:52 -0700, Mr. Arnold <MR. <Ar****@Arnold.com>>
wrote:
[abusive reply snipped] :)
Honestly. How does putting a smiley at the end of that post make it okay?

Most of the questions that are answered here could be addressed through
just reading the MSDN documentation, or experimenting with the API. I
don't think that justifies writing hostile replies such as yours when
someone posts such a question.

I have to admit, I have a hard time understanding the question, because it
looks like a pretty straightforward task to me. But I accept that not
everyone can "see" the solution right away, nor do I always "see" the
solution right away. It's a matter of perspective and sometimes what
seems like a dumb question really just needs someone to figure out what's
wrong with the poster's perspective and help them work their way to a
different point of view.

Regardless, I don't think that harassing someone just because they asked a
question is reasonable.

Pete
Jun 3 '07 #6

P: n/a

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.

Jun 3 '07 #7

P: n/a
"Mr. Arnold" <MR. Ar****@Arnold.comwrote in message
news:Op**************@TK2MSFTNGP05.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 #8

P: n/a
On Jun 3, 5:17 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
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.

Jun 3 '07 #9

P: n/a
On Jun 3, 1:08 pm, Aneesh P <anees...@gmail.comwrote:
On Jun 3, 9:35 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:


On Sun, 03 Jun 2007 07:58:06 -0700, gator <glb...@gmail.comwrote:
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:
. [...]
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.
There is no need to start a new thread, or even to repost the sample
data. If you feel that you should elaborate or clarify the original post,
you can and should simply reply in that original thread, so that all of
the related posts stay together.
Hopefully Moty's reply addresses your question. If not, then you should
probably be more specific about what exactly is in the way here. Are you
having trouble actually reading the data, as your most recent posts
suggests? Or is there something else about the desired goal you're having
trouble implementing? If so, what exactly is it that you're trying and
not having success with?
Pete

Use
XmlDataDocument xmlDoc = new XmlDataDocument();
xmlDoc.Load("Sample.xml"); //or use xmlDoc.LoadXml(xmlData);//xmlData
is string

XmlNode myNode =xmlDoc.SelectSingleNode(""/mytable/myrow");//modify
path according to ur xml schema

Now you can use:
foreach (XmlNode fieldNode in myNode.ChildNodes)
{

}

I guess Moly has given the right thing for you. This'd be pretty easy
for you. Good luck!- Hide quoted text -

- Show quoted text -
Thanks to all for the help ... it's really appreciated.

- Steve

Jun 3 '07 #10

P: n/a

"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:eN**************@TK2MSFTNGP06.phx.gbl...
"Mr. Arnold" <MR. Ar****@Arnold.comwrote in message
news:Op**************@TK2MSFTNGP05.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>
I agree <Plank>. <g>

Jun 3 '07 #11

P: n/a

"gator" <gl****@gmail.comwrote in message
news:11**********************@g4g2000hsf.googlegro ups.com...
On Jun 3, 5:17 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
>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

P: n/a
On Jun 3, 4:34 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
<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

P: n/a
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

P: n/a
On Jun 3, 5:58 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
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

P: n/a
>
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

P: n/a
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

P: n/a

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
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

P: n/a
<"Mr. Arnold" <MR. Ar****@Arnold.com>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.com>
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

P: n/a
On Jun 3, 7:02 pm, Jon Skeet [C# MVP] <s...@pobox.comwrote:
<"Mr. Arnold" <MR. Arn...@Arnold.com>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(sXMLFile);

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

P: n/a

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP*********************@msnews.microsoft.com. ..
<"Mr. Arnold" <MR. Ar****@Arnold.com>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.
Not to be rude here, but if I want a question answered, then I know how to
go find that answer, if I had to do that.
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.
What mistakes were those? Now, I may see things in a different light, which
I do see, because I do come from a different background or environment than
most posting in this NG, which is the streets I grew up in and still deal
with at times. I will apply that street mentality at times in a NG. But that
doesn't mean anything is a mistake.
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.
I am not trying to be rude here. I don't think I would ask for any help,
because I know how to go find the answer, particularly when it comes to
programming and the MS platform.

The key to anything being talked about in this NG or any NG is this.

Does one know how to find the information for a given problem and apply the
information to produce a viable solution? That's what the Internet is about.
And if you know how to go find that information, you do, and if you don't,
then you don't know how to do it. There are no in betweens.

Jun 3 '07 #21

P: n/a
On Sun, 03 Jun 2007 16:38:22 -0700, Mr. Arnold <MR. <Ar****@Arnold.com>>
wrote:
Not to be rude here,
"Not to be rude"? A little too late for that, don't you think?
but if I want a question answered, then I know how to go find that
answer, if I had to do that.
The same thing could be said of practically EVERY question asked in this
newsgroup. Why should we bother answering *any* question, given that's
the case?
>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.

What mistakes were those?
Well, for me the defining moment in your introduction of yourself to this
newsgroup was when you refused to acknowledge the error in claiming that
modifying a loop index from within the loop would in and of itself make
the loop "blow up" (your words).

You've had your share of other missteps, IMHO, but I'll bet that's the one
that sticks in most people's minds.
Now, I may see things in a different light, which I do see, because I do
come from a different background or environment than most posting in
this NG, which is the streets I grew up in and still deal with at times.
Huh? This is about "street cred", or some silly notion like that?

Here's a hint: even if you do live in a rough neighborhood (whatever
that's supposed to mean), that doesn't justify you going around insulting
people.
I will apply that street mentality at times in a NG. But that doesn't
mean anything is a mistake.
I think that the mistakes Jon refers to are factual errors you've made.
Being rude is also a mistake, but I don't think that's the point he was
making.
I am not trying to be rude here. I don't think I would ask for any
help, because I know how to go find the answer, particularly when it
comes to programming and the MS platform.
Again, if everyone should be expected to just "go find the answer" rather
than ask the question here, why should anyone ever post a question here?
The key to anything being talked about in this NG or any NG is this.

Does one know how to find the information for a given problem and apply
the information to produce a viable solution? That's what the Internet
is about. And if you know how to go find that information, you do, and
if you don't, then you don't know how to do it. There are no in betweens.
If "there are no in betweens", then why do we have this newsgroup at all?

Like Jon, I do keep track of the people who can't behave themselves, and I
do avoid answering their questions. But more importantly, even if you do
not expect to ever ask a question here, that does not make it okay for you
to go around abusing people.

I find it unfortunate that in the last few weeks, we've had at least two
off-topic threads by people who basically refuse to act politely, only
because there are no direct consequences to them for not doing so. I find
myself wondering what ever happened to the notion of doing something just
because "it's the right thing to do" (and I'm not talking oatmeal here).

Pete
Jun 3 '07 #22

P: n/a
On Sun, 03 Jun 2007 16:30:38 -0700, gator <gl****@gmail.comwrote:
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:

[...]

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?
You need to implement some sort of recursive processing, where you use the
XmlNode.ChildNodes property to look at the XML nodes within the given node.

It can either be a true recursive method that calls itself and has the
logic in it to handle every single node type you expect to see,
maintaining the necessary state to know what to do with those nodes. Or
you can write special-purpose methods for each node type, calling each as
appropriate from the others as you come across each node.

But the key is that once you have an XML node, you can enumerate all of
the nodes within it by using the ChildNodes property.

Pete
Jun 4 '07 #23

P: n/a
On Jun 3, 7:53 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 03 Jun 2007 16:38:22 -0700, Mr. Arnold <MR. <Arn...@Arnold.com>>
wrote:
Not to be rude here,

"Not to be rude"? A little too late for that, don't you think?
but if I want a question answered, then I know how to go find that
answer, if I had to do that.

The same thing could be said of practically EVERY question asked in this
newsgroup. Why should we bother answering *any* question, given that's
the case?
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.
What mistakes were those?

Well, for me the defining moment in your introduction of yourself to this
newsgroup was when you refused to acknowledge the error in claiming that
modifying a loop index from within the loop would in and of itself make
the loop "blow up" (your words).

You've had your share of other missteps, IMHO, but I'll bet that's the one
that sticks in most people's minds.
Now, I may see things in a different light, which I do see, because I do
come from a different background or environment than most posting in
this NG, which is the streets I grew up in and still deal with at times.

Huh? This is about "street cred", or some silly notion like that?

Here's a hint: even if you do live in a rough neighborhood (whatever
that's supposed to mean), that doesn't justify you going around insulting
people.
I will apply that street mentality at times in a NG. But that doesn't
mean anything is a mistake.

I think that the mistakes Jon refers to are factual errors you've made.
Being rude is also a mistake, but I don't think that's the point he was
making.
I am not trying to be rude here. I don't think I would ask for any
help, because I know how to go find the answer, particularly when it
comes to programming and the MS platform.

Again, if everyone should be expected to just "go find the answer" rather
than ask the question here, why should anyone ever post a question here?
The key to anything being talked about in this NG or any NG is this.
Does one know how to find the information for a given problem and apply
the information to produce a viable solution? That's what the Internet
is about. And if you know how to go find that information, you do, and
if you don't, then you don't know how to do it. There are no in betweens.

If "there are no in betweens", then why do we have this newsgroup at all?

Like Jon, I do keep track of the people who can't behave themselves, and I
do avoid answering their questions. But more importantly, even if you do
not expect to ever ask a question here, that does not make it okay for you
to go around abusing people.

I find it unfortunate that in the last few weeks, we've had at least two
off-topic threads by people who basically refuse to act politely, only
because there are no direct consequences to them for not doing so. I find
myself wondering what ever happened to the notion of doing something just
because "it's the right thing to do" (and I'm not talking oatmeal here).

Pete


================================================== ================================================== ===

uh, excuse me folks ... but could we move the psychiatric session to
another thread so I could see if anyone can help me with the OTHER
topic of the thread, "XML Parsing"?

=)

Thanks, much appreciated!

- Steve (the original poster before this turned into the "Arnie seeks
therapy thread").

Jun 4 '07 #24

P: n/a
On Sun, 03 Jun 2007 17:04:20 -0700, gator <gl****@gmail.comwrote:
uh, excuse me folks ... but could we move the psychiatric session to
another thread so I could see if anyone can help me with the OTHER
topic of the thread, "XML Parsing"?
Uh, well...you could always move your question about XML back to the
original thread you posted. It seems to have remained relatively
uncluttered. :)
Jun 4 '07 #25

P: n/a
If I respected your opinion, I might listen. I don't respect you, period. So
you might as well stop posting to me.

Jun 4 '07 #26

P: n/a
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
Your behavior is or should be a problem for all participants in
this newsgroup.

And you will have to live with criticism from other
that feel embarrassed on behalf of the NG.
Not just this newsgroup - this guy acts in similar vein on several others on
the microsoft server...

Well overdue for the killfile...
--
http://www.markrae.net

Jun 4 '07 #27

P: n/a

"Mark Rae" <ma**@markNOSPAMrae.netwrote in message
news:uz****************@TK2MSFTNGP03.phx.gbl...
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
>Your behavior is or should be a problem for all participants in
this newsgroup.

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

Not just this newsgroup - this guy acts in similar vein on several others
on the microsoft server...

Well overdue for the killfile...
Well you please do it and stay out of my face. That's all I ask of any of
you is to stay out of my face. You'll find that I don't have conversations
with the regulars in any NG. It's best that way.
Jun 4 '07 #28

P: n/a
On Sun, 03 Jun 2007 17:26:29 -0700, Mr. Arnold <MR. <Ar****@Arnold.com>>
wrote:
If I respected your opinion, I might listen. I don't respect you,
period. So you might as well stop posting to me.
It means nothing to me regarding whether you respect my opinion or not.
There are factual statements here that pertain to you. In any case, if my
posts are so useless to you, I really wish you'd just put me in your
killfile and be done with it. If I "might as well stop posting to you",
why do you bother to reply at all?
Jun 4 '07 #29

P: n/a

Disappear Peter, you mean nothing to me. And the sooner you understand
that, the better things will be. The moment I recognize anyone as being a
serious regular in a NG whether that be top posting for help or posting down
in a thread, it's over for him or her. I will not initiate a post to that
person, as I have no need to do that. I mind my own business, help someone
if I can, and in general, I mind my own business.

Jun 4 '07 #30

P: n/a
On Jun 3, 8:11 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 03 Jun 2007 17:04:20 -0700, gator <glb...@gmail.comwrote:
uh, excuse me folks ... but could we move the psychiatric session to
another thread so I could see if anyone can help me with the OTHER
topic of the thread, "XML Parsing"?

Uh, well...you could always move your question about XML back to the
original thread you posted. It seems to have remained relatively
uncluttered. :)
HAHAHA ... good point.
Jun 4 '07 #31

P: n/a
On Jun 4, 3:11 am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Sun, 03 Jun 2007 17:04:20 -0700, gator <glb...@gmail.comwrote:
uh, excuse me folks ... but could we move the psychiatric session to
another thread so I could see if anyone can help me with the OTHER
topic of the thread, "XML Parsing"?

Uh, well...you could always move your question about XML back to the
original thread you posted. It seems to have remained relatively
uncluttered. :)
Hi Guys,

First I must agree with those who has politness as a criteria for
spending expensive time on reading and sharing their (huge) knowledge
with those who are willing to become professionals.

It's a question of perspective and I my self have "stupid" questions
for professionals that are very smart for my point of view. And I am
glad that I can ask these kind of questions without being afraid to be
labeled as a *stupid*.

Professional should be professional in it's personality as much as in
it's knowledge, of any kind.

Now back to business.
Dear Gator,

I would recommend using the XPathNavigator for advanced navigation.
The method you used is great for your purpose but XPathNavigator can
be used as a base navigation tool for future use.

For nested navigation you can use the same navigation/selection method
in a recursive way, just as Pete suggested.

Feel free, and don't hesitate to ask any other questions.

Cheers and good luck,
Moty

Jun 4 '07 #32

P: n/a
<"Mr. Arnold" <MR. Ar****@Arnold.com>wrote:
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.

Not to be rude here, but if I want a question answered, then I know how to
go find that answer, if I had to do that.
You don't think you'd ever, ever have a question which someone in this
newsgroup could answer quickly but which could take you days of
searching otherwise? I know that's certainly not the case for me -
while I mostly answer questions rather than asking them, I value the
newsgroup immensely and know that when I *do* have a question, there
are incredibly smart people ready to help.
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.

What mistakes were those? Now, I may see things in a different light, which
I do see, because I do come from a different background or environment than
most posting in this NG, which is the streets I grew up in and still deal
with at times. I will apply that street mentality at times in a NG. But that
doesn't mean anything is a mistake.
I'm referring to the thread where you claimed a loop would blow up, and
were rude to a lot of people before you acknowledged that in fact it
wouldn't.

I don't believe background is particularly relevant when it comes to
being polite in an online community.
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.

I am not trying to be rude here. I don't think I would ask for any help,
because I know how to go find the answer, particularly when it comes to
programming and the MS platform.

The key to anything being talked about in this NG or any NG is this.

Does one know how to find the information for a given problem and apply the
information to produce a viable solution? That's what the Internet is about.
And if you know how to go find that information, you do, and if you don't,
then you don't know how to do it. There are no in betweens.
Rubbish. If the world were so black and white, why even be on the
newsgroup at all? If everyone should be able to find out everything
without coming to a newsgroup, that presumably means that everyone who
asks a question deserves the rude kind of response you provided here.
That's just nonsense. The newsgroup *is* one source of information, in
my view. Yes, it's nice if people look around for answers before asking
questions, but that's not the same thing as saying that every question
is effectively due to people not knowing how to look for information on
the net.

I do wonder what you view your role on the newsgroup as being, if you
don't think you'll ever want to ask a question and you think that every
question would be better answered by searching.

--
Jon Skeet - <sk***@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
Jun 4 '07 #33

P: n/a
Please people, you are all making too much of this. <g All this for little
old me? I guess this NG is no different than any of the other ones I have
been in since I discovered NG(s) back in 2001.

I am sorry folks. I am who I am when it comes to the Internet and NG(s).
Either don't read my post, read my post or do a <plonk>, because I have not
changed in 7 years, so should get use to it. I don't dance to anyone's tune
on the Internet.

However, since I have been off from work, due to foot surgery for several
weeks, I guess I have been out here too hard as of late doing battle more
than I should be. :)

I got some things I have to do in the am.

good night

Jun 4 '07 #34

P: n/a
On Jun 4, 7:57 am, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
Please people, you are all making too much of this. <g All this for little
old me? I guess this NG is no different than any of the other ones I have
been in since I discovered NG(s) back in 2001.
You're right: many newsgroups dislike rudeness.
I am sorry folks. I am who I am when it comes to the Internet and NG(s).
Either don't read my post, read my post or do a <plonk>, because
I have not changed in 7 years, so should get use to it. I don't dance to
anyone's tune on the Internet.
The problem is that while regulars can killfile you, that doesn't help
people who come here for the first time, and may well be scared off by
rudeness such as yours.

There's plenty of room for individuals to express themselves in
different ways without being rude. Is there anything we can do to
force you to be polite? Nope. (The Microsoft server could start
filtering you out, but I don't think it's come remotely close to that
stage yet.) Does that mean it's right for you to keep being rude? No.

What I don't understand is *why* you'd want to do this. If you don't
want to help people, don't help them - fine. But *please* don't just
belittle them for no good reason. Fortunately the OP in this case has
stuck around, but I've seen people post once and then never come back
after receiving replies like your first one in this thread.
However, since I have been off from work, due to foot surgery for several
weeks, I guess I have been out here too hard as of late doing battle more
than I should be. :)
Spirited debates, I have no problem with. Just being plain rude
doesn't help anyone.

Jon

Jun 4 '07 #35

P: n/a
On Jun 4, 9:57 am, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
Please people, you are all making too much of this. <g All this for little
old me? I guess this NG is no different than any of the other ones I have
been in since I discovered NG(s) back in 2001.

I am sorry folks. I am who I am when it comes to the Internet and NG(s).
Either don't read my post, read my post or do a <plonk>, because I have not
changed in 7 years, so should get use to it. I don't dance to anyone's tune
on the Internet.

However, since I have been off from work, due to foot surgery for several
weeks, I guess I have been out here too hard as of late doing battle more
than I should be. :)

I got some things I have to do in the am.

good night

Hi,

Please respect this newsgroup (and so many others) and the
participants, as much as you want us to respect you and who you are.
Feel well, and get back to work as soon as possible.

Good night,
Moty

Jun 4 '07 #36

P: n/a
On Jun 4, 8:30 am, Moty Michaely <Moty...@gmail.comwrote:
Please respect this newsgroup (and so many others) and the
participants, as much as you want us to respect you and who you are.
I think his point has been that he doesn't care whether we respect him
or not. That's unfortunate, but it's still not an excuse not to act
respectfully to others, IMO :(

Jon

Jun 4 '07 #37

P: n/a
On Jun 4, 10:51 am, "Jon Skeet [C# MVP]" <s...@pobox.comwrote:
On Jun 4, 8:30 am, Moty Michaely <Moty...@gmail.comwrote:
Please respect this newsgroup (and so many others) and the
participants, as much as you want us to respect you and who you are.

I think his point has been that he doesn't care whether we respect him
or not. That's unfortunate, but it's still not an excuse not to act
respectfully to others, IMO :(

Jon

I agree.

I think the discussion has gone far away.

We have better things to discuss on and of course to do :)

Great day,
Moty

Jun 4 '07 #38

P: n/a
On Sun, 03 Jun 2007 19:53:07 -0700, Mr. Arnold <MR. <Ar****@Arnold.com>>
wrote:
>
Disappear Peter, you mean nothing to me.
If I mean nothing to you, why do you continue to reply to my posts?
And the sooner you understand that, the better things will be.
For whom? No skin off my nose one way or the other. So, for you? Why
should I care?
The moment I recognize anyone as being a serious regular in a NG whether
that be top posting for help or posting down in a thread, it's over for
him or her.
What does that even mean? "It's over for him or her". How is "it"
"over"? And why does that apply solely to "a serious regular in a NG"?
I will not initiate a post to that person, as I have no need to do that.
You just initiated a post to me. In fact, you've initiated several. Is
that because you don't correctly recognize me as a "serious regular"?
I mind my own business,
That's not true. You went out of your way to insult someone. That's
hardly minding your own business.
help someone if I can,
That's clearly not true also. You could have helped the guy, but you
didn't.
and in general, I mind my own business.
You did say that previously, in the same sentence. It's still not true.

Pete
Jun 4 '07 #39

P: n/a
>
The problem is that while regulars can killfile you, that doesn't help
people who come here for the first time, and may well be scared off by
rudeness such as yours.
Do you really think a killfile means anything and that one couldn't come
around it? :)
So the OP got stepped on a little bit. I hardly step on him, and I have done
worst, believe me.

For the most part, I am minding my own business. The only rudeness you have
seen by me is towards those who choose the be there in the first place, like
the old Moty and Peter, which I am flat out tired of looking at both of
them, because I certainly didn't need or wanted to seek them out.

I am not into debates. I never have and never will be into some kind of a
debate.


Jun 4 '07 #40

P: n/a
I am going to tell you again to disappear. None of your stuff is being read
by me again. I don't like you period, sherrif.

Jun 4 '07 #41

P: n/a
On Jun 4, 12:24 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
The problem is that while regulars can killfile you, that doesn't help
people who come here for the first time, and may well be scared off by
rudeness such as yours.

Do you really think a killfile means anything and that one couldn't come
around it? :)
Well, you suggested that one approach was to "do a plonk" by which I
assumed you meant killfiling. Mind you, your idea of a "top post" is
somewhat different to the normal one, so maybe you mean something
different by "plonk" too.
So the OP got stepped on a little bit. I hardly step on him, and I have done
worst, believe me.
Why is it relevant that you've done worse? If someone beat you up a
bit in the street, would you be consoled if he said he'd done worse to
someone else?
For the most part, I am minding my own business. The only rudeness you
have seen by me is towards those who choose the be there in the first
place, like the old Moty and Peter, which I am flat out tired of looking at
both of them, because I certainly didn't need or wanted to seek them out.
Your first post in this thread was rude - there's no getting away from
that. Your rudeness in other threads has also been uncalled for.
I am not into debates. I never have and never will be into some kind of a
debate.
Shame. Still, doesn't seem to stop you from posting several posts to a
thread...

Jon

Jun 4 '07 #42

P: n/a
>
Shame. Still, doesn't seem to stop you from posting several posts to a
thread...
The pot calling the kettle black I would say.

There is no shame in my game. :)
Jun 4 '07 #43

P: n/a
On Mon, 04 Jun 2007 05:24:50 -0700, Mr. Arnold <MR. <Ar****@Arnold.com>>
wrote:
I am going to tell you again to disappear.
Why? Is that helping you in some way?
None of your stuff is being read by me again.
It's obviously false that you aren't reading *any* of what I post. You
can't reply without at least knowing that I've posted, and that requires
reading at least some of what I wrote.
I don't like you period, sherrif.
Is that supposed to be relevant? Is it helpful to tell a person you don't
like them? I didn't realize that I was required to be explicit about when
I don't like someone, or that it somehow helps the conversation to point
that out. Perhaps you can explain what the advantage to doing so is.

Pete

Jun 4 '07 #44

P: n/a
"Peter Duniho" <Np*********@nnowslpianmk.comwrote in message
news:op***************@petes-computer.local...
Pete
Just killfile him...
--
http://www.markrae.net

Jun 4 '07 #45

P: n/a
On Mon, 04 Jun 2007 09:22:57 -0700, Mark Rae <ma**@markNOSPAMrae.net>
wrote:
Just killfile him...
Well, I presume your reply to me actually includes two suggestions: one is
to simply stop responding to him, and the other is to hide his posts so
I'm not tempted to respond.

On the latter, I feel it's important to have a strong public negative
response to bad behavior. Like it or not, a newsgroup is a community ,
with the social pressures any community has, and broad, community
rejection of bad behavior is key to preventing bad behavior. You can't
respond negatively to someone if you've got them killfiled.

On the former, sure...I could just drop it. When it stops being
entertaining to me, surely I will. :) I find his protestations amusing,
and am curious when *he* will simply stop replying to *me*. :)

Pete
Jun 4 '07 #46

P: n/a
>
On the former, sure...I could just drop it. When it stops being
entertaining to me, surely I will. :) I find his protestations amusing,
and am curious when *he* will simply stop replying to *me*. :)
That will be when that hag you call a mama changes your Pamper.

Now, let see how you respond to that! :)

You're not off limits on an indirect post. That's you and your entire family
Peter Pan. <g>

Jun 4 '07 #47

P: n/a
And I'll forewarn you and this entire NG Peter Pan, that killfile means
nothing to me as I'll come right through them, count on it. You should
listen to the message Peter Pan.

Jun 4 '07 #48

P: n/a
On Mon, 04 Jun 2007 10:18:33 -0700, Mr. Arnold <MR. <Ar****@Arnold.com>>
wrote:
That will be when that hag you call a mama changes your Pamper.
I thought you said you weren't reading what I wrote. Obviously you lied.
Now, let see how you respond to that! :)
How am I supposed to respond to a completely pointless, empty collection
of words intended solely to insult? Is that how they do it "on the
street"?
You're not off limits on an indirect post. That's you and your entire
family Peter Pan. <g>
What's me and my entire family? What's not off limits? You are making no
sense.

Jun 4 '07 #49

P: n/a

"Peter Pan the Dildo wrote"
>
>That will be when that hag you call a mama changes your Pamper.

I thought you said you weren't reading what I wrote. Obviously you lied.
I talked to your mama a few minutes ago while I was banging her and she said
it was OK to talk to you, since you were a lonely being.

I didn't realize you had such a troubled childhood and needed my attention
here Peter Pan.

But you got my attention now Peter Pan. Now, you just remember that you put
yourself here in this position. I didn't put you here.

You want to play the NG lapdog/sheriff then so be it. But I got a treat for
you every time you bark Peter Pan. And they are medicated too.

http://www.saltypawsbiscuits.com/

Jun 4 '07 #50

67 Replies

This discussion thread is closed

Replies have been disabled for this discussion.