From: Robert Klemme Date: 2010-10-21T16:55:01+09:00 Subject: Re: Help missing something BASIC On Thu, Oct 21, 2010 at 12:18 AM, Don Norcott wrote: > My issue is not with anything you have shown me and not with my ability > to get the code working or get the next piece code working predictably. > > My only issue is conceptual.  I have no problem understanding that node > contains the entire tree structure since I am able to return all the > itemNumbr elements with >    node.xpath("//td[@class='itemNumbr']") > > > What I am not able to do is output proof to convince myself that the > node contains other than the selected table (ie inspect, parse, to_s, > to_html all return the single table). The problem might lie in the term "contains". Conceptually one would probably say that a node contains all its sub nodes. Technically a node can also (indirectly) contain the whole document. This happens if you include a reference to the parent node or the document. Here's an example with parent node inclusion. http://gist.github.com/638085 If you add a line "pp ch" to the iteration code at the end of the file, you will see that each node "contains" all the rest of the document. > This is my last post - I really have no issue other than the conceptual Hopefully not. :-) > Thanks again for all your help. Your welcome! Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/