XTRAN treats HTML as a computer language, in which each "statement" is a tag, a line or segment of nonmarkup text, or an end tag. Each attribute of a tag is a "statement attribute".
The following is an English paraphrase of the XTRAN rules used for this example. These rules comprise 102 (net) lines of XTRAN's rules language.
For each HTML tag occurrence
Tally tag occurrence
For each of tag's attributes if any
Tally attribute occurrence for tag
Sort tags
For each HTML tag seen, alphabetically
Report tag tally
Sort attributes for tag
For each attribute seen for this tag, alphabetically
Report attribute tally
Running these rules on this HTML page generated the following XTRAN analysis output:
HTML Tag and Attribute Usage
!DOCTYPE 1
A 5
HREF 5
B 11
BODY 1
LINK 1
VLINK 1
BR 10
FONT 2
COLOR 1
FACE 2
SIZE 2
H3 1
HEAD 1
HR 2
SIZE 2
HTML 1
IMG 2
ALT 2
BORDER 1
HEIGHT 2
SRC 2
WIDTH 2
META 3
CONTENT 3
HTTP-EQUIV 1
NAME 2
P 7
ALIGN 1
PRE 2
TITLE 1
COPYRIGHT 2008; reproduction prohibited without permission. Revised 2006-11-27
XTRAN is a trademark of Pennington Systems Incorporated.
Pennington Systems Incorporated
Email: Info@Pennington.com
Web: http://WWW.Pennington.com