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

XmlNodeList.Count hangs forever...

Hi.

I am returning a "distinct" list of nodes from an xmldocument using
selectnodes. I get the list fine, and I can select individual nodes,
but when I try to access the count of the list my computer just hangs.
Also, if I try to iterate the list using foreach the first time works,
and then the second try hangs. I don't have more than about 200 rows
in the xmldocument. Anyone know what's going on? XPath expression and
code below:

pattern = "NewDataSet/Table[not(State =
preceding-ibling::Table/State)]/State";

xmlNodes = xmlDoc.SelectNodes(pattern);

for(g = 0; g < xmlNodes.Count; g++)
{
xNode = xmlNodes[g];
tvLeftPane.Nodes.Add(xNode.InnerText);
}

_Randal
Nov 12 '05 #1
1 2505


Randal Chapman wrote:

I am returning a "distinct" list of nodes from an xmldocument using
selectnodes. I get the list fine, and I can select individual nodes,
but when I try to access the count of the list my computer just hangs.
Also, if I try to iterate the list using foreach the first time works,
and then the second try hangs. I don't have more than about 200 rows
in the xmldocument. Anyone know what's going on? XPath expression and
code below:

pattern = "NewDataSet/Table[not(State =
preceding-ibling::Table/State)]/State";
There is a typo, it needs to be

pattern =
"NewDataSet/Table[not(State=preceding-sibling::Table/State)]/State";
xmlNodes = xmlDoc.SelectNodes(pattern);

for(g = 0; g < xmlNodes.Count; g++)
{
xNode = xmlNodes[g];
tvLeftPane.Nodes.Add(xNode.InnerText);


What are you manipulating here? If tvLeftPane.Nodes is part of the same
document then your collection might change inside the loop.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #2

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

Similar topics

1
by: John Ramsden | last post by:
I have a script running on PHP v4.3.6 (cgi) that hangs forever in a call to the Postgres pg_get_result() function when and only when the query length is 65536 or more bytes. The query is a...
2
by: Ed Swartz | last post by:
I installed SP4 for Windows 2000. Prior to the upgrade my system was at SP3 and I was able to run ASP scripts from my browser just fine. For exmaple: ...
1
by: Lize | last post by:
Hi, I'm writing an ASP application to open an excel workbook, then run a macro stored in the excel file, which produces outputs that will be displayed back onto my ASP application. Now the...
1
by: Eddie | last post by:
I am having a strange issue with MySQL. I just installed it on my Zaurus and loaded a few of my databases in it. All very small. When I do a count withoout a where, it hangs. It does this on all...
1
by: Roe | last post by:
Hi! Here's my code: //xd is an XmlDocument object, xnm is an XmlNameSpaceManager XmlNodeList xnl = xd.SelectNodes ("/bd:SubscriptionInfoSet/bd:SubscriptionInfo",xnm); //TEST: Check to see...
1
by: Peter Nofelt | last post by:
Hey All, I'm running into this issue with parsing through an xml document by tag name. Below is an example xml document: File Name: things.xml <things> <people> <name>Peter</name>
4
by: SkyHook | last post by:
1. Under the topic "Select Nodes Using XPath Navigation" it says: "All XmlNodeList objects are synchronized with the underlying document, therefore if you ... modify the value of a node, that node...
1
by: bigeddie | last post by:
Hi, I'm trying to get an instance off a XmlNodeList without using selectNodes(...) XmlNodeList test1 = new XmlNodeList(); (C#) but that doesn't work. What's my mistake?
4
by: eggie5 | last post by:
Hi, I have an XmlNodeList and I need to reverse it. Just like Array.Reverse(), but it has to stay as an XmlNodeList. Any ideas?
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.