Thank you! That looks very flexible, you'll have to give me some time to play
with this and see if I can use it (as I hope) to 'detag' an HTML page and pull
out all the info I need.

--- [EMAIL PROTECTED] wrote:
> Hello [EMAIL PROTECTED]!
> 
> On 20-Gen-00, you wrote:
> 
>  r> I still can't do what I need to do!
> 
> Tell me if this can be useful:
> 

[snip]

> REBOL []
> 
> html-rule: [some [tag | text]]
> tag: [ "<" [
>     "TABLE" (start-table) |
>     "/TABLE" (end-table) |
>     "TD" (start-cell) |
>     "/TD" (end-cell) |
>     "TR" (start-row) |
>     "/TR" (end-row) |
>     none ]
>     thru ">"
> ]
> text: [
>     copy content some characters
>     (process content)
> ]
> characters: complement charset "<>"
> 
> result: make block! 10
> buffer: make block! 10
> 
> discard: func [
>     "Discards unwanted content"
>     content [string!]
> ] []
> 
> store: func [
>     "Store content"
>     content [string!]
> ] [
>     append last buffer content
> ]
> 
> process: :discard
> 
> in-row: reduce [
>     func [
>         "Cell start"
>     ] [
>         append buffer make string! 100
>         process: :store
>     ]
>     func [
>         "Cell end"
>     ] [
>         process: :discard
>     ]
> ]
> not-in-row: reduce [none none]
> 
> in-table: reduce [
>     none
>     none
>     func [
>         "Row start"
>     ] [
>         set [start-cell end-cell] in-row
>         clear buffer
>         process: :discard
>     ]
>     func [
>         "Row end"
>     ] [
>         if 2 = length? buffer [
>             append result buffer
>         ]
>         set [start-cell end-cell] not-in-row
>         process: :discard
>     ]
> ]
> not-in-table: reduce [none none none none]
> 
> set [start-cell end-cell start-row end-row] not-in-table
> 
> start-table: func [
>     "Table start"
> ] [
>     set [start-cell end-cell start-row end-row] in-table
> ]
> 
> end-table: func [
>     "Table end"
> ] [
>     set [start-cell end-cell start-row end-row] not-in-table
> ]
> 
> parse-html: func [
>     "Parse the HTML source"
>     html [string!]
> ] [
>     clear result
>     parse/all html html-rule
>     result
> ]
> 
> 
> Regards,
>     Gabriele.


=====
Steve ~runester~ Jarjoura
"According to my calculations, that problem doesn't exist."
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Reply via email to