UK Legislation in HTML5
using the Akoma Ntoso data model
Original idea
to represent an Akoma Ntoso document in HTML rather than XML
Main principles
Simple examples
HTML semantic elements used
article
section
ol, ul
blockquote, q
img, figure
table
math
time (for dates)
sup, b, i, etc.
abbr
cite
ins, del (for amendments)
<article> and <section>
<article> represents a complete, or self-contained, composition ... that is, in principle, independently distributable or reusable *
<section> represents a generic section of a document … a thematic grouping of content, typically with a heading *
<section>s can be nested, with <h2> headings
More about <section>
Section structure
Akoma Ntoso
<section>
<num/>
<heading/>
<intro/>
<subsection/>
<subsection/>
<wrapUp/>
</section>
HTML5
<section class="section">
<h2>
<span class="num"></span>
<span class="heading"></span>
</h2>
<div class="intro"></div>
<section class="subsection"></section>
<div class="wrapUp"></div>
</section>
A sample document
All documents on leg.gov.uk are available in HTML with data.html extension
For example, the European Union (Withdrawal Agreement) Act 2020 is available at http://www.legislation.gov.uk/ukpga/2020/1/enacted/data.html
Corrected version available at https://storage.googleapis.com/akn2html/ukpga_2020_1_enacted.html
Validation at https://validator.w3.org/nu/?doc=https%3A%2F%2Fstorage.googleapis.com%2Fakn2html%2Fukpga_2020_1_enacted.html
Recognizable structure
The structure of legislation should be recognizable to general purpose HTML tools.
For example: https://gsnedders.html5.org/outliner/
Metadata