|
|
|
# XSweet Header Promotion
|
|
|
|
|
|
|
|
A transformation of XHTML producing h1-h6 via a rough-cut heuristic analysis of HTML.
|
|
|
|
|
|
|
|
Contiguous (flat) p are analyzed; depending on analysis, an XSLT transformation is produced, capable of transforming "sloppy" HTML inputs (that is, with @style and @class but not much else) into "headers".
|
|
|
|
|
|
|
|
Header promotion does this by grouping and assessing paragraphs together, in families. Paragraphs are judged likely to be headers if they pass criteria such as "the font size is bigger", "the font is bold", "the contents are all capitals", "there are never periods at the end", and "on average this paragraph is pretty short". The criteria are adjustable by adjusting the internals of the analytical stylesheet.
|
|
|
|
|
|
|
|
The analytical stylesheet contains internal comments, qv:
|
|
|
|
(master/applications/header-promote/digest-paragraphs.xsl)
|
|
|
|
|
|
|
|
Results of running the analytical stylesheet are then used as input to a generic XSLT that maps the particulars of the file set (they have elicited) |
|
|
\ No newline at end of file |