Thread: RE: [Htmlparser-developer] SimpleNodeIterator
Brought to you by:
derrickoswald
From: <dha...@or...> - 2003-05-14 14:43:09
|
Another problem: One more thing that I noticed: At the base level Parser.elements() gives me a list of all the first-level nodes. Using any of the first level nodes I may obtain its next-level children using CompositeTag.getChildren(). This being a NodeList I can easily add new elements(nodes, tags etc) here. However I cannot add the same at the first level. Can anything be done about it? Regards, Dhaval Udani Senior Analyst M-Line, QPEG OrbiTech Solutions Ltd. +91-22-28290019 Extn. 1457 > -----Original Message----- > From: Udani, Dhaval H. > Sent: Wednesday, May 14, 2003 7:45 PM > To: htmlparser-developer > Cc: Udani, Dhaval H. > Subject: [Htmlparser-developer] SimpleNodeIteraotr > > > Hi, > > Since SimpleNodeIterator is basically the same as > NodeIterator, I think it > should just extend NodeIterator and redefine the methods > without throwing the > exceptions. Either that way or make NodeIterator extend > SimpleNodeIterator. I > think its better design and leads to more uniform code. > > Secondly, some anomalies that I noted. Not really serious but > just from a more > consistent viewpoint. > > Parser.elements() returns a NodeIterator > > while CompositeTag.getChildren() returns a NodeList. > > Ideally since both are returning the nodes, a common > mechanism should be used. > > Also NodeList.elements() returns a SimpleNodeIterator. This > should also be > synchronized with the above so that one common class is returned. > > This is pretty typical of Java classes : Vector has add() > method and Hashtable > has put() method clearly showing that both were written > separately. There are > many more such examples actually. We should try and avoid it. > > Dhaval > > > > ------------------------------------------------------- > Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara > The only event dedicated to issues related to Linux > enterprise solutions > www.enterpriselinuxforum.com > > _______________________________________________ > Htmlparser-developer mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-developer > |
From: <dha...@or...> - 2003-05-15 04:03:07
|
> > Use the HtmlScanner, to get the first level nodes under html. > If you don't - > there is no such thing as a "root node" to add children to. Slight problem here. Suppose I am parsing for some comments above the HTML or say that I have a JSP, then it is quite likely to have values at the same level as <HTML>. Do you think it makes sense to ahve a implicit root-level within the Parser whose one child would be everything under <HTML> and all other tags at the same level. Dhaval |
From: Somik R. <so...@ya...> - 2003-05-16 02:14:44
|
> Slight problem here. Suppose I am parsing for some comments above the HTML or > say that I have a JSP, then it is quite likely to have values at the same level > as <HTML>. Do you think it makes sense to ahve a implicit root-level within the > Parser whose one child would be everything under <HTML> and all other tags at > the same level. I'd suggest the user-story driven approach. Do we have a "real" scenario where someone would benefit from this? No speculations :) Regards, Somik |
From: <dha...@or...> - 2003-05-16 05:02:29
Attachments:
EMPLOYMENT.jsp
|
> > I'd suggest the user-story driven approach. Do we have a > "real" scenario > where someone would benefit from this? No speculations :) > Somik, This is my "user" story. have code as follows: <!-- Some HTML header comments like copyright, standard function blocks etc... --> <% JSP Code for non-caching as well as initialization %> <HTML> blah blah blah </HTML I've attached a file for your reference. Thanx, Dhaval |
From: Somik R. <so...@ya...> - 2003-05-14 22:12:00
|
Dhaval Udani wrote: > Another problem: > > One more thing that I noticed: > > At the base level Parser.elements() gives me a list of all the first-level > nodes. Using any of the first level nodes I may obtain its next-level children > using CompositeTag.getChildren(). This being a NodeList I can easily add new > elements(nodes, tags etc) here. However I cannot add the same at the first > level. Use the HtmlScanner, to get the first level nodes under html. If you don't - there is no such thing as a "root node" to add children to. Regards, Somik |