A: Teslea has to cope with existing HTML pages, and very few of them validate against the HTML DTD (Document Type Definition). There are two possibilities:
- Adopt a strict position and reject all invalid pages. Most users would be very disapointed not to be able to see many pages that other Web clients can display;
- Accept invalid pages and let the software fix the most common bugs.
Teslea is build with the latter option and should try to fix bugs, but without losing information. If an element is not valid in a given context, Teslea tries to change the structure locally to make that element valid, but it doesn't delete the element or move it to a different place, which could change the document meaning. The issue is that a DTD only specifies the structure of a document class, not its semantics. When you consider an invalid document, there are often several ways to transform its structure to make it valid, but each transformation may have a different impact on the document semantics. The DTD does not allow you to choose the right transformation. Another important design decision is that, even if it accepts invalid documents, the structure and markup that it produces is always valid. Obviously, only elements created or changed by Teslea itself are concerned here. Some invalid parts of the original document may remain when the document is saved. The above remarks only apply to HTML documents. For XHTML, Teslea has a different, very strict behaviour: it stops parsing a document when it encounters a well-formedness error. The motivation is to help XHTML to deploy in a clean way.