This library produces a domain tree of a given HTML document, allowing the developer to navigate and change the document in an methodical way. In addition to the basic HTML production, this library can also be used to produce XHTML documents, as it includes an HTML 4 entity encoder. Included in this release is a demonstration application in VB.NET showing how to use the library. I hope that it is all fairly self-explanatory.
This library was written to avoid having to convert a document into XML prior to reading, whilst preserving the distinct HTML qualities. This gets round some deployment issues I had with different platforms.
Using the code
The simplest way to use the code is to add it into your solution as a C# class library. There are no third-party dependencies so it is just a matter of adding the source files in. Alternatively, you can build the DLL and add it as a reference.
Points of Interest
The XHTML production is fairly basic - there is no built-in DTD checking. So far, I have had no problems in the generation, but I'm keen on getting that sorted.
- Bugfix: <!DOCTYPE...> and <!...> now treated as comments
- Bugfix: Malformed or incomplete attribute values causing infinite loop fixed
- Bugfix: <tag/> now handled properly
- Bugfix: Parse errors of scripts
- Bugfix: Parse errors of styles
- HTML 4 entity encoding
- DOM tree navigation
- Basic node searching
- HTML production
- XHTML production (as per http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd)
- Added some component model stuff & comments
- Hid the parser