View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002007 | JEDI VCL | 00 JVCL Components | public | 2004-07-28 06:13 | 2004-09-25 02:20 |
Reporter | anonymous | Assigned To | user72 | ||
Priority | normal | Severity | feature | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | 3.00 RC 1 | |||
Summary | 0002007: HTMLParser eventless tag parsing | ||||
Description | Hey, It would be great if the HTML Parser component could parse the page in a loop rather than using events to grab the tags. And also output easily usable tag properties. For example: While HtmlParser.DoParse do begin if HtmlParser.HtmlTag.Caption = 'input' then begin ShowMessage(HtmlParser.HtmlTag.Property['name']); ShowMessage(HtmlParser.HtmlTag.Property['value']); ShowMessage(HtmlParser.HtmlTag.Property['type']); end; end; That would loop until the we reach the EOF. Sometimes you really need to do the parsing and only then start using the results, unlike the current method which is even driven, and still makes you do a bit of parsing yourself (parse attribues yourself). Thanks! | ||||
Tags | No tags attached. | ||||
|
I've attached a very simple tag parser to this post. Try it out and see if it works for you. I only just whipped it together quickly and haven't spent more than 15 minutes on it, so it could probably be improved a lot but it should work nicely as a starting point. |
|
I've attached an updated JvHTMLTagParser including a demo that shows its use. Note that the parser doesn't really differentiate between different tag types (i.e start tags, end tags, comments, processing instructions etc) but just output them as is. The demo shows how you can handle these situations easily. In addition, note that any tag type can have content since the content is parsed after seeing a ">" in the input stream up until the next "<". |
2004-08-04 15:18
|
JvHTMLTagParser.zip (17,324 bytes) |
|
thanks peter3, I've tried the demo and it worked ;) |
Date Modified | Username | Field | Change |
---|---|---|---|
2004-07-28 06:13 | anonymous | New Issue | |
2004-08-04 07:27 |
|
File Added: JvHTMLTagParser.pas | |
2004-08-04 07:29 |
|
Note Added: 0004927 | |
2004-08-04 14:44 |
|
File Deleted: JvHTMLTagParser.pas | |
2004-08-04 14:44 |
|
File Added: JvHTMLTagParser.zip | |
2004-08-04 14:53 |
|
Note Added: 0004931 | |
2004-08-04 15:18 |
|
File Added: JvHTMLTagParser.zip | |
2004-08-04 15:18 |
|
File Deleted: JvHTMLTagParser.zip | |
2004-08-05 11:58 | anonymous | Note Added: 0004938 | |
2004-09-25 02:20 |
|
Status | new => resolved |
2004-09-25 02:20 |
|
Resolution | open => fixed |
2004-09-25 02:20 |
|
Assigned To | => user72 |