Search the web
Sign In
New User? Sign Up
tdom · tDOM - fast DOM / XPath for Tcl in C
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want your group to be featured on the Yahoo! Groups website? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
known tdom limitations   Message List  
Reply | Forward Message #1706 of 1984 |
Re: known tdom limitations

The piece of code that I use to get the attributes is as follows:

set doc [dom parse $xmloutput]
set root [$doc documentElement]

set jobNumberList [$root selectNodes
/job_info/queue_info/job_list/JB_job_number/text()]


for {set ind 0} {$ind < 70 } {incr ind 1} {
set node [lindex $jobNumberList $ind]
set xml(job$ind,jobNumber) [$node nodeValue]

Where the xmloutput is from the output of a program.
Then I set up a for loop which goes through and extracts each job id,
however, despite the xml having over 500 entries, I always get only 70
job ids.

The error I get if I try to read more than 70 is:

----------------------------------------------------------------
TCL Error
invalid command name ""
invalid command name ""
while executing
"$node nodeValue"
(procedure "test_issue123" line 35)
invoked from within
"$elem"
----------------------------------------------------------------

Any help would be greatly appreciated.
Thanks,

Michal

--- In tdom@yahoogroups.com, rolf@... wrote:
>
>
> On 21 Aug, mnovak222 wrote:
> > Does anyone know of any limitations that tdom has?
>
> Sure it has. The most obvious (not the only) is, that you need enough
> memory, to hold the DOM tree in memory.
>
> But you don't hit any of them so easy, that's very probably not your
> problem.
>
> > I am trying to parse some xml data that has 500 elements but whenever
> > I create a list using selectNodes, it always only returns the first 70
> > elements and no more.
> > Is this some known limitation, or it possible I am doing something
wrong?
>
> You do something wrong. There's no problem at all with XPath
> expressions returning thousands and thousands of nodes.
>
> I bet, your XPath expression does not, what you want it to do. If you
> show it us and explain, what you want it to do, we probably could
> help.
>
> rolf
>




Wed Aug 22, 2007 1:19 pm

mnovak222
Offline Offline
Send Email Send Email

Forward
Message #1706 of 1984 |
Expand Messages Author Sort by Date

Does anyone know of any limitations that tdom has? I am trying to parse some xml data that has 500 elements but whenever I create a list using selectNodes, it...
mnovak222
Offline Send Email
Aug 21, 2007
11:54 am

... Sure it has. The most obvious (not the only) is, that you need enough memory, to hold the DOM tree in memory. But you don't hit any of them so easy, that's...
rolf@...
Send Email
Aug 21, 2007
1:03 pm

The piece of code that I use to get the attributes is as follows: set doc [dom parse $xmloutput] set root [$doc documentElement] set jobNumberList [$root...
mnovak222
Offline Send Email
Aug 22, 2007
1:19 pm

... Obviously there are just 70 nodes, which are matched by the XPath expression /job_info/queue_info/job_list/JB_job_number/text() in your XML document. ...
rolf@...
Send Email
Aug 22, 2007
2:00 pm

Not to be cheeky, but doesn't the { $ind < 70 } end condition in your for loop guarantee you'll never get more than 70 entries in your xml(job$ind,jobNumber)...
Al Chou
HotFusionMan
Offline Send Email
Aug 22, 2007
1:53 pm

Ah, I had a feeling I was being too glib with that last post! Sorry, I should have reread the part about the conditions under which the error occurs before...
Al Chou
HotFusionMan
Offline Send Email
Aug 22, 2007
2:20 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help