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.
The following is an English paraphrase of the XTRAN rules used for this example. These rules comprise 91 (net) lines of XTRAN's rules language.
For each HTML "statement"
If nonmarkup text line or segment
For each imbedded substitution in text
Tally substitution name occurrence by name
Record source file and line of this occurrence
Sort substitution names
For each substitution name seen, alphabetically
Report substitution name with tally
For each occurrence of this substitution name
Report occurrence source file and line
Running these rules on this HTML page generated the following XTRAN analysis output:
HTML Imbedded Substitution Usage
& 3
htmsub.htm(19)
htmsub.htm(57)
htmsub.htm(60)
9
htmsub.htm(19)
htmsub.htm(19)
htmsub.htm(27)
htmsub.htm(30)
htmsub.htm(30)
htmsub.htm(49)
htmsub.htm(75)
htmsub.htm(75)
htmsub.htm(94)
COPYRIGHT 2008; reproduction prohibited without permission. Revised 2006-11-27
XTRAN is a trademark of Pennington Systems Incorporated.
Pennington Systems Incorporated
8655 East Via de Ventura, Suite G200
Scottsdale, Arizona 85258-3321
Phone: +1(480)626-5503
Fax: +1(480)626-7618
Email: Info@Pennington.com
Web: http://WWW.Pennington.com