- DIRegEx 8.6.5 Fix Pattern compilation bugs (one of which could cause an AV), improve mutual recursion performance.
Table of Contents
DIHtmlParser Plugins link themselves into the main parsing process of TDIHtmlParser. As the parsing proceeds, they receive the same information about the parsing process as the main parser. The plugins can then react on that information and perform specific tasks which are not built into TDIHtmlParser by default.
Plugins are a flexible approach to extend the functionality of TDIHtmlParser. They can act on HTML data in completely new ways unknown to TDIHtmlParser at the time of its writing. This allows the parser to stay small and concentrate on what it does best: Fast and reliable HTML parsing. Each of the plugins, on the other hand, can add its own specialized functionaly to the core HTML parser as required.
Think of how to extract the title text of an HTML document. You would probably first want to locate the
The TDIHtmlTablesPlugin plugin locates and extracts a HTML document's title in parallel to the main parsing process without you having to do anything. When the plugin has found the title, it stores its text and triggers an application callback. Alternatively, your application can request the title from the plugin when the parsing is done. It is as simple as that.
DIHtmlParser ships with a number of plugins all ready to use.
The TDIHtmlCharSetPlugin watches out for character set information in HTML documents and automatically updates the character decoding of the HTML parser. This is usefull if the character set is unknown prior to the parsing or changes in the middle of a document.
The TDIHtmlEmailsPlugin scans an HTML document for links to e-mail addresses. For each hit it can trigger an application event and / or add the address to an internal list for later retrieval. This plugin should not be abused for an e-mail harvester.
The TDIHtmlEventsPlugin triggers events for HTML piece. This turns DIHtmlParser into something like an HTML SAX parsers. TDIHtmlEventsPlugin supports tag filtering (as all plugins do), which SAX parsers do not!
The Writer plugin automates the writing of HTML data to another HTML document. It writes over 70 different character sets and encodings (more than 150 with DIConverters) and automatically substitues HTML entities when necessary.
products/htmlparser/plugins.txt · Last modified: 2007/09/06 18:54 (external edit)
|Copyright (c) 2000-2011 Ralf Junker – http://www.yunqa.de/delphi/ – Disclaimer – Haftungsausschluss – Impressum|