Re: A html componet
- From: "John McTaggart" <john_at_compnet101_dot_com>
- Date: Wed, 17 Aug 2005 07:46:38 -0700
> I am in the middle of writing my own parser that will turn a
> given HTML source into an object tree. But, I dont want to
> to do it --if I can find something else that does what I
> want to do.
>
> Here it is:
>
> I have a web page that contains various numbers of tables
> (it varies due to the POSTed data).
>
> Table cells contain information that differ by the kind of
> font they are displayed (same cell can have several kinds
> of fonts --colors, fontstyle, fontname, size etc.)
>
> So, I need something a lot more intelligent than a simple
> parser that returns tags --I dont want to spend decoding
> every single tag for every single cell just to be able
> to get the text + font information. I'd like it to be
> done by a component.
>
> Can ATagParser do this?
Sure.
If you're wanting to deal with the actual attributes of
specific tags, you could use the OnAttribute event..
procedure TForm1.ATagParser1Attribute(Sender: TObject;
Attribute: TAttributeElement; var Abort: Boolean);
var
TagIndex, AttrIndex: Integer;
begin
TagIndex := FindTagID(Attribute.ParentTagHash);
Case TagIndex Of
TID_TABLE :
Begin
AttrIndex := FindAttributeID(Attribute.Hash);
Case AttrIndex Of
AID_FACE :
// Attribute.Value = font name
AID_SIZE :
// Attribute.Value = font size
End;
End;
End;
end;
Hope this helps..
John McTaggart
.
- Follow-Ups:
- Re: A html componet
- From: adem
- Re: A html componet
- References:
- A html componet
- From: fer
- Re: A html componet
- From: John McTaggart
- Re: A html componet
- From: James David
- Re: A html componet
- From: John McTaggart
- Re: A html componet
- From: adem
- A html componet
- Prev by Date: Re: A html componet
- Next by Date: Re: A html componet
- Previous by thread: Re: A html componet
- Next by thread: Re: A html componet
- Index(es):
Relevant Pages
|