This package provides classes to generate (X)HTML markup. The implementation is minimal and only covers HTML tags most common in presentation and formatting,
not form or web-app generation. It is primarily geared toward generating static HTML documents although nothing prevents its use from MTApplet
for dynamic content.
The tag hierarchy is much looser than that of the SVG package. HTML tag structures are much more flexible and can be intertwined more so than SVG so more responsibility is placed on the user for proper nesting and construction.
The MathTools.markup.html.*
package can generate all three! By design the tag classes use the loosest possible structure to allow the maximum
flexibility when generating HTML markup. This means it is both possible and not difficult to generate documents that will not validate correctly under 'Strict'
DTDs or 'X' convention, even though all tags will be properly formed and closed. Attributes are also properly quoted and assigned so values are always
present.
The responsibility, then, of proper X- or Strict HTML falls upon the shoulders of the user! For XHTML do not use tag classes not permitted there. For Strict-DTD HTML do not use 'bad' structuring. For 'loose' HTML documents use whatever whenever.
The javadoc for this package (and others) often uses the term HTML Document, which may refer to a web page but might not. As has been stated previously
(and frequently!) MathTools is designed as a single-user desktop application and not for server-side use. While it does have 'web-ish' capabilities
MathTools is NOT a web-app! So why bother with HTML and MTApplet
? The answer lies in MathTools' definition of HTML documents.
All web pages are HTML documents but not all HTML documents are web pages! HTML is a common open format, both extensible and well-defined. Any web browser available can load HTML from a hard drive, USB drive, network drive (not server), CD or even floppy disk. This makes HTML an excellent choice for truly universal formatting.
The Firefox browser understands (and can render) both SVG and MathML natively: no unnatural contortions required! This makes it an ideal platform for generating
math tests if OpenOffice is not available or not desired. To generate a test, use HTML with MathML and SVG as required. Including graphs in image format
needs only an IMGTag
to render and display properly. Then, when the HTML document is complete, load it into a browser and print it!
HTML, especially that which does not require 'X-' or Strict DTD validation, is extremely easy to generate and manipulate. This again makes HTML a prime choice for generating test documents. Finally, even though MathTools is not ideal for server-side use, it can operate on the client side quite readily.
So. Use HTML as needed, these classes are designed to simply the process of HTML Document generation, whether for web pages or something else.