xHarbour Reference Documentation > Class Reference (textmode) |
Creates a new THtmlIteratorScan object.
THtmlIteratorScan():new( <oTHtmlNode> ) --> oTHtmlIteratorScan
The function returns a THtmlIteratorScan object and method :new() initializes it.
The THtmlIteratorScan class is derived from the THtmlIterator() class and has the same methods. The only difference is that search criteria can be defined to find a particular HTML node in an HTML tree. The search criteria is defined once with the :find() method, which searches for the first matching HTML node. Subsequent HTML nodes matching the search criteria are then searched with the :next() method.
The end of a search is indicated when either :find() or :next() return NIL instead of a THtmlNode object matching the search criteria.
See also: | THtmlDocument(), THtmlNode(), THtmlIterator(), THtmlIteratorRegEx() |
Category: | HTML functions , Object functions , xHarbour extensions |
Source: | tip\thtml.prg |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example use the Google.html file as created with the // THtmlDocument() example. A HtmlIteratorScan object is used // to scan the <form> node for <input> nodes. PROCEDURE Main LOCAL oHtmlDoc := THtmlDocument():new() LOCAL oHtmlNode, oHtmlIter oHtmlDoc:readFile( "Google.html" ) oHtmlIter := THtmlIteratorScan():new( oHtmlDoc:body:form ) oHtmlNode := oHtmlIter:find( "input" ) DO WHILE oHtmlNode <> NIL ? oHtmlNode:name, oHtmlNode:value, oHtmlNode:type oHtmlNode := oHtmlIter:next() ENDDO RETURN
http://www.xHarbour.com